02/11/13

Combining your javascript files into one file using python

Since I've began to learn Python, I've had nothing but praise for this language. It's amazingly simple and at the same time powerful! And what I really like about it it's the way Python makes my life easier. Consider today: I'm (still) working on a rather big in-house Javascript framework with a large number of scripts included in the header, since we are on the development phase. When everything will be completed, all the files would be combined into one, obfuscated and minified. But until then, [read more...]
02/3/13

Zooming in Safari using a PDF

Zooming an image is serious business. As I mentioned in a previous post, scaling an image for a mobile device it's not as easy as it seems. Sure, the process of scaling is as simple as saying transform: scale3d(2, 2, 1); and bam! you have a nice, smooth, hardware-accelerated scaled image. The downside is that during the scaling process, the image gets treated as a texture and it gets a little blurry, making any text on it harder to read. There are [read more...]
11/30/12

Javascript search: a couple of words about the Trie structures and the Levenshtein distance

 You have to love science! No, really, you gotta love it!  I was working on a search module and I was looking for faster ways to do the search and make a "as-you-type" autocomplete something feasible, as well as adding some similar results in case the original term was not found. I'm very proud to say that I came up with something similar to the Trie structures on my own, though I have to admit, not as proudly, that it wasn't nearly as efficient. A Trie structure is a very neat [read more...]
11/24/12

How to GET paramaters using Javascript

I was doing a sort of pagination system recently and I used the URL anchors to get the pages. Something like 'http://example.com/index.html#3' to go to page 3. Well, everything worked fine until I had to rewrite to system to use GET parameters, like in PHP. So my new url would have been 'http://example.com/index.html?page=3'. This makes sense in a way, since it's a rather common system and users are already used to seeing links like these. In order to do this, I started from my old function: function [read more...]
10/31/12

Image not drawn correcty in canvas? Check the size attributes

Here's an interesting fact about the HTML5 canvas that took us over an hour to figure (and a lot of nerves). We were trying to break a large image into 4 equal canvases. The breaking only involved preserving the ratio of the image, not its size and scaling the pieces was also necessary, depending on the size of the browser window. The whole thing was about the iOS Safari PDF zooming, we wanted to see if using 4 smaller canvas objects consumed less memory, since using a single canvas caused a [read more...]