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

SEARCH KEYWORD -- Demo



  Ways to make elements in HTML center aligned horizontally

In our daily HTML design,  it is an easy job to horizontally center align an element with known width. <div class="element">I am<a href="http://www.aiubug.com" target="_blank" rel="external" title=""> bug </a>!</div>  .element{width:960px;margin:0 auto;}  The above codes set the width of the div block and horizontally center align it. It's very easy to implement. However, if we have some elements we don;t know their width and we still want to...

   HTML,CSS,Center align,Unknown width     2012-07-11 12:55:00

  Implement struct no copy in GoLang

There is some case where some of the struct in GoLang which is not meant to be copied. For example, sometimes a global configuration which should have only one version passed around the whole application and should not be copied and modified. In GoLang, there is no intuitive solution on preventing copying of struct. But there is still some way which can be leveraged to help prevent this while developing the code. The trick is to define some struct implementing sync.Locker interface and has this ...

   GO VET,NOCOPY,NO COPY     2020-09-04 22:24:58

  6 amazing HTML5 animation effects

HTML5 is rapidly developed in WEB world, it puts all kinds of pressure to browser development, but at the same time it also brings us lots of unexpected page effects. If we can use some HTML5 elements on our web apps,  we may get different user experience. However, for HTML5, there are lots of places need to improved. The following HTML5 animation effects are very attractive. 1. HTML5 mouseover image effect This HTML5 animation effect can be used in photo gallery, users can preview the...

   HTML5,Animation     2012-11-20 10:32:52

  A JS1K competition demo for 2012

JS1K is a website which hosts some competitions to attract geeks from the world to create  JS apps which are less than 1K (1024 bytes). The object of this competition is to create a cool JavaScript "application" no larger than 1k. Starting out as a joke, the first version ended with a serious amount of submissions, prizes and quality.Recently, I revised a previous project of mine and compressed it to 1018 bytes and submitted it. It is an analog clock. The code is shown below:w=c.width;h=c...

   JS1K,HTML5,Competition,Analog clock,Love     2012-03-13 12:17:40

  The magic of go:linkname

When writing Go program, there is frequent need on using time.Sleep() function to pause the logic for some time. And if jumping to the definition of this function, can see below definition: // Sleep pauses the current goroutine for at least the duration d. // A negative or zero duration causes Sleep to return immediately. func Sleep(d Duration) I's strange that there is no function body defined here. What happened? The actual definition of the function body is residing at runtime/time.go&nb...

   TRICKS,GO:LINKNAME,GOLANG     2022-04-10 08:39:00

  Life in Apple design team

While in mentioning about Apple, everyone of us will think of the amazing products shipped out by Apple such as iPhone and iPad. We are all impressed by its smooth design and handy user experience. But as a outsider do you know the story behind the amazing design of Apple? Apple has a team of world class designers and they are leading the fashion of design. What's the life in Apple's design team? Ben Williamson from Apple shared one story of him which can give us some hints on what the life is ...

   Apple,Design,Perfect     2014-01-02 07:00:27

  20 cool jQuery countdown scripts and plugins

Have you ever seen the count down component of Apple before its app downloads reached 50 billion times? It's really cool. On a website, we often need to have a count down function, for example, when a e-commerce site initiates some promotions or some organizations want to start an event. In this post, we introduce some cool jQuery countdown scripts and plugins. Circular Countdown jQuery Plugin MORE INFO / DEMO Coconut – Jquery Countdown Plugin - MORE INFO / DEMO ...

   jQuery,countdown,plugin     2013-09-01 22:07:57

  Speech recognition breakthrough from Microsoft

Recently, Microsoft Research published a demo video on YouTube that demonstrated simultaneously translating English speech to Chinese speech with Microsoft's new research achievement. The result is quite impressive, it has large improvement compared to previous speech recognition systems. It's a big breakthrough of speech recognition. In this demo, Microsoft Chief Research Officer Rick Rashid demonstrates a speech recognition breakthrough.First when he speaks, the screen will display what he is ...

   Speech recognition, Text to speech,Machine translation     2012-11-09 23:53:21

  Load and execute JavaScript

When we load and execute JavaScript in a webpage, there are many points we need to care about because of its design and feature. There are two features about JavaScript execution in a browser: 1). The JavaScript codes will be executed immediately once loaded;2). When JavaScript codes are being executed, they will block the following contents (including page rendering and other resources downloading). So if there are multiple js files to be loaded, these codes will be executed sequentially. Since...

   JavaScript,async,defer,load,execute     2013-06-07 04:53:46

  Update parent window after closing the window opened by window.open()

Imagine we have a webpage which has a text field to let user enter a date. Usually, we may create a calendar window to ask the user to pick one date from the calendar window, when the date is picked, the calendar window will close and the date picked will be put into the text field. This way involves the window.open() method in JavaScript, and we may think how the opened window knows its parent window and then updates the parent window. I give a simple demo on this.We have two pages, on is the p...

   window.open, JavaScript,update, return value     2012-06-23 01:36:32