Sunday, December 30, 2007

Working with my MAC

Yeh .. At last after fighting all the inner pulls and pushes, I have got a small MacBook. Not Pro, just the lesser of the laptops. Its my first time actually doing something on a Mac. But good friend Rajeesh helped me with some things but I need to get into the BSD (Darwin) shell and all the installations, applications that are possible in the system. Its a Leopard with 2GHz and 1Gb Ram. The HDD is just 80Gb but I intend to have an external Hard drive as well. Now I read what Cocoa, Carbon, AppleScript, Xcode etc were. But to get an idea I have to try something out. Its still early days and the console is the major thing to explore. Added most of the best rated softwares and looking for more great stuff. The UI is great. The XCode IDE is great as well. The Expose and Spaces are also nice, reminds me of the Fedore Core that used to use.

I am trying my hands with MacPorts and it looks very complex. Great Ruby On Rails, Java and python support. I am currently working in RoR and I feel this system would give me more that I ever wanted. I was disappointed when I understood that TextMate (on which the major RoR development is done worldwide) is to be paid for. I choose to have Aptana and develop in that IDE. I will download Eclipse and see if I get Red hat Developer Studio to work with Mac.

With my minimal interaction I feel that Mac is not devoid of viruses. How is that possible (the admin rights asking for execution of programsis great) when it uses executables? Have to investigate. Lots of questions to be answered thou. And I feel I would love using the Mac.

Tuesday, December 18, 2007

Imified Posting

This content that I am sending right now is from a service called Imified. I was just cruising through the net when this one just hit me. Just add imified@imified.com to your list in gtalk ( or other jabber systems) and then you could post items like this into your blog, live ournal , twitter, Jaiku and other stuff !! Isnt that cool or what !?? This is just great for me coz now Gtalk becomes a one big hub for all the activities. Messenger (duh !) and information passing to other applications (sites), content management (this even works with Base Camp !!!! ) and loads of stuff. The saying 'The world is a small place' is materialised by applucations like this !! Kudos to the Imified team for such a great idea (concept ) !!!

Monday, November 26, 2007

The Helpers ... Part 2

Its been sometime. Work caught up (at last). I got to work on some interesting things which made me feel that the libraries that those site use( the Java Script ones) must be optimized for performance more than anything. If the JavaScript you use slows down the application, the library is useless. I continue with some of the other libraries, in the search for the perfect one ( or a hybrid).

Bajax : Bajax is a small and simple JavaScript library to put Ajax driven content in your pages. When I heard about this library, I went on to search for this. The library is maintained by the BerliOS group. I did not see any kind of documentation, so I had to get hold of the READ ME. The library turned out to be very minimal. Just some functions where by you could call a page with arguments, insert some html to elements, insert whole pages to elements and get html from elements. That is it. :)

Behaviour : This library is an interesting one. I have always wondered how nice it would have been if I could assign some characteristics to some elements according to their class names. Like I want all elements which are of class 'fancy Hover' to have a border outline when hovered on. In this case I would have to write the onMouseOver and OnMouseOut methods for each element. This would clutter my code and make the behaviour and structure tightly bounded. Behaviour comes to the rescue in this case. By writing small lines of code and registering a behaviour we could assign elements of certain classes (or even elements of certain ids) to certain methods on certain events. This works with libraries like script.aculo.us to provide some snazzy effects as well. Some examples also give you the usefulness of this library along with its interactions with other libraries. This library gives me the option of adding behaviours to a set of elements at the same time and that, I feel, is very powerful.

Moo.FX : The Mo.Fx library is a lightweight JavaScript effects library written using prototype. The library is just 3Kb !! Even the tag line given is 'Size does matter'. When I went through the library I was amazed at what such a small library could do. Net Vibes also uses Moo.FX I suppose and the site itself testifies the abilities of this library. It has many stuff that a typical Web 2.0 site may require (accordions, Effects, Tips, Groups, Drag and Drop .. ). I had earlier used Dojo as a library for my sample application, but the library was so vast that it stalled my application more than often. I guess Moo.FX gives you the right amount of stuff to get started with and build a nice website with all those great Effects and some CSS support. I also found the Hash.Cookie feature (used to store values like the co ordinates of a drag gable element) very useful ( at least for sites like net vibes). Theming with Assets.CSS, loading images dynamically with Assets.Images, Chain Events and make them execute in a periodic fashion, Ajax calling and updating along with periodic access to those calls, Effects such as morph, transitions, scroll, slide and various other elements styles ( say you wanted the background to change very slowly, you will create an Fx object, associate it with a certain set of elements, and call the effect with the start and end states to get the effect). It also has sorters (which I think are the highlight of scriptaculous). Now the main difference that I see with the tremendous Dojo library is the amount of additional widgets (like context pane, tab containers, pop ups etc) that Dojo has. These kind of stuff can be built using JavaScript along with some help from Moo.Fx and Scriptaculous, but the maintainability will be a crucial point I feel here. If these kinds of widgets are available (or made into a simple extended library), I feel Dojo will feel to have some sort of competition.

ByteFx : Its just another library which gives you an accordion, some effects and transitions. Nothing special (but I have not gone through the code).

wz_dragdrop : Now this library just has the plain old drag and drop features and some other features like re size, clone and some effects. This library has a limited number of features but is enough for some starter sites and applications.

SACK : Simple AJAX Code Kit is a small library used to facilitate AJAX calls. The file is small and the a demo comes along with the package. The routines to call when loading, loaded, complete etc could be specified just as we do in a normal AJAX call. The library just gives us a better organized way to do it.

OverLIB : A small JavaScript library if you want only tool tips to appear and nothing else !!!

Sarissa : This library is very interesting. Well the techie guys will know that httpxmlrequest gives you an XML file after access. Now if you were to traverse through this file (validate, find nodes etc), it would be great pain. Sarissa is here to facilitate this. Its the same as you use DOM parsers in Java. We create a DOM object then add/ delete/ traverse what we need using methods available. I like this in a way that I had used a lot of parsing for my previous project and became quite good at parsing and stuff (even used TagSoup parser to make valid XML documents out of Html documents). The library as such seems small, but the functionalities are very helpful. I would definitely use this library if any requirement comes into picture. Some tutorials and starting points are also given. We could use xpath type access to get the nodes and manipulate them by adding attributes and tags. The cross browser acceptability is great (MS XML crap for windows and other XML Http stuff) and library deals with it well. Xlst stylesheet manipulation is also possible. We could do something like update a part of the DOM using the updateContentFromURI method after applying a style sheet to the resultant XML request. This I think is particularly useful as we could maintain a same structure to the site with just having style sheets for different request results.

Nifty Corners : Typically when I see a Web 2.0 powered site, I see that the design is great. There are real nice Ajax features, some great Effects at the right places and finally wonderful CSS combinations. The so called 'rounded corners' for the DOM elements are just as important as anything to make the web site look good. I have tried my lot to get libraries coexist so that I could use one for my effects and one for the rounded corners. But I was not successful at all. Then I went on to do the CSS way and sticked to it. Now this is one of those libraries that I used. Now this library actually tricks the user by adding some blocks of code with a specific margin space so that it seems that the edge is rounded. It adds 4 bold tags on the top and bottom of the element( say div with a specific id), which has specific classes of its own (from a linked css file called niftyCorners.css ) , when the JavaScript function Rounded is called (nifty.js). Nice trick eh? Well CSS 3 has now specified techniques where by we could specify the radius of the corner of elements so that they are rounded when displayed. Mozilla FireFox ans Safari 3 have adopted this (IE as always sucks) and they look great !!!

Plex : This is a nice little JavaScript library for GUI. It has components like menubar, tabbar, contentpane, trees, grids and title windows. The library seems to be fast and lightweight. The style of writing the components is similar to Dojo ( xml like coding). It has some AJAX support (pulling data from a xml or yaml and feeding it to the data grid maybe) and uses it well. Custom functions could be triggered on events too. Cross Browser functionality is ensured by this JavaScript library. It is said that client side xslt loading is supported for IE and FireFox. Its documentation also says that the components could save their states in sessions and thus potentially solving the 'back button' problem. Worth a look but I would go for better alternatives. :)

Thursday, November 8, 2007

The Helpers ... Part 1

Its just not that I tend to understand the wide world of the JavaScript libraries that are present (both as GPL and Commercial). I just wanted a comparison (need to browse to find out about these libraries and Stumble and Google helped me a lot with this). But why do we need these so called libraries? Of course we could manipulate the DOM using the native methods that JavaScript has and make our own js files. This would be in effect reinventing the wheel (just what we people who are trying to develop do not want). If somebody has done something good and effective, why not understand it, take a lesson from it and try to wrap something additional over it? Thats what these people (who have actually made these libraries ) have done. I will have some comparisons here (some of those libraries that i felt good using as a user and coding as a developer). So here we go ...

Prototype 1.6.0 : Its a library ( that is now used by many other libraries ) that facilitates the DOM access via JavaScript and the AJAX functionality. When I look at the documentation of this library, it reminds me of ruby. The syntax is similar and the constructs and more or less the same. The Class constructs are similar to Ruby's and there are mix ins too !! It concentrates on its Class structure where by you create Objects which is extend able. It has some utility methods by which you could access DOM elements ( say $ can be used for access elements with a specific id $('id') ). It has AJAX methods like updater (update contents according to the response), request ( give a request), responder ( set or unset certain listeners ), periodic updater (periodically call and update the element). Element object manipulations are present and there are many methods which facilitate the manipulation. Enumeration is another feature that is very strong with prototype. It allows enumerations (just as the each, collect methods in Ruby) and allows manipulations (anonymous pieces of code ) to be done on it. There are neat Event handlers in this library that can be used to track the events that happen on a particular event. The major methods that is used here is the observe, element and stop. It even kills the Microsoft IE memory leak problem. This is what Douglas Crockford has to say. This library has Form methods as well to get those form tags. For and AJAX call say we use Form.serilalize method to get the input fields and their corresponding values as url arguements. The bind concept ( It go me sometime to come into terms with this concept ) and its relief given by prototype by the Function helper. Insertion of html content after, before, top or btton of any element ( say a commenter .. ) is also done. A periodicalexecuter which is useful to say update a cricket score !! The Position utility which is used by libraries like script.aculo.us to position elements. Templates which can be used to substitute strings and stuff. It supports JSON too.

RICO 2.0 : A Open Source JavaScript library which has many AJAX powered features along with some great effects and components. It is also based on prototype. The effects are all things I see in the normal libraries. The ones which impressed me the most is the components features. It has such smooth UI features which closely resemble those Rich Internet Application created by Adobe Flex and Open Lazlo. The Live Grid and Accordion are two things that made me interested. This example shows how the Live Grid was used and it feels like its Flex. The weather example given in their webs site closely imitates the one originally developed in Open Lazlo ( which incidentally is one of my favorites ). In their site it has been tested for IE and Firefox and that the Drag and Drop feature does not work in Safari. Even the AJAX features does wok for Safari 2.0.3. Along with giving those Drag and Drop facilities it also provides some styling effects like rounding off the div so that it will not have sharp edges. Multiple objects may be updated as a part of the AJAX requests with RICO. This is one site which I found RICO to work very well. It provides the look and feel of a Flex application and runs faster that a Flex one ( Although this site loaded very slow for me. Dunno why !! ). Here is where I came across XOOPS as well ( Content Management System written in PHP and useful for social websites and corporate sites) and i will be exploring this in the near future. This Live Grid tutorial gives you a fair idea of what and how to do that access thing. The best part about this is that the Live Grid widget if connected to some database could be made to populate when the user scrolls the grid. This is an excellent feature and leads to better performance. There are tons of examples in this page and I suggest if interested view it.

MochiKit 1.4 - as they say it makes JavaScript suck a little bit less. Mochikit is a JavaScript library which stands alone. The primary contributor Bob Ippolito says that the library has taken the coding standards from python, objective-C etc. It has many cool features like logging, manipulating DOM elements, visual effects ( taken from script.aculo.us ), asynchronous server communication, functional programming, CSS manipulation, iteration and so on. The listening mechanism can be made use of (thought those concepts need some getting used to ) to make excellent Web 2.0 sites. Multiple elements could be configured to listen to a response ( say a JavaScript Array response could be traversed using evalJSON, and could initiate other Asynchronous calls to the server) and this is done through the slot/ signal technique that it uses. This article gives you an excellent insight into the core features that this library has. Turbo Gears is another framework built in python that uses this library. I am yet to go through this and try it out !! The main site has example where a sortable table is populated with contents using Asynchronous requests in both the xml and JSON format. It has both a development version and deployment version. The main categories are Async (asynchronous access), Base (Functional Programming stuff like map and filter and comparators), DOM ( create DOM elements like Tables to be inserted into nodes ), Drag and Drop, Color, DateTime, Format (those string operations go here ), Iterators ( some high end iterators), Log and Logging Pane ( the great logging features that this library has ), Selector ( access to the CSS elements using $$ ), Signal ( add event listener), Style ( style manipulation ), Sortable ( sortable drag and drop lists just as in script.aculo.us ), Visual ( visual effects like rounding of edges, fade, toggle etc). As it is python oriented I found this library hard to grasp though.

Dojo 1.0 : Dojo is a wonderful library that has great features and is preferred by most developers. Django and Web Works have integrated Dojo with their bundle asserting this fact. The biggest plus point that I see with Dojo is its wdiget construction helpers and components. I went through some of the docs that they have and was immediately impressed. They have widgets like Text Boxes, Check Boxes, Date Pickers etc which when associated with a theme will work as in a Rich Internet Application. It is said that the DOM level access is not that much but the UI features are awesome. A demo mail application and a Fish Eye Application are given in their site. When the package is downloaded, we also get a demo page which highlights all the UI features of Dojo. The cross browser features ( accessibility of DOM level 3 inside IE ) has been very tactically done by Dojo thus making event handling excellent. It gives the essential validations, tool tips, accordions, split panes, dividers, In place editors and whole lots of features. After looking at this one I feel I have wasted a lot of time with other libraries when I had a superb one right under my nose. After I went through the documents, I used it in my dummy application and to tell the least, the application rocks now !!

to be continued ..