Thursday, July 26, 2007

Using regular expressions in JavaScript

Today I learnt to use Regular Expressions in JavaScript. Actually I haven't touched regular expressions from last two years. I used them two years before in Lex & Yacc programming which was solely based on REs.
It's very interesting & useful in JavaScript to make any type of validations like for float value, email address, etc. on the client side.
I tried to develop the RE for validating the float value which contains e/E in it. It was pretty interesting to see the RE coming up part by part. Finally the full fledged RE to validate float value was formed. I would like to share it:

var floatRegExp = /^([+\-])?\d*([\.])?\d*([eE]([+\-])?)?\d*$/;

Your view on the above RE is welcomed :)

Wednesday, July 25, 2007

The multi-core crunch is coming...

Accoding to this article in the Arizona Daily Star the new generation of multi-core CPU's poses a daunting challenge to the software industry.

Give a view to this article.

Wednesday, July 11, 2007

Dynamic TABLE operations in HTML using JavaScript

Today I created one full fledged app using simple HTML, JavaScript & AJAX, which dynamically create, edit & delete the TABLE row (in the UI), which in turn is reflected in the database itself. While doing all these operations, no page REFRESH / RELOAD takes place, which gives feel that all these operations are done very faster than that of traditional approach.

As I've used JavaScript majorly, I've tested the app in IE(6.0), Mozilla Firefox(2.0.0.4) & Opera(9.20). It works fine without any browser compatibility issues. For AJAX, i've used JSON, which is supported by these browsers.

I think it's really great achievement for me as I've tried to create most user-friendly & interactive app.

Following is the snap of my app:
[All the operations takes place in the single page itself without refresh / reload]

Sunday, July 1, 2007

My first AJAX program in Java

Finally I have created my first AJAX program in Java. It's to convert an entered number to the string representation. What I've done is created one JSP page and one Servlet to process the client request. In the JSP page I took one text box to enter the number & then passed it to the Servlet in the form of of request. There I converted the number to the string & passed it back to the requesting client in the form of XML/Text response. This response text is in the form of XML, but in my case as there is only one field, the XML is overkill.

AJAX is really interesting to study. It's not a technology but it's a group of ideas that, used together, are proven very powerful. I'll be exploring a lot in it. :)


_________________________________________________________________________________________________________________

"Look at the sky. We are not alone. The whole Universe is friendly to us and conspires only to give the best to those who dream and work."

- Dr. A P J Abdul Kalam
_________________________________________________________________________________________________________________