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

SEARCH KEYWORD -- Bar



  A simple example on implementing progress bar in GoLang

Sometimes when handling a long running process, there would be need to track the progress so that people know something is still running instead of doubting something goes wrong. In this case, a progress bar which indicates the current status and progress would be desired. This post will show an example on how to implement progress bar using GoLang. Let's take a look at the final outcome first before jumping into the implementation detail. The key in the implementation is actually just the \r ...

   TUTORIAL,EXAMPLE,GOLANG,PROGRESS BAR     2020-08-08 23:53:15

  YouTube video player control bar becomes transparent

YouTube has made an update on its video player control bar and made it general available to the public now. The update is to make the video player control bar transparent and float on top of the videos being played. There are no functional changes about this control bar.  The original control bar is black but not transparent. After the update, the control bar looks like: YouTube started to test this new change back in April 2015. At that time, it was tested in a small scale and only a sma...

   YouTube,Video Player,HTML 5, Transparent     2015-08-04 05:14:42

  do {...} while (0) in macros

If you are a C programmer, you must be familiar with macros. They are powerful and can help you ease your work if used correctly. However, if you don't define macros carefully, they may bite you and drive you crazy. In many C programs, you may see a special macro definition which may seem not so straightforward. Here is one example: #define __set_task_state(tsk, state_value) \ do { (tsk)->state = (state_value); } while (0) There are many this kind of macros which uses do{...}while(0)...

   C,macro,C++     2014-01-23 07:16:13

  Error handling style in C

Following are three error handling styles in C.Which one you like the most? Or you don't like any one?1. /* Problem : Not enough. Easy to be wrong */int foo(int bar){        int return_value = 0;        int doing_okay = 1;        doing_okay = do_something( bar );        if (doing_okay)        { ...

   C,Error handling style,Goto,Nested if     2012-04-24 06:51:00

  A simple example of drawing bar chart with label using d3.js

D3.js is a very popular graph library to help developers draw various kind of charts using JavaScript in a webpage. It utilizes the SVG format supported by all major modern browsers and can help developers get rid of the old age of Flash or server side graph drawing libraries. In this post, we will introduce some simple examples of drawing bar chart with labels using D3.js.  First, let's see what will be the final look of the graph drawn. Below is the complete source code for this example....

   JAVASCIPT,D3,BAR CHART,LABEL,TUTORIAL     2020-05-16 23:25:40

  Screen recording in Windows 10

Have you ever wondered how to take screen recording easily on Windows? Normally you would think to download some software online and install it on your machine such as Camtasia. However, many of them are either non-free or uneasy to use. Fortunately, there is a built-in tool provided in Windows 10 which can be used to take simple screen recording plus audio recording. The tool is called the Game Bar which is primarily intended for gamers to take screenshots of their plays and achievements. Don't...

   WINDOWS 10,GAME BAR,SCREEN RECORDING     2018-03-06 11:42:07

  The worst part working at Google

Google is rated as the best employer to work for in last few years. This is because Google provides not only flexible working environment but also attractive welfare. For the benefits of working at Google, you can find many posts online. However, is there any bad part to work at Google? The answer is YES. There is no perfect company in the world, there are also bad parts working at Google.  The worst part of working at Google, for many people is that they're overqualified for their job. Goo...

   Google,Bad part     2013-10-24 22:10:37

  Name resolution order in JavaScript

To understand what value a variable has in JavaScript, we need to understand some concepts such as scope and name resolution order. JavaScript has two scopes; one is program level and the other one is function level. Unlike in C,C++ or Java, JavaScript has no block level scope. So a variable defined in a if block will still be available outside. For example, the below example: var foo = 1; function bar() { if (true) { var foo = 10; } alert(foo); } bar(); The alert will display 10 since the ...

   JavaScript,Scope,Name resolution     2013-07-10 01:29:28

  The 10 most expensive domains on the Internet

Domain name is the name which we usually type on the web browser address bar. For example, we may type http://www.apple.com on the address bar, here www.apple.com is the domain name. Can you imagine that this domain is worth millions of dollars? We believe that most domains are initially for starting related business and easy for users to remember. But with the popularity of the business, some of the domains become valuable and they are more expensive than some small companies. Below are some mo...

   Domain name,Price     2013-01-01 10:32:06

  Data as code

What is a good command line parser API? A good command line parser should consider below 5 aspects: Support convenient help information generation Support sub commands, for example, git has push,pull,commit sub commands. Support single character option, word option, flag option and option with parameter. Support default option, for example, if no -port is set, set it as 5037 Support usage model, for example, tar's -c and -x is mutually exclusive, they belong to different usage models. Here are...

   Command line,API     2013-08-08 22:40:36