Moved out of Facebook Home

image

It just lasted an hour. I would use it if I were more into Facebook.


Google Reader is going away

Google Reader has been my RSS reader of choice for the sometime now. But for the past few months I have been reading the feeds exclusively on my HTC One X using Feedly. With the little free time I had this was a quick way to catch up on reading. Now looks like Feedly is going to be my RSS reader on the desktop too. They are looking to clone the Google Reader API and continue supporting feed syncing. Awesome.

Google Reader API made Google host the backend for numerous RSS clients like Feedly. The clients could just concentrate on the presentation layer and not worry about the backend. Looks like all these clients have to rethink their strategy now. Maybe this is why Google is shutting down Reader. It does not want to be just a API with no way to make money.



It’s a boy

Joshua Bradley Vasanth

Joshua Bradley Vasanth

My wife and I are blessed with a baby boy. This makes Kaitlyn a big sister!


Running standalone Groovy scripts

As I mentioned in my post Learning Groovy, I am writing Groovy scripts to automate some simple tasks. Now I want to share the scripts with others. I did not want them to install Groovy just to run the scripts. I had the groovy-all-1.8.0.jar, so I typed the following in the command prompt:

1
2
C:\temp>java -jar groovy-all-1.8.0.jar Hello.groovy
Hello

It worked. Simple. Now I tried to run my script that retrieved the XMLs from a database.

1
2
3
4
C:\work\FetchData>java -jar groovy-all-1.8.0.jar FetchData.groovy
Caught: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at FetchData.fetch(FetchData.groovy:51)
at FetchData.run(FetchData.groovy:3)

Of course I need the driver jar in the classpath. So I added the sqljdbc.jar to the classpath.

1
2
3
4
C:\work\FetchData>java -cp sqljdbc.jar -jar groovy-all-1.8.0.jar FetchData.groovy
Caught: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
        at FetchData.createCSV(FetchData.groovy:51)
        at FetchData.run(FetchData.groovy:3)

Looks like the script is run with a different classloader and the java classpath is not passed to it. I did some lazy googling but did not find the answer I was looking for. So I looked at how eclipse is doing it. Eclipse used GroovyStarter and GroovyMain to run scripts. Not knowing which to use, I just used GroovyMain:

1
2
C:\work\FetchData>java -cp lib/groovy-all-1.8.0.jar;lib/sqljdbc.jar groovy.ui.GroovyMain FetchData.groovy
Fetched Data!

It worked! I just added the command in a batch file to share the script.


Infinitest: A continuous test runner for Java.

Infinitest is a continuous test runner for Java.

Infinitest is an Eclipse plugin that runs the JUnit tests instantly when you save a Java file. Check out the demo above. It smartly runs only the test affected by the file you just saved. This is cool. You can immediately know if you broke something as soon as you save your code. Of course, your test cases should be comprehensive. Improving Works developed this plugin and has released it as a open source project.


Learning Groovy

I have dabbled a bit with scripting languages before but for some reason never really used one long term. I think that might change with Groovy. A colleague of mine got me interested in it and I have been picking up all the cool things Groovy can do by reading Dustin’s “Inspired by Actual Events” blog. Come to think of it Groovy could have saved me a ton of time I spent in writing small tools to help me in development.

I like the how concise and simple writing groovy scripts are. Here is a snippet of code to print rows retrieved from a database.

1
2
3
4
5
6
7
8
9
10
11
// Get instance of Groovy's Sql class
// See http://marxsoftware.blogspot.com/2009/05/groovysql-groovy-jdbc.html
import groovy.sql.Sql

def sql = Sql.newInstance("jdbc:oracle:thin:@localhost:1521:orcl", "hr", "hr", "oracle.jdbc.pool.OracleDataSource")

// iterate over query's result set and "process" each row by printing two names
sql.eachRow("SELECT employee_id, last_name, first_name FROM employees")
{
println "Employee ${it.first_name} ${it.last_name} has ID of ${it.employee_id}."
}

At work I needed to retrieve about 100 XMLs stored in a database, strip out some tags from it and write it to a file. It took about 15 lines of Groovy code to do it. Probably could have done it in less but I am just learning Groovy.

Here is another way to use Groovy that I wish I knew before. Embedding Groovy in Ant:


1
2
3
4
5
6
7
 <zipfileset id="found" src="foobar.jar"
            includes="**/*.xml"/>
 <groovy>
     project.references.found.each {
         println it.name
     }
 </groovy>

Though the above snippet is simple, it shows how the Groovy script is aware of the Ant references. Pretty powerful.

I will showcase just another snippet before I am off to learn more Groovy. Invoking a web service:

1
2
3
4
5
6
7
8
@Grab(group='org.codehaus.groovy.modules', module='groovyws', version='0.5.2')
import groovyx.net.ws.WSClient

proxy = new WSClient("http://www.w3schools.com/webservices/tempconvert.asmx?WSDL", this.class.classLoader)
proxy.initialize()

result = proxy.CelsiusToFahrenheit(0)
println "You are probably freezing at ${result} degrees Farhenheit"

Droid Save/Droid Save IP Updated

I have updated a couple of my Android applications in the Market. The apps are simple. They save any links you share to either Instapaper or Read It Later services. The main new feature is offline capability. You can save links even when you have no internet connection and once the connection is back the apps will save the links. Here are the change logs and where you can get them:

Droid Save [Product Page | Market | AppBrain]

Version 1.6

1. Added offline capability. If there is no internet connection the URLs are saved locally and then sent to Read It Later when connection is back.
2. Added support for special characters in passwords like  ”<”, “|”.

Droid Save IP [Product Page | Market | AppBrain]

Version 1.2

1. Added offline capability. If there is no internet connection the URLs are saved locally and then sent to Read It Later when connection is back.
2. Added support for special characters in passwords like  ”<”, “|”.
3. Added support for accounts without password.

I developed these applications for me to use plus to learn Android development.


Android App Spotlight: Smooth Calendar

One main reason I like Android over iPhone is widgets. With widgets I can, at a glance, look at the information I need. In iPhone I had to open an app, waiting for it to load and then finding the information I need. Calendar information is something I want to quickly get to. Smooth Calendar is the widget I like the most. And it is free. Try it out.

The following screenshot has the Smooth Calendar below the weather time widget.  The weather widget is Beautiful Widgets.


Motorola Atrix 4G @ CES 2011

I have been following CES 2011 as any geek would. As expected there announcements of Android Tablets, 3D TVs, glassless 3D TVs, 3D laptops… But the one thing that caught my attention is Motorola Atrix 4G. It is a Nvidia’s dual-core Tegra 2 phone with a 960 x 540 resolution, fingerprint reader and HSPA+. But it is not the most interesting part of it.

The coolest thing is that it has a Laptop Dock! What? Well the concept is not new. Remember Redfly? Or Palm Foleo? But this is better. When docked on to the laptop, you can use the full phone UI and all its apps plus a full desktop Firefox browser and more! See the screenshot below.

Still don’t know what the Webtop OS is but what it offers is pretty cool. It also has a multimedia dock. Looks like I have to start saving for this!

Catch the video of this at laptopmag.com.


Pages:1234567...141