Posts

Showing posts from April, 2006

Speed up your AJAX based webapps

UPDATE : I guess most people are not getting what this technique does in the first place. It sets the expiry of the JavaScript to years and not days. Once the JavaScript file is downloaded it is never downloaded again, ofcourse unless you force it by removing the file in the cache. If you visit the site often the JavaScript will not be removed from the cache. If you make any changes to the JavaScript you only need to change the version of the file and the new file will be downloaded. The older file is automatically removed from the cache when it is no longer requested. And just to add one more point this can be done on the WebServer itself without using this technique, but that has its own drawbacks. To further speed up the download you can gzip the JavaScript. If you have developed an AJAX based web application you would know how many JavaScript files are required per webpage. If you use the prototype or dojo toolkit library you would know how big those JavaScript files can t

require_once, #include in JavaScript

If you've ever used C/C++, you can include more code by simply using #include and that header file gets included. The same thing goes for PHP, if you divide your program into multiple files you can include the code using include/include_once or require/require_once . If you are looking for something similar in JavaScript, you won't find any way of including more code. This is when I came up with this code, though later on while searching on the net I could see samples using a similar approach. But in any case this might help you to include code in your JavaScript files. function include(fileUrl) { var script = document.createElement("script"); var head = document.getElementsByTagName('head').item(0); script.src = fileUrl; head.appendChild(script); } To include a file in your JS code you can use include("<url of js>") . If you look at the code, we are creating a new <script> tag in the <head> section of the document.

Template used on this blog

If you want you can use the template used on this blog on your own blog you are free to use it. Goto template and cut and paste this code in that section. You would need to change the links and the images. If you use this template just link back to this blog. There is a link in the footer, please let it remain there. Other than that you are free to modify whatever you want. Download the code for the template. I hope somebody uses it. If you do don't forget to leave a comment and a link back to your blog.

Get a $90 rebate at dreamhost

I guess I can get my webhosting cheap if I get people to signup for dreamhost . I really like them and after a very stupid webhost "GoDaddy", dreamhost comes as a real surprise. They offer WebDAV, Shell accounts, 1 TB bandwidth and nearly every other thing the other hosts provide. The best thing that they provide is a shell account. A shell account really gives you a lot of power to do things you can only imagine with the other hosts. They don't have the CPanel as the admin panel. They use their own setup. If you are a developer you will really like the features they provide. Dreamhost is not really for dummies but for a people who know the importance of shell/cvs/subversion while developing. I have not seen any webhost other than dreamhost which provides all three in the regular packages. If that gets you excited you can get a rebate of $90 on the $120/year hosting plan by using the promo code VIVEK . So you get the yearly package for $30 with all the features plus mo

Yeh! Pepsi TV kya hai? / What is Pepsi TV?

Again this is not a tech post, its something I was trying to figure out since I saw the advert on TV. And finally I guess I got my answer on CNBC, "I guess" 'cause I don't think the host was too sure but anyhow, Pepsi is not really launching a new channel all they are doing is to promote Pepsi while you drink TV. So nothing earth shattering there, but lets see how that advert turns out to be. The other advert on these days is the Marinda advert, "Mouth ka sahi use karo" or something like that. That advert is pathetic in every possible sense. It is one of the worst adverts I have seen on TV. It just shows the actor like he is an arrogant idiot too full of himself. I don't mean that the actor is arrogant but the advert just shows it that way. With all these adverts I cannot forget the new Coke advert with Ashwariya Rai, I really don't get that advert. Atleast that advert is not targeted towards me or people whome I know. It looks like a cheap advert d

A lot of work and little time

Lately I have been really busy with work. I guess a lot of things have piled up and it seems like they will never be completed. I just hope I can take out a little time soon. Its been a while since I blogged and also I have a few articles that I was going to post here, most of them are no where completion. I guess one of these days I will have to get up and stop being lazy and complete those articles. Its been like a month since I went to Slashdot and about a week since I last visited digg. Currently I feel disconnected :) from the world, without knowing whats the latest that is hapenning around the tech world. Lets hope I can soon find some time to atleast visit these sites.

Red Bull won't give you any wings :)

This is just something I thought I had to write about. I really liked the advert of Red Bull energy drink, with the special reference to the Red Bull gives your wings. I had to try it out, so I shelled out Rs. 75 for one can while a normal can of soft drink costs Rs. 20+. I tried it out I did not get any wings but yeh! I did have to run to the toilet as i got an upset tummy. I kept waiting for the wings to appear but nothing happend no extra surge of energy. Its a nice way to promote your drink but I don't plan to drink it again even if was for Rs. 15 a can. It was not the best tasting drink I have had so far.