Monthly Archives: December, 2008
Threads in Javascript
Well, let’s make it clear: There is no way to create actual threads in Javascript. Javascript code runs on a single thread inside the browser. This is, only one line of code is running at a time. In fact, until Google’s Chrome, all pages/tabs opened on a browser where running on the same system thread. [...]
Ajax comments in Drupal 5: How I made it – Part II
In Axaj comments in Drupal 5: How I made it – Part I I covered the most important part of the module code: saving comments to the database. Now, let’s see how to display them properly. Rendering the new comment Comments usually have more information than the user name and the comment text. In my [...]
MooTools classes with “Smart Start”
A couple of days ago I was talking with my friend Karsten at work about one small but relevant issue we face when building websites: our beautiful MooTools classes cannot interact with elements on the DOM until the DOM has fully loaded. This, which is obvious, sometimes has some impact. For example, the typical case [...]
Ajax comments in Drupal 5: How I made it – Part I
First of all, I would like to apologize for not publishing this the right way. I haven’t had time to put it all on a standalone module, which will make it easier to share the code at www.drupal.org. Feel free to grab the code and put it on a module if you wish (and let [...]
Dojo sucks, Mootools rocks
Today I got disappointed about Dojo. I had never used it before although I had seen code and I had hear good things about it. Bad things too, but I never though it was that bad. Currently I am working on a project for a client which has decided to normalize all their websites. And [...]
I’m ready for some fun with Python 3.0
I just found out Python 3.0/3k has been finally released. This is very good news :) Let’s find out how to install it on Mac OS X Leopard.
Fibonacci vs. 2n
Which sequence of numbers grows faster, Fibonacci or 2n? It seems like 2n grows faster. It only takes 1025 steps to overflow a Javascript numeric variable, while Fibonacci needs 1477 steps. Check it out: http://dev.enekoalonso.com/research/threads-fibonacci-vs-2N.php
Enabling PHP5 on Mac OS X Leopard
I had done this already at work, but for some reason my MacBook Pro still didn’t “understand” PHP. Well, I’ve decided it’s time to activate it: # Use your favorite editor mate /etc/apache2/httpd.conf # Uncomment the line: #LoadModule php5_module libexec/apache2/libphp5.so # Restart apache sudo apachectl restart Done.
Handling events on iPhone webapps
This week I have been working on a website for iPhone phones and I have discovered some interesting things about events. I am using plain Javascript, with no third party libraries, so I don’t know if they have any fix for these issues or if they affect them. For example, a couple of days ago [...]
Ajax comments in Drupal 5: How I made it – Part III
In Ajax comments in Drupal 5: How I made it parts I and II we saw the code needed on the back-end. Now, let’s see what goes on the client side: the Javascript. Submitting the comment with an ajax request Basically, to add a comment we need the node id (nid) and the comment text. [...]