Archive for June, 2006

AJAX, wow it’s getting really popular

Saturday, June 24th, 2006

Yesterday, I was browsing through digg.com programming channel. Mmm.. Impressive, more than half of the stories are related to ajax. So, I decided to write about bit of ajax today.

The main advantage of AJAX is that it works like a desktop application; instead of refreshing the page every time you change something, you can interact with the server then and there. When we talk about the disadvantages, there are a lot; bookmarks, back button, search engine incompatibility, etc (there are hundreds of articles in the internet regarding these.. so, I’m not going to repeat those ;-) ). But use of some hacks will help you to avoid those problems.

There are plenty of AJAX frameworks, both client side and the server side ones. I have gone through many of them and found out that one of the bests is rico. This simple javascript client side framework also contains some animation effects and drag and drop feature.

If you had a careful look at the popular javascript frameworks, you’ll see that most of them are based on prototype. Prototype is a really powerful javascript framework which allows you to create classes.

When we consider about the server side languages, using php is really easy. It’s a simple light weighted language and php applications can be executed in almost any web server (of course only if it supports php).

So, this great combination of tools will make you ajax life easier; prototype, rico and php.

P.S. : As I have mentioned in an earlier post, firebug will help you a lot on debugging.

16F877A - MicroChips. PIC programming.

Thursday, June 22nd, 2006

Last few days, I was busy with programming a PIC. First, I downloaded some documents from Microchip site, and played around it bit. Then, I created some sample programs using assembler; even though I’ve prior experience with assembler, I found that it is not efficient enough as in man power. So, I decided to go for PIC Basic. Whoa! That seems to be nice, easy to code with it’s built in functions such button debouncing, etc.

The first effort of programming didn’t workout, because of the serial cable, after fixing the cable; it was the circuit. Lots of debugging fixed the circuit. WOW! It works.

I wanted to do some floating point operations. Since, the PIC basic compiler doesn’t handle the floating point operations itself, I decided to multiply the numbers by 1000, do calculation and divide them again. But multiplying the number by 1000 overflows the 16 bits word variable. So, I downloaded an external library, worked nice so far, but haven’t tried out it on the PIC yet.

Just wondering, is there a PIC Basic compiler for linux?

Seeding my mind

Tuesday, June 13th, 2006

What is the first step of random number generation? SEEDING… If you haven’t seeded the number generator, you’ll end up with the same series of numbers. The same approach is true about your mind – It’s a really popular mind hack. (I guess that’s the correct word).

In computer environment, it’s really simple. Just calling a function. But when it comes to real life, how can we seed our idea generator or our mind. It can be done using almost any activity that you have never thought of doing, like reading a book if you don’t read books, watching a movie if you don’t watch movies often, etc.. Or it can be some simple activities like reading a simple joke, looking at a road, looking at some mountains, or even taking a careful look at day-to-day activity will do the job. For example, may be you can analyze the activities of a insect ;-).

After spending a lot of time with coding (actually it’s not a lot, but for some reason I wasn’t feeling well), I also wanted to seed my mind. So, what I did was reading a **strange** book. I usually read books (novels, short stories, politics), but this one is kinda strange. It was written about the mental state, activities of the gods(gods as in buddhist gods) – a completely unknown world. I don’t care whether it’s true or false, but the interesting fact is, that’s like a ferry tale – really interesting stories about the gods and have a bit of some scientific background (bit as in very very little).

However, after spending straight 10 hours for reading the book, I’m back for CODING.

Rico = Javascript + XML = AJAX

Saturday, June 10th, 2006

After successfully finished an AJAX project (a simple AJAX Content Management System), this time I’m going to create a complete AJAX site. The CMS was created without using any 3rd party frameworks, and had a great time debugging the javascript code. So, this time I decided to use a framework.My choice was Rico – A client side javascript framework. It also provides some javascript animations and drag n drop features – haven’t tried those yet. Actually, this made my work much easier. If I want to update the value of an element, then I just have to create a piece of xml code, the framework parses it and updates the element automatically. But it only supports updating an element value, if I’m doing something outside that, I have to parse the code manually and do it. So, I created my own mini framework using Rico:). Now, it’s really easy.

When I was creating the CMS, the alerts did a great job ;). It really helped me to debug the javascript code. But this time, Rico blog directed me to a nice extension for firefox – FireBug. It’s really cool. Actually, the main advantage is, it captures all AJAX events. Simple and Useful.