Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Graceful



  Gracefully exiting from console programs in Ruby

Imagine you write a CLI program or a Rake task which loops through some data performing some work on it. You run it and then you remembered something. You’d love to kill the process with ctrl-c, but that will raise an exception somewhere in the loop. What you want is for the iteration to complete and then you want the program to quit. You could handle the Interrupt exception or add some conditions. But how about a cleaner and reusable way? No problem - you can trap signals, which...

   Ruby,Exit,Command window,Console,Graceful     2012-03-14 13:42:16

  New function signal.NotifyContext in GoLang 1.16

os/signal package in GoLang may not be frequently used but it provides some good features like Shutdown() which can be used to gracefully shutdown a running HTTP server. func (srv *Server) Shutdown(ctx context.Context) error With this function, there is no need to use third party library to gracefully shutdown HTTP server. How is it being used? package main import ( "context" "fmt" "net/http" "os" "os/signal" "time" ) func main() { server := http.Server{ Addr: ":8080", } http.Handl...

   GOLANG,NOTIFYCONTEXT,GRACEFUL SHUTDOWN     2021-06-19 01:07:10

  Beauty of code : How to write graceful PHP code

Writing good code is an art. In order to achieve this, it is necessary to develop good programming habits at the beginning. Good programming habits not only contributes to the early project design (modular),but also allows you to the code easier to understand, so that the maintenance of the code is easier. Bad programming habits will result in more code bugs, and will make future maintenance work difficult. We introduce some good programming habits taking PHP as example. Hope this will help you....

   PHP,Good code     2012-08-26 12:23:03

  Let your page be alive

With development of Internet, Web pages lie everywhere. How to design a visually attractive web product is becoming a major concern of designers, A complete webpage consists of the combination of points, lines and layers. If you want to let your page design be alive, you should put your efforts on below 4 aspects. 1. Flexible font use In a webpage, texts are the major information carrier and are what users care mostly about. It's the main element to convey messages to readers. The font size, col...

   UI design,White space,Geometric graph     2013-07-23 03:09:51

  Oval engagement rings from MoonOcean: Elegance of form and individual approach

Welcome to the enchanting world of MoonOcean, a premier destination for unparalleled elegance in the heart of London's vibrant jewellery scene. Immerse yourself in our exclusive collection, where the spotlight is on the captivating allure of oval engagement rings, embodying both exquisite craftsmanship and a commitment to individuality. Nestled in the heart of London, MoonOcean stands as an emblem of sophistication, redefining the jewellery experience. Our curated array of oval engagement rings ...

   ENGAGEMENT RING,MOONOCEAN     2024-03-18 07:56:20

  Unix Philosophy

First, let me tell two stories.The first one is one Japan soap factory had a problem that they sometimes shipped empty boxes to the customer without soap inside. So they spend much time and money to invent a X-ray machine to check whether the soap box is empty.The same thing happens in a small factory which doesn't have too much money. The solution of them to solve this problem is they use a desk fan to blow the empty boxes out of the belt and into a bin.The second story is NASA finds that in sp...

   Unix Philosophy,Simple,Rules     2012-05-06 06:49:26

  4 Challenges Women Entrepreneurs Face and How to Overcome Them

  The statistics on women entrepreneurship is becoming mindblowing with each passing day. In fact, if you just take a glance over the figures of past a few years, a huge percentage of women entrepreneurs have come up in the UK. Also, the scenario is the same in all other parts of the world as well. According to a 2017’s report by American Express, the women entrepreneurship organizations have grown up to 114%. Also, it is true that now one among the five firms belongs to women entrep...

   CAREER,WOMEN     2018-10-24 08:11:11

  A New Experimental Feature: scoped stylesheets

Chromium recently implemented a new feature from HTML5: scoped stylesheets, aka. <style scoped>. A web author can limit style rules to only apply to a part of a page by setting the ‘scoped’ attribute on a <style> element that is the direct child of the root element of the subtree you want the styles to be applied to. This limits the styles to affect just the element that is the parent of the <style> element and all of its descendants. Example Here’s a...

   HTML5,Style,Draw,Use case     2012-03-23 12:11:47

  9 reasons to use Zsh

Like majority *nix users, I have been using bash for many years. Sometimes I feel uncomfortable with bash. I tried use some other shells as well such as ksh, tcsh and zsh which I am going to talk about. A few days ago, I found an open source project ranking in the 6th named oh-my-zsh on Github, I downloaded it and had a try with it. It's amazing. We should use zsh to replace bash now. Why do we need to use zsh? Here is a 4 minutes YouTube video which shows many reasons why we should switch from ...

   zsh, advantage, command     2012-09-28 12:46:39

  Mock Solutions for GoLang Unit Test

In Go development, Unit Test is inevitable. And it is essential to use Mock when writing Unit Tests. Mock can help test isolate the business logic it depends on, enabling it to compile, link, and run independently. Mock needs Stub. Stub function replaces the real business logic function, returns the required result, and assists the test. I involved the related test code for Controllers while writing Kubernetes Operator recently, and there would be mocks for GRPC and HT...

   UNIT TEST,TESTIFY,GOSTUB,GOMOCK     2020-10-31 21:59:15