Sunday, March 18, 2012

[Screenshots] Mozilla’s Mobile OS, Boot2Gecko (B2G)

Mozilla has been working on its own Mobile OS code named “Boot to Gecko”(B2G) for quite sometime. B2G is a browser based operating system built using the standard web technology stack. B2G is expected to run on low end smart phones as well. I am impressed with the idea of using standard web technologies for mobile app development (on the similar lines of Windows 8 HTML5 apps). Mozilla claims that they are working on web APIs to expose device capabilities such as telephony and other media devices. The project is still in its early stages. B2G was show running on Samsung Galaxy S2 at the Mobile World Congress last month. If you are interested in contributing to this project, check out the code from here. Neat instructions are provided to build the code and an Android based emulator is also included for testing. B2G uses the same low level building blocks (Linux kernel, libusb, etc) which Android uses. I played around with it last night and here are some screenshots of B2G. The user interface was a bit on the slower side in the emulator.

B2G - Home Screen

B2G - Home Screen

B2G - Home Screen

B2G - Home Screen

B2G - Settings

B2G - Dialer

B2G - Gallery

B2G - Video Playback

B2G - Mozilla Marketplace 

B2G - Music App

B2G - Music Playback

B2G - Penguin Pop Game (Demo)

B2G - Firefox Browser

B2G - Keyboard

B2G - Cut the Rope (HTML5 game)

 B2G - Cut the Rope (HTML5 Game)

-- Varun

Tuesday, March 13, 2012

Insight into Google’s Input / Output machine

Google has just updated its Google I/O site with details about the 2012 edition of the event. Registration for the event opens on March 27th (If I remember correctly, the tickets for Google I/O 2011 were sold out in less than an hour. Good luck for those looking forward for the tickets.). Like the 2011 edition, this year also Google has added some cool stuff on its site. Google I/O 2011 site had an awesome countdown timer (Chrome experiment) which was counting down to start of the event. The brilliant designers at Google have taken it a step further and have built a game called “Input/Output” to play-with till the event. This game is again a Chrome experiment and I am really impressed with it. I played with it for couple of hours and this post is an (unofficial) insight into some of the technologies used in this experiment.

About “Input / Output machine”

The objective of the game is simple: use the tools and machine parts to create a Rube Goldberg-inspired machine that moves a particle from the <input> to the </output>. It looks simple but, believe me, it is very addictive. Its the New Angry Birds!! Once you get going with the machine, you can just unleash your creativity and build some creative ones. Also, Google has promised that some of your creations could be featured at Google I/O 2012. Build your machine and share it on Google+ using #io12.

Google Input / Output machine

Technologies used

The JavaScript code which is the backbone of this whole experiment is not obfuscated, fortunately. That made it easier for me to dig through what is going behind the scene. The whole experiment seems to be heavily dependent on Canvas rendering. HTML5 canvas element is very powerful but it is very difficult to work with when it comes to handling user interactions. Easel.js is a neat solution to this problem – It allows you to retain a full hierarchy of display objects rendered on the canvas and enable interaction on them. (If you have seen the cool charts on Google Zeitgest 2011 site, that was also built using Easel.js). Every tool on the toolbox is rendered as a display object onto the board and then the necessary event handlers are added to facilitate the positioning of the tool on the board.

For calculating the motion of the particle and transforming the particle, JavaScript library “Slyvester – Vector and Matrix Math for JavaScript” has been used. Another interesting JavaScript library used is “Stativus : StateCharts” which is a micro framework for maintaining state charts of an application. Apart from these, there are few utility libraries like “Underscore.js”, “jQuery Easing”, etc being used. All the aforementioned libraries are packaged inside a single JavaScript file named as “experiment.js

JavaScript Libraries used

  • Easel.js – Library to work with HTML5 canvas. It provides a retained graphics mode for canvas including a full, hierarchical display list, a core interaction model, and helper classes to make working with Canvas much easier.
  • Slyvester - Vector and Matrix Math for JavaScript. It includes classes for modeling vectors and matrices in any number of dimensions, and for modeling infinite lines and planes in 3-dimensional space. It lets you write object-oriented easy-to-read code that mirrors the math it represents.
  • Stativus – Library for maintaining the state charts of an application. Statecharts are a great way to organize your web application and make it more robust and increase code reuse.
  • Underscore.js – Utility library that provides a lot of the functional programming support.
  • jQuery Easing Plugin – jQuery plugin to give advanced easing options.

Quick hack to unlock different particles

When you click on the <input>, you get options to position the <input> and you will also see another option to change the particle (as shown in the screenshot below). By default, only the first particle is enabled. As you build the machine and progress on the game (not really sure about the trigger – Chrome particle gets active on remixing some existing machine), you will get few additional particles – Anti-gravity Plus particle, Androidify particle, Chrome fast particle. Here is a quick hack to unlock all those particles by default:

  1. Information about the unlocked particles are stored in a variable called USER_METADATA.
  2. Open JavaScript Console (Cmd + Shift + J) on your Google Chrome.
  3. Enter the following lines: USER_METADATA.hasPlusParticle = true;USER_METADATA.hasAndroidParticle = true;USER_METADATA.hasChromeParticle = true;
  4. Yay! You are all set. Now, you can try out all the available particles.

Google Input / Output machine - Input particles

Well done, Google! It is very addictive and I am going to spend more days on it. Please let me know if there is anything incorrect in this post.

Update: Thomas Reynolds, the lead developer of this project commented on this post with some corrections. “We actually only use Ease.js, which is the Penner Easing Equations from inside Easel. Our canvas renderer is 100% custom. Regarding the particle hack, so glad you found that! There are a ton of "developer" hacks, mostly global variable, just waiting to be tweaked.”

-- Varun

Sunday, February 19, 2012

JSFoo Chennai 2012!

JSFoo is a one day conference on building rich web applications in JavaScript. Having tasted success on its previous editions in Bangalore and Pune, HasGeek organized the Chennai edition of JSFoo on 18-Feb-2012. The turn around for the event was quite good. I had reached the event at around 8:30 AM and was catching up with some of the old friends. The day started with an introduction to HasGeek and what followed was a series of interesting talks in two parallel tracks. Overall it was a good learning experience. The videos of the event will be out in the web shortly. Attaching the screenshots of mind map I have created during the event. Click on the images to enlarge them.

Cross Platform Mobile apps using JQuery Mobile and RhoMobile

The first session I attended was on cross platform mobile app development by Balaji Loganathan. He talked about some of the popular web frameworks to build mobile web app. He briefly compared the mobile web app and the native app and explained the need for cross platform mobile app development API. Then, he talked about RhoMobile and how handy it is for building enterprise mobile applications. 

Cross Platform Mobile apps using JQuery Mobile and RhoMobile

Production ready apps with Flatiron

Flatiron is a framework for building applications using Node.js. Flatiron is sponsored by Nodejitsu and the code is available on github. I have built few apps in Node.js before but have never heard about it. The session was delivered by Pavan Kumar Sunkara (@pksunkara), a student from IIT Madras who is currently doing his internship with Nodejitsu. Flatiron seems to include some interesting components and it is the responsibility of the app developer to pick and choose what he wants. It is still in its early stages – just two months into development but seems to be promising. All the best to the team.

Production ready apps with Flatiron

JavaScript and the compatible Web

The session on the compatible web was delivered by Rajesh (@avranju) from Microsoft. Though the session was meant to be a sponsor session (Microsoft was one of the sponsors for the day), Rajesh didn’t focus much about Microsoft products. He talked about the challenges in building web applications because of the availability of wide range of browsers and OS. He talked about Modernizr and other frameworks / techniques to overcome these compatibility challenges. Nice and interesting session. 

JavaScript and the compatible Web

Data visualisation in JavaScript

The session was delivered by Anand S (@sanand0), chief data scientist at Gramener. He talked about the need for visualization. He said “Don’t take too much into average. Try to plot all the points and visualize them”. For visualizing data, one need to be creative and tools are just helpers in the process. You can build rich visualizations with simple divs in HTML without any complex libraries / tools. He demonstrated some of the cool visualizations he has build at Gramener. His talk was very crisp and clear. One of my favorite sessions for the day.

Data visualisation in JavaScript

Building visualisations that rock using Web Standards

The second session for the day on data visualization was delivered by Harish (@hsivaram), a web developer evangelist at Adobe. This was the first session right after the lunch break but still Harish managed to keep us awake. Great job bro! Harish showed us how passionate he is about the data visualization. The session was more like a Show-n-tell where he built a replica of the cool visualization on Google Zeitgeist 2011 site. He used Easel.js and Tween.js to build the visualization in less than 40 mins.

Building visualisations that rock using Web Standards

Tracking Memory Leaks in Client Side JavaScript Application

This is a session by another sponsor of the event - Directi. Vishnu (@pathsny) from Directi delivered this much useful session. He talked about how to identify memory leaks in JavaScript and some of the good practices to avoid them. His session was very informative and I would rate this as the best one for the day. I have learnt a lot from this session. Looking forward to the video of this session and the demo app he has built. 

Tracking Memory Leaks in Client Side JavaScript Apploication

JavaScript is mischievous. Handle 3rd party content with care!

This interesting session was delivered by Krishna Chaitanya T (@novogeek), a Microsoft MVP for IE. He talked about mashups and the things we need to consider while including third party scripts in our web application. He briefed on the possible attacks because of the usage of third party scripts via script injection or frames. The demo was also quite interesting. This is another session for which I would give the highest ratings.

JavaScript is mischievous. Handle 3rd party conttent with care!

Ajax is history - Build real time apps in JavaScript

The last session of the day was on building real time web application. It was delivered by Srirangan S. He talked about how the web applications have evolved in the last two decades. Then, he demonstrated how he built his site review19 using Node.js and Socket.io.

Ajax is history - Build real time apps in JavaScript

-- Varun

Sunday, January 29, 2012

Golden Dream - Rolls Royce With a Hemi Engine

Golden Dream Rolls Royce with Hemmy - by Ivan Mitev PhotographyI stumbled upon this ostentatious golden beauty tonight and had to put it up on art car central. Not only is it a Rolls-Royce covered in gold but its got a Hemi engine of epic proportions. This vintage 1970 Rolls-Royce Silver Shadow had an "ordinary" 6.75-liter V8 swapped out for a 592 Hemi, complete with dual-stage nitrous system for

Friday, January 27, 2012

One of the Biggest Pink Colored Freighter Ships on Earth - Contship Germany

I think I found one the biggest pink colored freighter ships on earth called the "Contship Germany" owned by The CONTI-Group, one of the world's leading managing owners of container vessels and tankers. That's a whole lot of pink paint if you ask me but I think its just a starting point for what could be a beautiful art ship. They probably should call on Emily Duffy creator of the Vain Van Art
google-site-verification: googlea4d68ed16ed2eea6.html