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

SEARCH KEYWORD -- Arrays.equal()



  Never create Ruby strings longer than 23 characters

Looking at things through a microscopesometimes leads to surprising discoveries Obviously this is an utterly preposterous statement: it’s hard to think of a more ridiculous and esoteric coding requirement. I can just imagine all sorts of amusing conversations with designers and business sponsors: “No… the size of this <input> field should be 23… 24 is just too long!” Or: “We need to explain to users that their subject lines should be les...

   Ruby,Specification,String,Interpreter,Optimization,23     2012-01-05 07:58:07

  HTML5 Can Get the Job, But Can HTML5 Do the Job?

This post is part of our ReadWriteMobile channel, which is dedicated to helping its community understand the strategic business and technical implications of developing mobile applications. This channel is sponsored by Alcatel-Lucent. As you're exploring these resources, check out this helpful resource from our sponsors: Cultivating a Developer Ecosystem: Understanding Their Needs HTML5 is changing the way that developers create applications for the mobile Web. Yet, it is not the be a...

   HTML5,Future,Job,New feature     2011-08-12 07:45:29

  The trap of the performance sweet spot

This post is about JavaScript performance but I would like to start it by telling a story that might seem unrelated to JS. Please bear with me if you don’t like C.A story of a C programmer writing JavaScriptMr. C. is a C programmer as you can probably guess from his name. Today he was asked by his boss to write a very simple function: given an array of numbered 2d points calculate vector sum of all even numbered points... He opens his favorite text editor and quickly types somet...

   C,JavaScript,Sweet spot,Memory,Low level,Trap     2011-11-06 14:45:01

  Building the new AJAX mail UI part 2: Better than templates, building highly dynamic web pages

This is part 2 of a series of technical posts documenting some of the interesting work and technologies we’ve used to power the new interface (see also part 1, Instant notifications of new emails via eventsource/server-sent events). Regular users can skip these posts, but we hope technical users find them interesting. As dynamic websites constructed entirely on the client side become de rigueur, there are a number of templating languages battling it out to become the One True Wayâ„...

   Web design,Dynamic,Ajax,UI     2012-02-21 05:32:29

  The Hungry Programmer

Programming is a lot like eating. Tonight I was hungry. I wasn't at home. I couldn't go to the kitchen for a snack. I looked around and saw only McDonald's across the street. Then I was struck with the same dilemma that I face whenever I leave the comfort of my own home for any decent spread of time: Do I eat crappy food now and satisfy that hunger? Or do I stay hungry for a little longer and eat a healthy meal back at home? As I pondered this dilemma I couldn't help but notice how much i...

   Programmer,Hungry,Coder,Coding     2012-01-19 11:04:30

  Why localStorage only allows to store string values

localStorage allows data to be stored in browsers across sessions, the data will be there even though the session is expired. It is frequently used to store static data so that they can be loaded when needed. But as per spec, it says that the keys and the values are always strings (note that, as with objects, integer keys will be automatically converted to strings). Why cannot store the object as it is? Take a look at an example: var str = "test"; localStorage.setItem("str", str); cons...

   JAVASCRIPT,LOCALSTORAGE     2020-04-05 00:54:29

  Deep clone of JavaScript object

In JavaScript world, it's frequently seen object clone. Normally when creating a clone of an object, it's only the reference being cloned but not all contents. In some scenarioes, it's desired to clone all the content instead of just the reference such that any change made to the cloned object will not change the original object. Differences between shallow clone and deep clone can be as simple as: Shallow clone : Only the object reference is cloned but not the content Deep clone : Clone all co...

   JAAVSCRIPT,DEEP CLONE,DEEP COPY,SHALLOW CLONE,SHALLOW COPY     2016-10-31 00:27:24

  Remove duplicated elements in JavaScript array

During interviews, one frequent question asked would be something like how to remove duplicated elements in a JavaScript array and how many different ways you can think of. The interviewee would also be asked to write the code down. In real applications, normally front end would not need to handle this case since normally it would be done by backend, but still it's necessary for front end developers to know different ways of doing this. This post will share some of the common ways to remove dupl...

   JAVASCRIPT,ARRAY,DUPLICATED ELEMENT     2018-09-21 22:32:10

  A simple example of git bisect command

git bisect is a very powerful command for finding out which commit is a bad commit when bug occurs.  The rationale behind this command is that it pin locates the bad commit by divide and conquer. It divides the commit history into two equal parts, then determines whether the bad commit is at the first half or at the other half. This process will continue until the bad commit is located. Here is a really good example created by bradleyboy, this is a simple git repository which demonstr...

   GITHUB,GIT,GIT BISECT     2019-07-12 10:31:51

  Illiterate Programming

Donald Knuth cleverly imprisoned the phrase "Literate Programming" - if you're not documenting your source with his particular methodology then you must be a proponent of "Illiterate Programming," which sounds truly awful. I very much believe in documented code but I think no amount of pontification in English will ever make a piece of code clearer than the code itself (I'm not talking about project or API documentation). I'm also not talking about the super...

   Programming,Illiterate     2012-02-10 06:20:52