JavaScript debounce and throttle

There are events in JavaScript that fire more rapidly than you would want. For exam­ple, lets say you want to do an auto-complete on key­press. There is only one way to hook to the user typ­ing in the text-box, key-down, key-up or key­press. Firstly you don’t want your client func­tion to be called each 1/10th of […]

Binary Tree problem guidelines and characteristics

On a very high level — there are cer­tain char­ac­ter­is­tics about tree prob­lems that pop-up very often. They pop-up in real world sce­nar­ios. For exam­ple a restricted BFS will give you the LinkedIn like degree of con­nec­tion. Doing a full BFS for each con­nec­tion is a bit pricey, but doing it to a 2nd or 3rd […]

Refactoring and obsession for code quality

When a noob starts cod­ing the fight is to actu­ally build solu­tions and come up with a work­ing code. Even a mod­er­ate level of cod­ing task seems to take up most of the minds pro­cess­ing power in syn­tax and mod­el­ing and imple­ment­ing the algo­rithm bug-free. There is less time and brain energy left for code-cleanliness, […]

Promises versus Deferred

A very com­mon ques­tion after read­ing promises and deferred in the­ory, that comes to our mind is what is the dif­fer­ence? a promise rep­re­sents a value that is not yet known a deferred rep­re­sents work that is not yet fin­ished Another way to look at this is:  promise is a place­holder for a result which is initially […]

Parallels between .NET C# and JavaScript

Talk­ing about asyn­chrony which is gain­ing more and more atten­tion these days. C# recently added the WhenAll and When con­structs to the library through the TPM. TPM started out as a sep­a­rate open source project which was then merged into the .NET frame­work. JavaScript has a par­al­lel for the When — called the promises. What these […]

String Immutability and password string protection

Strings in .NET are immutable objects. Once they are allo­cated, their mem­ory con­tent can­not be changed. When a string needs to be mod­i­fied, the .NET CLR will send the old string to the garbage col­lec­tor, instan­ti­ate a new string object with the desired value, and update the exist­ing vari­able pointer to point to the new […]

CSS Preprocessors: Things to know LESS and SASS

Some­times we tend to for­get why are we using a tech­nol­ogy or frame­work when we’re in the weeds. Here’s a step back to remind us of the pain points and an intro­duc­tion to go over the basics. The CSS pain points Color prob­lem: The col­ors can­not be vari­ables or defined in place where one change affects […]

Distributed Computing — Dan Garcia

Notes based on lec­ture from Dan Gar­cia at UC Berke­ley. Basics include talk­ing about Mem­ory and Net­work. The dis­trib­uted com­put­ing — themes and chal­lenges. The solu­tion to prob­lem is Map reduce. Mem­ory The mem­ory is divided into lev­els. The lower the level, the closer it is to the proces­sor. Level 1 is clos­est to processor. […]

Guided Tours: Bootstrap tour vs. LinkedIn Hopscotch

Fea­tures Hop­scotch Boot­strap­Tour Notes Effi­ciency Rough IE based quick met­ric** Javascript file size (mini­fied) 21kb 24.97kb CSS file size (mini­fied) 11.2kb 2.32kb Javascript load time 78ms 281ms CSS load time 47ms 141ms Options Per Step Options Per Step Options tar­get ele­ment place­ment place­ment title title con­tent con­tent width x padding x xOff­set x yOff­set x arrowOff­set x […]

TCP vs. UDP

Again, before trash­ing my notes, here’s a quick list. I don’t go into the detail, but on a high level its a good start.   TCP UDP I am depend­able I am fast Connection-oriented Connection-less Ordered Un-ordered Reli­able pack­ets trans­fer Not-so-reliable packet trans­fer Heavy weight (slow) Light weight (fast) Fire and For­get Chilled out receiver pro­cess­ing ACK […]

  • Tag Cloud

  • Categories