Archive for February, 2006

AJAX and me

Wednesday, February 22nd, 2006

As part of my job I do some development on web applications. Mostly LAMP and WIMP shit. I’m not a graphics designer though, and my Photoshop skills are limited. This is something that I plan to work at, but for the time being I usually opt for a simple css layouts with minimal amount of graphics.

My philosophy for the most part is to use the database and php to do the heavy lifting, and leave the client side simple and basic… This approach is good for most websites, but some web applications written this way suffer from the click-refresh-click-refresh issue. My users were complaining that they spend more time waiting for the page to reload after they submit a form, than they used to when working with their old spreadsheets and hand written forms.

On of the ladies at work asked if it would be possible to redesign the page so that she can make changes without constantly reloading it… Yes, it is possible - it is called AJAX. I avoided AJAX for all this time, but it just caught up with me.

As much as I hate working with javascript, this is the direction where the web applications are going right now. So I spent my day today doing my first, shaky steps in the AJAX land. It is not as bad as I thought.

AJAX essentially boils down to few basic asynchronous request calls, and everything else just builds on top of that. You can actually accomplish some really cool stuff with just few lines of javascript. So it is not all bad.

I produced a functional app today, but I’m still having trouble with few things. For example, I’m still not sure how to get a pointer to the DOM object that generated my asynchronous call, in the event handler that updates my page after I get the data back from the server. Most samples I have seen on the web simply use the getElementByID method but that does not really work for me. I have oodles of text fields on the page that can generate AJAX requests, and I need to update them accordingly.

When I marked them with unique id’s and passed that ID to the server so I can pass it back to javascript again, I run into some bizarre XUL issue with firefox. That and IE 5.0 refused to display my page at all for some reason P

I will need to work out few of those issues, but so far I’m happy with the progress. I’m learning some new stuff. I plan to look into some of the existing AJAX libraries out there. Maybe I can lean on some more mature code, and have it do most of the dirty work for me as I work on this project )

Tags: , , , , , , ,

Is CIA Secretly Rewriting History?

Tuesday, February 21st, 2006

It appears that in the last few years CIA was secretly reclassifying some historical documents that used to be public. In most cases these documents did not contain any sensitive information that could impact national security.

However, some of these documents did contain information about embarrassing governmental blunders, and CIA mistakes during the Korean war, and early years of the Cold War. The NYT article linked from /. gives a great example of this:

One reclassified document (…) gives the C.I.A.’s assessment on Oct. 12, 1950, that Chinese intervention in the Korean War was “not probable in 1950.” Just two weeks later, on Oct. 27, some 300,000 Chinese troops crossed into Korea.

Why are these things reclassified? And why is this done in secret? Call me paranoid, but stuff like that makes me nervous. If the governmental agencies bend the regulations to secretly reclassify public records and get away with it, then how do I know that next time they won’t bend them even more? What is stopping them from altering the reclassified documents?

How do I know that one day they won’t secretly de-classify altered historical facts? And if anyone happens to own an original copy, they can use the Patriot Act to confiscate it, and slap the guy with a gag order…

Welcome to 1984 ladies and gentlemen. Repeat after me: Oceania has always been at war with Eastasia…

Tags: , , , , , , , , ,

Weekend Coding Sessions

Tuesday, February 21st, 2006

I spent the whole Sunday locked in my little office, hacking away on the code for my thesis work. This was first time in weeks when I left school without feeling frustrated and stressed about this work. I finally made some progress, and actually got stuff working for me without having major issues. I was happy, with the work and I no longer felt guilty taking the evening off and playing Dawn of War ) It also freed up my Monday schedule for other stuff.

Heh.. I not only caught up with my thesis work. I also managed to grade all the homeworks for the 183 class, and do some blogging ) It’s amazing how much you can get done if you are not interrupted or distracted every 5 minutes.

I’m definitely doing this again this coming Sunday. If I take one day each week and spend it working towards my thesis, I think I can finally catch up with my work, and get back on the right track.

Tags: , , , , , , ,

It has come to my attention…

Monday, February 20th, 2006

LOLOL!

Shamelessly stolen from PVP.

Tags: , , , ,

Coding without an IDE is like eating soup with a fork

Monday, February 20th, 2006

The more I use Eclipse, the more I learn to depend on it. I cannot imagine coding anything serious without Eclipse “compile as you type” error checking, one-click correction tools, automatic code generation tools and refactoring utilities. Vim is great but it will not detect a thrown exception as I type and it will not give me a choice to automatically generate a “throws” clause or catch-try block.

No simple editor will automatically rename my file and refactor all references in the code when I change the name of the class. And neither vi or notepad will generate getters and setter methods for me.

Here is an example. Today I had to code up a big data structure which had around 8 fields that needed to be accessible, but not public. How long did it take me to write all the accessor and mutator methods? 10 seconds! Clickity click, done! Eh… Sometimes I think I’m just getting to lazy with all these nice features. But then again, you do not want to waste time typing silly stuff like 20 different accessor methods when you could be putting that effort into making the algorithm work.

Eclipse is my personal favorite. I think it is possibly the best IDE for Java out there, but your millage may vary. Allot of people like NetBeans. I briefly used it at one point, but I went back to Eclipse. It was just not for me. But it is still a great alternative if for some reason you dislike the IMB brainchild )

Actually any piece of software that attempts to call itself an IDE should provide similar set of productivity increasing functionality. These things are here to make our life easier.

If you are really thinking about writing that Really Big Project™ using vi, think again. I know that talking about editors is kinda like talking about religion. Personally I think vi is great tool for programming. But when you are facing a huge, complex project you may want to put your religious beliefs aside for a minute and think about stuff like productivity, convinience and etc… You might be more productive with vi than with an IDE initially. But once you start using some of the advanced features you will quickly realize how much less typing you need to do )

If you are vi/emacs guru and you can do amazing stuff with your editor, then please ignore my ramblings. Hats off to you and your impressive skills )

On the other hand, if you are planning to use notepad, or pico you are insane. Repeat after me: pico is not for coding. Notepad is not for coding. Get an IDE, or at least switch to vim/emacs where you can get some syntax highlighting and helpful features.

Tags: , , , , , , , , ,