The Hyderabad chapter of IEEE computer society chapter conducted its 4th IEEE Computing Colloquium at BVRIT, Hyderabad. The event was very well received with 600 students from 21 colleges attending. I was fortunate enough to give a talk on security and its programming aspects.
BVRIT, Hyderabad deserves a special mention for playing an excellent host. The effort the host college put in organising the event was commendable.
Here are the slides from the talk.
Oracle sued Android for patent infringements related to java. The news is old, but there is still a lot of misconceptions floating around.
The biggest of them is around Android’s java support. Code for Android can be written in java language, compiled into a class-like (dex) format and run on Android’s Dalvik VM. So you code in java, run it on a VM. Sounds great so far. But is that java? No.
Java is not just the programming language. An equally, if not more, important part of java is the virtual machine. The VM is what gives java it’s strength, well captured in its punchline “write once, run anywhere”. Code written for Android’s Dalvik will not run on any other JavaME VM. Vice versa, code written for JavaME wont run on Android. Google had its own valid reasons not to go with JavaME. But at the end of the day, it is not justified to call what Android has as java-support.
Microsoft once tried to come up with a windows-only version of java, and Sun sued Microsoft successfully. Even if Android were to remove the dex format and run class format on its VM, bringing in a VM that is not compatible with the standards would only split the java community.
If Google admits that Android doesn’t support java, will it solve the problem? Not really. The beef of the lawsuit is patent infringements related to java VM. You see, the patented IPs are free to use as long as your VM is a fully compatible java VM. Its either a full implementation or nothing. Has there been any patent violations? Lets wait and see.
Lua with emacs
LuaMode brings a bunch of features like syntax highlighting, auto indentation etc to emacs. There’s an interactive and very handy Lua shell too.
Place lua-mode.el in your emacs’s load-path and add the following code to your .emacs file.
;; bring in lua
(setq auto-mode-alist (cons '("\\.lua$" . lua-mode) auto-mode-alist))
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
(add-hook 'lua-mode-hook 'turn-on-font-lock)
Your favourite editor is now ready for Lua!
If you find the prompt to save abbrevs irritating, add the following into your .emacs
(setq save-abbrevs nil)
Slides from the session I took on Programming for Performance for the IEEE Section Students Chapter held on 22 August 2010 at Hyderabad.
The talk discusses on various aspects of building an application with performance in mind. The talk is kept mostly at a higher level, with some specific examples from java.
LIET Session – RSS and Atom
Notes from Learning Is Every Thing session on RSS and Atom held on 17 August 2010.
This session discussed the history of RSS and Atom, their structure and application.
Thanks Neil for the video!
LIET Session: RSS and Atom from Neil on Vimeo.
LIET Session – JSON
Notes from Learning Is Every Thing session on JSON held on 16 July 2010.
The session gives an introduction to JSON, its advantages, how to consume JSON services and how it stacks up against XML.
Here’s the code from hands-on session on consuming flickr’s api to explore interesting pictures:
<html> <header> <title>intersting pics</title> </header> <body> <script type="text/javascript" > function jsonFlickrApi(list) { for(i = 0; i< 10; i++) { j = Math.floor(Math.random()*100); document.write("<br>"); document.write(list.photos.photo[j].title); document.write("<br>"); document.write("<img src=\"http://farm"); document.write(+list.photos.photo[j].farm+".static.flickr.com/"+list.photos.photo[j].server+""+list.photos.photo[j].id+"_"+list.photos.photo[j].secret); document.write(".jpg\" >"); document.write("<br><br><br>"); } } </script> <script type="text/javascript" src="http://api.flickr.com/services/rest/?method=flickr.interestingness.getList&format=json&api_key=your_api_key" > </script> </body> </html>
You’ll have to replace the api_key with a valid one.
Wish List: Java Object Replacement
I wish I could replace an object with another of the same type and the myriad references existing to the first one would automatically be redirected.
Obj o1 = new Obj("Red");
map.put("Ball", o1);
list.add(o1);
ball = o1;
Obj o2 = new Obj("Blue");
o1.replace(o2);
map.get("Ball") should return the blue ball.
list should contain blue ball.
ball == o2 should evaluate to true.
We can work around the situation by extra code in Obj using composition and method call redirection. Wouldn’t live be simpler if the support is native?
The security part could be controlled by providing a markable interface or annotation.
Real life examples? Substituting a player. Corporate mergers. Two pools joining to make a bigger pool.
Tag based filesystem – Part 1
If you could design a file system from scratch, would you have directories to organize the content? Or would you prefer to tag your files?
Folders and files are what we see and can relate to very easily in the physical world. You store all your paperwork (files) in a folder, keep the related folders in a particular drawer of a cabinet. Unfortunately, a file cannot be inside two folders at the same time. You could go ahead and cross-reference your files. That, my friend is a tag!
The fundamental idea of a tag based FS is you add multiple tags to a file and add multiple files to a tag. You do not bother about where the files are stored. Why do you need to know, as long as you can retrieve them in a convenient way? In a sense, a tag FS sits somewhere between folders and a database.
What is the advantage of having a tag based approach? How do you access your files without knowing where they are stored?
Lets say you are looking for your vacation pictures. Open your file explorer and put the keywords of the picture you want.
While Photos Goa will show you pictures from your Goa vacation,
Photos Goa 2010 reduces it your last Goa vacation photos.
See all your vacation pics of 2010 with Photos 2010 or jump across to the flight ticket and hotel booking details with Goa 2010 Documents.
There are multiple ways to reach to a file and that is a key problem a tag based system tries to solve. Should you store your source code under “src/technology/module” or “src/module/technology”? It doesnt matter anymore. You could reach out to your files in an intuitive manner – based on its attributes that you remember. An intelligent system that could automatically and semantically tag your files makes life a lot more easier.
The tagging feature is already present in most photo management apps like f-spot and picasa, but its time that the support comes from the filesystem for all the files. Google caused quite an uproar when it introduced tags as a replacement for directories to organize content in gmail. Looking back, they did the right thing.
A tag based FS opens up a whole new avenue and brings along its share of challenges too. We’ll take a detailed look at them in the follow-up posts.
Java EE 6: What's new?
Here’s a concise white paper on what’s new with the latest release of Java Enterprise Edition. I recommend reading it.
And here’s a jist of things:
- Web Profiles – For the light weight web apps where you don’t need a full blown container.
- Servlet 3.0 – Annotation based, with support for web fragments and asynchronous processing (AJAX just got better).
- JAX -RS – Restful web services are here.
JavaFX: Coming of age
When it comes to web pages, I like them plain and simple. Earlier associations of flash and other embedded content with irritating ads and browser crashes makes me cringe when I hear “rich media”. Ajax was refreshing with its unleashing of the hidden powers of CSS and javascript.
But you got to face it. You cannot ignore RIA anymore. If you are going the RIA route, what options do you have?
Flex has been the industry favourite. But again, here’s reasons why (from Adam Bein’s blog) JavaFX is a good option too.
Take a deep dive!
