Mozilla Dev Network Hackday – NYC – March 2012

So.. Mozilla had its first ever Hackday in New York City last Saturday and I had the opportunity of attending it. There were some really good talks which ended with some hacking post lunch. It was an awesome experience getting to meet all the wonderful folks who participated in the hackday and to see their great hacks, and the excellent job by the Mozilla team in running the show.

Some of the talks that were presented were (slides linked):

At the end of the day, I presented an extension that would calculate the Readability scores of text that was selected within the browser. This “Text Readability Scorer” Firefox extension was something that I already had in mind, but which was languishing and waiting to be completed using the latest Addons SDK. The hacking started post lunch and I managed to do complete something that could be presented at the end of the day. While this add-on didnt use any of the cool HTML5(and friends) stuff that was presented earlier that day, I still managed to get a working Extension for Firefox 11 and presented it in the end.

A more complete write-up of the event can be read at the hacks.mozilla.org site, with the extension I presented getting a mention under the “Here come the hacks” section.

Below are a few screenshots of the Readability extension in action, The source code can be found on GitHub.

Add-ons screen showing the Readability Extension
Add-ons screen showing the Readability Extension

 

Context-sensitive Right-Click menu showing the "Calculate Readability" menu option
Context-sensitive Right-Click menu showing the "Calculate Readability" menu option

 

Final result screen shown in a "Panel" with the Readability results.
Final result screen shown in a "Panel" with the Readability results.

There is still a lot of work that has to be done, such as calculating the number of syllables more accurately etc. Lets see where this goes, I might be submitting it to the Add-ons’ site once it has some more complete functionality. Thank you for reading! 🙂

Mozilla Firefox: Is there a difference between Add-ons, Extensions and Plugins?

I was reading up some documentation about writing my own Mozilla Firefox extension when my close partner in crime, Vignesh, IMed me. When he found out what I was doing, he asked me what exactly the difference was between a Firefox Add-on, extension and a plugin.

After thinking about it for a while and coming across the same in the extension development documentation – I decided to write about it here..

In short, all extensions are also Add-ons, But “Add-ons” is an umbrella term for extensions, themes, plugins and language-packs.

Extensions

Extensions enable the user to alter the existing functionality of the browser or to add completely new functionality. Eg: Firebug, YSlow, etc.

Plugins

Plugins are libraries which are used by the browser to display/render stuff that it cannot do natively, Eg: Flash, Java, PDF etc.

Themes

Themes allow you to change the look and feel of the browser, allowing you to customize it to your liking. There are hundreds of free themes for download.

Now, If you were wondering what the difference was between a Firefox theme and a Persona, Personas are a special kind of theme which lets you change the look and feel without altering other components of the UI such as the navigations buttons, etc. It also lets you try and install new “personas” without having to restart your browser to apply the changes.

If you had this question lingering in your head, hope you found it useful!

Super Mario in JavaScript!

I was just reading this post on Arcade games and nostalgia on Coding Horror when I just came across this amazing implementation of the classic Super Mario game in JavaScript at nihilogic!! Everthing about the game is in JavaScript including the sound version which is supposedly base64 encoded! And to top it all, it is written in only 14KB of code! An amazing feat indeed.

Everything about the game is in JavaScript with no images or audio files used as quoted above. I tried my hand in it and the game was pretty decent enough, but the point here is not the game, but the fact that you can do so much using just a little JavaScript!

Check out the post here and the games with audio, without audio, with audio(2x size) and without audio(2x size).

But when it comes to Standards, Sorry Mario, but our Princess is in another castle!

Spry – Adobe Labs

I just came across Adobe Lab’s AJAX offering, titled Spry. Creating dynamic applications seems to be a breeze for non-programmers and time-saving for regular programmers. This is a completely client-side set of libraries with no dependency on any other downloadable or server side component.

A good set of demos are provided alongwith code samples that show how easy it would be to deploy Rich Internet Applications that can be rapidly developed by mashing up components from Spry to come up with your final RIA. Quite a few visual effects top up the icing on the cake. Spry also has pre-built widgets which you can customize out of the box. Quite a lot of other widgets that aid in form validation are also provided making it easier to validate form input too.

Just to refresh my memory, I checked out OpenLaszlo, another open source framework for RIAs, the last time I saw it, it seemed to be relying overly on Flash, but on my latest visit, found that there was rendering in DHTML too from version 4 onwards. Though I am not a critic of Macromedia Flash, er Adobe Flash, there are many things that can be achieved without going for plugins like Flash, which ultimately lies with the way the designer designs the system choosing whether or not to implement plugins for simple functionality.

Check out Spry here.

Standards. Standards. Burp.

I have been implementing some Web Services on WebSphere DataPower and it is almost a breeze in most cases, with the majority of the development time spent in coding the XSLs for transformation and the rest configuring and setting up appropriate error handling mechanisms. Even the binary to XML, XML to binary transformations can be simplified using tools such as WebSphere Transformation Extender or Contivo’s Analyst. All of these just leave you in a state of disjoint harmony, you absolutely like the fact that life’s made easy for you, while at the same time cringe on knowing that if you had done it by yourself, you would have learnt two(or a million) more new things today! We shall take that up for some other day, coming to standards now.

Standards and Web Browsers will definitely be remembered for a long long time to come. I was just reading this entry on Joel Spolsky’s blog on how the developers of IE8 are mulling over strict standards settings or to allow for default IE7 style behaviour which is not that strict when it comes to standards.

If you are a web developer, you must admit that we are all sick of trying to write code to make sites look as close as possible to being similar on all browsers. And with IE being IE(barring the recent move towards ‘standards’ mode), a lot of different hacks needed to be put in place just to get the same look and feel. Let alone JavaScript hacks. Now, with pages numbering in billions all over the Internet, when people go strict all of a sudden when it comes to standards, it really will get a good beating! Sites working previously might not even display! Whew! And as Joel rightly puts it in his post, developers are also to blame for coding code without giving any forethought if their code would actually be standards compliant or not(including me). I have done a lot of CSS and JavaScript coding over the past few months, but each time, barring for a few tests, I really do not do much to see if the code is really standards compliant. Partly since the applications that I built were not for public use and the target audience was well covered in terms of configuration since all of the apps were internal and mostly because I am sick of it. I have had enough searching Google for each and every hack to make a part of the page work as intended in IE, Firefox and Opera.

The list of hacks can become endless, but if you really want to have the cake and eat it too, well.. Never mind. We can probably wait for the next version of HTML, and probably start coding, ‘strictly’ adhering to standards, with the version tag telling all about it, just as all the others put forth, but ultimately, the major responsibility lies with the developer who is coding the pages in the first place, like you me and yeah all of us.

IBM WebSphere DataPower Certified!

And just when you began to think that I was letting my blog die without being fed with its much needed ‘posts’, I am back with an update!

After two weeks of training and POC’s I finally cleared the IBM Certified Solution Developer exam(Test-284) for WebSphere DataPower SOA Appliances exam yesterday with a good score and held upto my manager’s hopes! The DataPower Certification exam was said to be quite tough and needed a lot of attention to clear it successfully!! The going was a tough one as there are a lot of questions in the exam with plenty of Use Cases and scenarios which weren’t completely covered in the classes, but most, which if you analysed the question correctly would narrow you down to two choices or less! All of this made me take up almost the entire duration of the exam, a little over two hours. I have found that I finished two other exams I took (Teradata Certified Professional and an IBM Certified Database Associate) with more than half an hour to spare. But ultimately, alls well that ends well!

A big kudos to the organisers, staff and mentors from IBM! (Tapan, Sateesh, Vanishree, Yaseen, Manu and all others!)

I also got to know that our batch were among the first people(after Yaseen) to take up this exam in the Asia Pacific Region! Cool! Makes it even more special! And with almost everyone clearing the exam, it was happy moments indeed!

I am now officially certified for WebSphere DataPower!! Yaay!!

Google – Indian Languages Realtime Transliteration

Some days back, I checked out the Google Indic Transliteration service. I was amazed at the way the guys have implemented it!! It is dissimilar from most other transliteration services in many ways. Here, you get the word in your selected language, say tamil the moment you type a word in english and hit the space bar or a punctuation symbol. If the spelling appears incorrect, clicking on the word gives you more suggestions and the word can also be edited as needed.

I found that it worked like a charm for most words, which I verified with some of my friends as I am weak in Tamil. Hindi seemed to work fine too and a friend of mine said Kannada was also transliterating to their respective correct spellings! Way to go guys!! The languages currently supported by this application are Hindi, Tamil, Telugu, Kannada and Malayalam. It works better if you type a word in English which a English speaking person would pronounce correctly, for example, in tamil, the word “portions”(English) would not transliterate correctly, but typing “poshuns” seemed to do the job >:-)

Check out Google Indic Transliteration!

The Earth and other heavenly bodies comparison

I came across this interesting page which showed a visual representation of the size of the Earth compared to other planets, then the size of each of the planets compared with the size of the sun and so on.

You will be able to see that as we begin to include bigger and bigger heavenly objects, the Earth seems kind of insignificant amongst all the other mighty heavenly bodies!! Quite interesting, Check it out!

Click here to view the comparisons.

Reliance Data Card(ZTE) Review

The frustrating series of unfortunate events that I had mentioned in my previous post have finally stopped and the project was a resounding success! If not for confidentiality reasons, I would have let the world know of a great deal of tips and tricks that they would probably come in a situation similar to mine, but more on that later.

[UPDATE : Dec 2008] : I have been using this connection for over a year and I dont see any major problems with this card or connection. I do not use NetBooster(since the proxy server goes down every now and then). But otherwise, the connection is pretty decent. If you are facing connection issues, please check your network signal strength.

I finally got myself a data card for mobile internet access. I was previously using my Nokia 3230 as a modem and was browsing through it, but it would be really frustrating at times when the connection would be active, but when there would be no response from the server. Then after that, I was using this BSNL broadband at my place which was very good, but it was shared with my room-mates and I found it difficult to use when I really needed it.

Getting a BSNL connection takes time, so I decided to get an Airtel Broadband connection and to my dismay, found that it wasn’t available at my location. So finally, after conducting some research on my own, found that the reliance data card was the best choice of the lot, being wireless, minimal setup and with the advantage of carrying it everywhere. While I have personally experienced a little improvement when using CDMA for data transfer versus GSM.. Hence I decided to go for a CDMA Data Card instead of a GSM data card, like the one offered by Airtel.

The available two choices were from Tata Indicom and the other from Reliance Communications. Though performance-wise, I found that both were the same, the delimiting factor being the strength of the network signal at your place of usage. Then I found a deal at Reliance that seemed good and went for it, I took a plan which had a one time payment of something around INR 9K for which I got a one year subscription of the Reliance NetConnect Service, with 1GB usage per month for a year and with the cost of the card being waived(more tariffs here). Initially I faced some problems with the account not being activated even after being assured by the salesperson at the Forum Branch, Bangalore. After more than a day of calling them(the branch, read below for Customer Service), they finally activated my account. The most disappointing thing about Reliance was that I could not connect to any of their support lines, getting a ‘busy’ tone even at 1:00 AM in the morning.

Then I found that the service kept getting disconnected even when the device could detect three ‘points’ of the signal, with 5 being full. I decided that I needed a powerful signal and hence I sat at another location which had four points and found that I could get decent connectivity at that location. The bottom-line now is that if you have a good signal, your connection will also be good, but if not, its as good as nothing. So check if you have a good signal using any cell-phone(borrow it from your friends!) before buying either of the cards.

One other feature I noticed is the NetBooster software by Venturi Wireless that is provided by Reliance.. I found this to be extremely effective. The software connects to its server which acts as a proxy for our connection, All content is routed through that proxy and depending on our settings, we can load pages much faster. It was interesting to see how they were doing it, If you select the “fastest” options for images, the images are manipulated at the proxy server and sent to the device at a very low quality, which obviously speeds up our download and lowers bandwidth consumption for un-necessary images. It also proclaims that it removes unwanted markup from HTML code, making it load faster without altering the layout of the page! Really very interesting to note! And I found that it was pretty effective too.

I am using the ZTE card model, Sierra and Huawei being the other two models available with Reliance. I doubt that they give us the option to choose though you get to choose if you want the USB external modem or the Data Card itself. I found the Data Card to be giving me around 6.5 to 7KB/sec download speed. The speed fluctuates going as high as 15KB per second but for the most of it hovering around the 7KB mark with four points of network.

I would recommend buying this to anyone who is in need of a “something-is-better-than-nothing” internet connection, though the advantages it offers, especially on the move far outweighs the other drawbacks such as latency and frequent disconnects.

Whatever can go wrong, will go wrong

Most of you must know about Murphy’s Law, which states that if something will go wrong, it will go wrong no matter what!! The same thing happened to me, We had developed something which was part of a series of items that were to be deployed. Everything was working to a T…

But when the D-Day arrived and when we had an ‘important’ audience.. the first item that we had developed just refused to work and do its function!! Rats!! I am still trying to figure out what went wrong! Most probably it isn’t something big and will resolve by itself tomorrow, or a small trace will identify the problem!!

But in the end, Murphy seems to always have his day!!