Wednesday, October 11, 2006

In California

In California this week...

Tuesday, September 12, 2006

SWFObject: Javascript Flash Player detection and embed script

SWFObject is a small Javascript file used for embedding Macromedia Flash content. The script can detect the Flash plug-in in all major web browsers (on Mac and PC) and is designed to make embedding Flash movies as easy as possible. It is also very search engine friendly, degrades gracefully, can be used in valid HTML and XHTML 1.0 documents*, and is forward compatible, so it should work for years to come.

Using SWFObject is easy. Simply include the swfobject.js Javascript file, then use a small amount of Javascript on your page to embed your Flash movie. Here is an example showing the minimum amount of code needed to embed a Flash movie:

<script type="text/javascript" src="swfobject.js"></script>

<div id="flashcontent">
This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7", "#336699");
so.write("flashcontent");
</script>

Read more here
* Pages sent as text/html, not application/xhtml+xml.

Monday, September 11, 2006

Startup Review Blog

Nisan Gabbay's Startup Review blog - interesting read!

Wednesday, September 06, 2006

The Decorator Pattern for JavaScript

beppu has written about the Decorator Pattern for Javascript.

He has provided a very very useful piece of code using which every object can now have a before() and after() method that would work like this -

before(‘method’, function() { });
after(‘method’, function() { });

This will provide us more flexibility in playing with objects and definitely reduce the code a little :)

Read more here.

Tuesday, August 29, 2006

IE + JavaScript Performance Recommendations

Pre-ajax days javascript was used mostly for form validations, image swaps or little dom manipulations here and there. Back then optimizing the code was of least importance because it never used to do anything significant (if I may put it that way).

Well, now things are very different. With ajax, we have javascript with a complete new look and lots & lots of code written in it. Anyone who has built an application using javascript would realize that sooner or later you are going to run into a situation where your code might start performing miserably. As long as 5-6 items were there, it ran fine but the moment we had to alter 100 rows, our application almost starts to die.

Here is where some good coding practices come into play.

I don't want to repeat what is covered in the article below, so take a look (the article is written with IE in mind, but it very well applies to FF too or basically better coding practices).

IE + JavaScript Performance Recommendations - Part I

Highlights-
  • Declare var for variables that are meant to have local scope
  • Cache Variables Whenever Possible
  • Cache Function Pointers at all costs
  • Avoid Using the ‘with’ Keyword

-Mandy

Wednesday, April 19, 2006

Technical evangelist

A technical evangelist is a person who promotes the use of a particular product or technology through talks, articles, blogging, user demonstrations, recorded demonstrations, or the creation of sample projects. The word evangelism is taken from the context of religious evangelism because of the similar recruitment of converts and the spreading of the product information through the ideological or committed; hence, for instance, open source evangelism.

In the context of commercial enterprises which develop or foster a cult following and religious-like fanaticism, the term evangelist can become an unofficial or even an official role/title. This usage was pioneered by Guy Kawasaki in Apple Computer's marketing of the Apple Macintosh (see Apple evangelist).

Thursday, April 13, 2006

Form.Element.setValue()

You love prototype.js, and you use Form.Element.getValue() all the time. Here is the Form.Element.setValue() counterpart. The setValue() function can be found in prototypeUtils.js

Wednesday, April 12, 2006

DOMInclude

DOMInclude is a library that allows you to add inline dynamic includes of content rather than using window popups.

Monday, April 10, 2006

Hyderabad BarCamp - Postmortem




It's almost been 2 days since the hyderabad barcamp ended, but unfortunately I am getting time to write about it only now. Well, I haven't really been busy with anything, guess the heat is taking it's toll on me and I am just too lazy to do anything.

So, 5 of us (from the company I current work for), set out in almost 40 degree celcius on a lazy saturday afternoon (2pm) for this barcamp. Well, nothing could have got me out of my house on a holiday but my love for web 2.0 & ajax and all those cool buzz words was incentive enough for me explore this event. And moreover it was free...yes free! That means I could go there without having to convince anyone on why/how it was important for me to attend it ;)

It took us almost 45 minutes to reach there. The event was supposed to start at 3pm and by the time we reached there, we had given up all hope of getting a good seat. To our suprise we still had some good seats available (in the front and we quickly grabbed them).

Oh Ya! As soon as we reached there we checked in at the registration desk and got a lot of goodies (T-shirts courtesy cordys, stationary - fancy notebooks & pens courtesy progress and some more stuff courtesy pramati). It's always good to get such things..I somehow have a liking towards fancy notebooks :)

This event was taking place at the IIIT campus and I must say I was pretty impressed with the WiFi connectivity in their campus (even though I was not carrying a laptop - actually I don't even own one right now ..hehe!)

So, the event kick started by Ramesh Loganathan's Intro talk on Web 2.0. He gave us insights on how this term was coined by O'Reilly - how it created a buzz and it was clever marketing. He encouraged active participation from the audience and discussed a lot on how blogging, google, wikis, community sites, flickr, etc have changed the face of the WWW.

Following this was a talk by the CEO of Pramati - Jay Phullur. To be very honest, I didn't know who this guy was and I was least interested in his talk, but somehow when I got to know 5 minutes down the line that he was the CEO of Pramati (well, i don't know much about this company either, but then what the hell! he is the CEO man! he demands some attention :) I started listening to him. He was presenting on the opportunities web 2.0 had to offer and it turned out to be quite an interesting talk in the end. Obviously, for people present there it was great fun when Jay mentioned about his 70 year old dad and what kind of web interfaces (especially webmail) he wanted to use (and how he thinks the Yahoo webmail user interface is so crappy - well now that was enough to get some reaction by all those Yahoo folks who had flown down from Bangalore for this BarCamp:) Having worked a lot with the designers, I found Jay's dad's ideas actually pretty interesting...Might even try some of them. After that all questions & answers were in reference to Jay's dad :) I think he was probably the most famous guy out there (till the end of the seminar ppl kept giving examples with reference to him).




The next talk by Rajan (on Economics of Web 2.0) was a little disappointing. He spoke about the move from n^2 to 2^n and all the laws related to it and the importance of attention. The chap probably knew a lot but his presentation was of no use to me (at least..no offence! he was one of the organizers and definitely worked hard at organizing this event..only he should have worked a little harder on his presentation :) joke.

Sharad Singh Solanki (SAS) gave a nice presentation on Tangible User Interface Design. The videos that he showed just blew me out of my chair..they were really cool especially the Sony example (with all those tiles for data) was out of the world. I culd possibly find no relation of his presentation with AJAX or Web 2.0, but nevertheless, it was so interesting to know about an alternative user interface design.

Dr. Vishal Garg (IIIT) and Kamal (IIIT) presented their ideas on Open Journal and Maha System respectively. With all due respect, to me both sounded a little confused and were not able to present their ideas across. None of them made any sense to me.

Rajiv and Pavitar from Pramati gave a talk on XFORMS. This talk too was disappointing not because I don't like XFORMS but because these guys failed to convince the audience why XFORMS are needed. I think the participants should keep in mind to first speak a few words on why this technology is needed and why we should learn it. Everyone just comes and dives into their material and writing code :(

Anand from Cordys gave a presentation on showing off his company's product to be very honest. This was probably the most humorous presentation as this guy surely was a cartoon. He kept bashing every other company and was so proud of the product they had to offer. Obviously he had no idea about front end technologies as he kept saying that AJAX is rocket science and how javascript and dhtml are so difficult - well all ths while showcasing a product that itself was written in DHTMl..irony! irony! :)

Oh Well! sometime in between was a tea break where we were served snacks, tea, coffee & coke. The organizers definitely had taken care of us pretty well. Kudos to them!

All this while I was eagerly waiting for the Yahoo guy's talk because obviously he seemed to know a lot about web 2.0 and all. Finally his turn came around 8pm (while we were being served some pizza's for dinner, thanks sponsors! :) and everyone was hooked onto the talk. I must say some people (probably from cordys) might have already developed some disliking toward this guy as he was quite bored by their presention and also came across as someone who was very proud of the libraries his company had written.

To be very honest there was a air of attitude with the guy, but it was pretty constructive I must say. That guy was totally in love with his company / his work and I think that's a really good thing. He also seemed to know his stuff..demo'd some of the Yahoo library features and show cased the cool new Yahoo Avatars stuff.

I managed to win a Yahoo goody for asking some good questions..hehe! probably advantage of sitting in front. I won a wallet. I just wish they would have put some dollars into it :)

Finally, the last presentation of the day - "Into the mind of a shit scared entrepreneur" by Sunder. His was a nice talk. He seemed to have stared a startup with some of his friends after quitting his job and he took us through the ups and downs of starting a startup. Was a funny talk and quite interesting.

Phew! I am tired now. I think I should go get some sleep now!

The event was a huge success and I hope this kick starts more such events in hyderabad. More than anything else it was good to know / meet people working on similar stuff and how they approach problems in their projects.

Till Next Time,

Tata,
Great work organizers!

What is BarCamp?















So, what is this BarCamp? Is it the newest bar in town where everyone jams up to have lots of beer? Unfortunately not :(

In response to criticism of Foo Camp, BAR Camp was created as an open, welcoming, once-a-year event for geeks to camp out for a couple days with wifi and smash their brains together.

More...

What are Mashups?

A mashup is a website or web application that seamlessly combines content from more than one source into an integrated experience.

Content used in mashups is typically sourced from a third party via a public interface or API. Other methods of sourcing content for mashups include Web feeds (e.g. RSS or Atom) and JavaScript.

Much the way blogs revolutionized online publishing, mashups are revolutionizing web development by allowing anyone to combine existing data from sources like eBay, Amazon, Google, Windows Live and Yahoo in innovative ways. The greater availability of simple and lightweight API's have made mashups relatively easy to design. They require with minimal technical knowledge and thus custom mashups are sometimes created by unlikely innovators, combining available public data in new and creative ways. While there are many useful mashups, others are simple novelties or gimmicks, with minimal practical utility."

Sunday, April 09, 2006

Flickr

This is a test post from flickr a fancy photo sharing thing.

Friday, April 07, 2006

Bar Camp - Hyderabad

Finally it's here - the much awaited Bar Camp - Hyderabad.
I am so happy because this adhoc conferences movement is now catching up here as well :)
The Theme of the conference is:
Web 2.0: Rich UI, Tools, Solutions and SOA/Enterprise Applications

Date:
8th April, 2006

Venue:
IIIT Hyderabad

The Event Wiki Site:
http://barcamp.org/BarCampHyderabad

Stay Tuned for a detailed coverage on this event.

More later...

Sunday, April 02, 2006

Learn CSS Positioning in Ten Steps

Learn CSS Positioning in Ten Steps tackles explaining CSS positioning with a clever and easy to understand tutorial that progresses from static positioning to more advanced topics like using floats and clearing. This is great for anyone new to creating CSS-driven layouts.

Friday, March 31, 2006

Using prototype.js v1.4.0

Using prototype.js v1.4.0: "Developer Notes for prototype.js" - an un-official reference for the objects, classes, functions, and extensions provided by this library by Sergio Pereira.

Quick Guide to Prototype

Particletree · Quick Guide to Prototype: "JavaScript’s increasing popularity throughout the web makes it more important than ever to make sure our client side code is implemented with a nice mix of stability, speed, and reusability. One of the best ways for accomplishing this is to use a simple library and syntax to use as a foundation for every project. Thankfully, Sam Stephenson created an amazing library of functions that we can rely on called Prototype.js to ease our JavaScript development practices."

Painless JavaScript Using Prototype

Painless JavaScript Using Prototype: "Prototype is an object oriented JavaScript [1] library (written by Sam Stephenson and friends) that makes JavaScript fun. So it says on the site [2], anyway. Those of you who are familiar with the open source community's latest and greatest application framework, Rails, may recognise Prototype as it actually forms the backbone of Rails' JavaScript helper. However, Prototype can be used independently of Rails to aid the coding of many JavaScript doodads and Web 2.0 thingy wangles."

Wednesday, March 29, 2006

Faster DOM Queries

Faster DOM Queries: "Alex Russell, head honcho of the Dojo Foundation, suggests a hideous hack to speed up DOM queries. Why does he want to do this? He wants behavioral extensions to be applied as quickly as possible and he has a point. For a good user experience the code to support a web interface should be applied as quickly as possible. A delay can lead to an unresponsive interface, confusing the user about what works and what doesn’t. So, while I think speeding up DOM queries is a worthy aim, I think that his “id hack” is a step too far. I am supposed to be a standards advocate after all." - Dean Edwards

Adaptive Path Essay on Ajax

The article that started it all...:)

adaptive path » ajax: a new approach to web applications: "If anything about current interaction design can be called “glamorous,” it’s creating Web applications. After all, when was the last time you heard someone rave about the interaction design of a product that wasn’t on the Web? (Okay, besides the iPod.) All the cool, innovative new projects are online."

Lightbox JS v2.0

Lightbox JS v2.0: "Lightbox JS is a simple, unobtrusive script used to overlay images on the current page. It's a snap to setup and works on all modern browsers."

Tuesday, March 28, 2006

Prototype PeriodicalExecuter.stop()

James Gregory has a written a simple extension for the PeriodicalExecutor class of prototype.js to add a stop() method to it.

PeriodicalExecuter.prototype.registerCallback = function() {
this
.intervalID = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
}

PeriodicalExecuter.prototype.stop =
function() {
clearInterval(
this.intervalID);
}
All it does is take the current registerCallback function (which creates the actual timer) and stores its returned interval ID which we then use in the new stop function with the native clearInterval method.

Complete article is here: http://www.metalmadness.co.uk/Blog/archive/2006/01/09/801.aspx

Monday, March 27, 2006

Ajax Timeouts with Prototype

Jason has an interesting post on AJAX Timeouts with Prototype, excellent to solve the network issues and keep control on it. A feature that Gmail handles very nicely by displaying an alert message when there is network problems. The code is commented and its very self explanatory.

Sunday, March 26, 2006

Scriptaculous - JS Framework

The power of AJAX allows for rich user interaction without the trouble that has bugged traditional web applications. Building upon the wonderful Prototype JavaScript library, script.aculo.us provides you with some great additional ingredients to mix in.

script.aculo.us provides you with easy-to-use, compatible and, ultimately, totally cool JavaScript libraries to make your web sites and web applications fly, Web 2.0 style.

Prototype - JS Framework

Prototype is a JavaScript framework that aims to ease development of dynamic web applications.

Featuring a unique, easy-to-use toolkit for class-driven development and the nicest Ajax library around, Prototype is quickly becoming the codebase of choice for web application developers everywhere.


JSMin - JS Compression

JSMin is a filter which removes comments and unnecessary whitespace from JavaScript files. It typically reduces filesize by half, resulting in faster downloads. It also encourages a more expressive programming style because it eliminates the download cost of clean, literate self-documentation.

ShrinkSafe - JS Compression

ShrinkSafe is a JavaScript "compression" system. It can typically reduce the size of your scripts by a third or more, depending on your programming style.

Many other tools also shrink JavaScript files, but ShrinkSafe is different. Instead of relying on brittle regular expressions, ShrinkSafe is based on Rhino, a JavaScript interpreter. This allows ShrinkSafe to transform the source of a file with much more confidence that the resulting script will function identically to the file you uploaded.