In most programming languages, an array is a data structure represented by an arrangement of items at equally spaced addresses in computer memory. Unfortunately, that is not the case with Javascript. A Javascript array is simply an object with array like characteristics reflected through certain methods. Apart from being much …
A guide to Python's function decorators
Python is rich with powerful features and expressive syntax. One of my favorites is decorators. In the context of design patterns, decorators dynamically alter the functionality of a function, method or class without having to directly use subclasses. This is ideal when you need to extend the functionality of functions ...
An alternative to Javascript's evil setInterval
If you use Javascript often you might have come across the need for delaying the execution of code within intervals of time with repetition. This is were the native setInterval function comes to use. Despite being useful in many applications, setInterval's shortcomings could blow up your application in some ...
Understanding the apt-cache depends Output
I was using apt-cache in Ubuntu to get a list of dependencies for a certain package and parse the output programmatically, eventually I wanted to programatically download and package them within an archive for offline installs later on. I was not really sure about the exact meanings of the output ...
Proxypy: Cross Domain Javascript Requests with Python
When working with web applications you might run into the need to fetch remote content via Ajax where that content isn't necessarily JSON, such as HTML or config file, or even request JSON content from a remote server that doesn't support JSONP. This is when setting up a ...
Javascript URL Object
I've been doing some operations on URLs in Javascript where I needed to extract different parts from a string URL, such as the domain, port, and most importantly the parameter values. I really wished there was some function which takes a string URL and breaks it down into an ...
Serializing a Function's Arguments in Javascript
At many instances when doing Ajax requests in Javascript, a serialize function comes in handy for creating a string in standard URL-encoded notation for the request parameters. The most widely used serialize function is that of jQuery which works great on forms. But what if the request is not based ...
Quality Computer Science Education for Free? Yes Please!
Recently I have been following a couple of online courses on Coursera and udacity, and I must say the quality of the material is really good. Browsing through several programming and computer science courses you can notice that the quality of the material is at least as good as many...
New Version of the Blog is Out
Hello everyone, as you can see I have just rolled out a new design for this blog, the old one was nice yet had some evident problems in terms of UX, layout and colors. So I decided to revamp it into this. The new blog design is simpler, the layout ...
Methods Within Constructor vs Prototype in Javascript
At many instances when working with javascript objects, different pieces of code can give the same result on the surface yet underneath they could be different. One scenario is when adding methods to your Javascript 'classes'. First of all lets agree on the fact that there are no classes in ...