Software, life, and random thoughts
Home/Tags/javascript/

Tag : javascript

  1. I finally got to mess around with PhantomJS and Jasmine, and couldn’t find a resource that gives clear, concise, accurate information, without language specific or build tool specific coupling, so I decided to write it myself. Fortunately, it is way simpler than I thought. PhantomJS PhantomJS is a standalone, cross platform command line application…
  2. Backbone gives us a very powerful set of tools. It gives us models, views, and routes - all event driven, consistent and beautifully embrace underscore.js functionality. Being a library rather than a framework, Backbone doesn’t give us application structure. That “glue” we need too initialize the app and glue all the pieces together. Since coding…
  3. RPN (Reverse Polish Notation) is a mathematical notation wherein every operator follows all of its operands, which was designed to reduce computer memory access and utilize the stack to evaluate expressions. The syntax looks like: A typical interview question would be to implement a RPN calculator since it is simple enough to resolve in less than…
  4. PubSub (or the observer pattern) is obviously the hottest pattern in client side development, and I would like to take a shot at trying to refine the best practices for using it in a flexible and robust way. The definition provided in the original Gang of Four book on Design Patterns states: “Define a one-to-many dependency between objects so that…
  5. I ran across PEP 20 — The Zen of Python by Tim Peters, and figured very little needs to be changed to make it a valid javascript zen: Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special…
  6. Lets say you have a Backbone.js based messaging system on your application, and you want to stay synced with the server so you could alert your users when a new message arrives. You would like to call the server once every couple of seconds and ask for status updates. Or maybe your model represents an on going background task, you want to poll for…
  7. For a quick assignment I was asked to write the following program: In the language of your choosing build an application that, given an English language document as input, builds a data structure capturing the count of each word in the document. Bonus: Create an inverted index as well: a mapping of the words to absolute positions in the document…
  8. I am working on a backbone based search page, and was trying to figure out what would be a simple way to have both a state model and a URI that represents that state of the page (the search string, search parameters, user preferences, etc.). Thinking of mixing backbone routes and the application models seemed like an overkill, and would force me to…
  9. A simple yet powerful way to create backbone model calculated fields or “macros” For one of our applications, we needed a way to store “macros” in backbone models, that will return a calculated value, based on values we have in the model fields. I came up with a quick solution that seems to be good enough so far. the concept is, the same way you…

©2023 Uzi Kilon