Saturday, March 31, 2012

What the heck is a RockMelt?

The Rockmelt Browser
Most recently, a friend pointed me to Rockmelt. It tags itself as a Wowser. I don't know how the marketing guys come up with that but technically is just a fork of the Chromium browser which the Google's Chrome browser calls papa. Don't see this as a bad thing, Chromium (and by extension Chrome) are pretty stable and fast browsers. Rockmelt is the same thing its a just as fast. Rockmelt is just customized to do a particular thing - social web surfing. It directly integrates to Facebook, Twitter, 9gag, etc. in this nifty sidebar widget thing on the left. A direct share button is pretty nice feature and a Facebook chat on the right sidebar.

But Rockmelt inherits one of Chrome's bad characteristics. It's memory-hungry.  Each widget spawns its own process, sure it makes the Rockmelt run fast but I would be hard press in recommending it to be installed on a budget notebook with only 1 GB of RAM or less. I come across a lot of these 11-13 inch notebooks in my work.

Installing Rockmelt is no big deal, its free and the installer is like 600kb. The installer is one of those file tractor pullers - you run the installer and it then down loads the rest of the browser. No biggie.

After that, you get to a first-run wizard, it ask for your facebook login, this is where it get hairy for some of us, Rockmelt basically want all the rights. If you're concern about privacy, this page will make think about why you got Rockmelt. I already know of a guy who said no and uninstalled Rockmelt.Then you move to a page where you pick a bunch of "Apps" to be added to your Rockmelt.

The Apps here are more of RSS readers allowing you see if there's anything new on that site. Think of them as direct views into the associated site. You have a lot of choices, from Tumblr, Twitter, Pixable, Mashable!, etc. But some apps have direct interaction to the sites, for example Twitter, you can post tweets directly from the Twitter app inside Rockmelt.

Once done it works like another browser but with a direct connection to Facebook.

Which leads me to "the" question: is it worth it? Nothings seriously wrong with it. It did crash a few times but only the tab causing the crash was lost not the whole browser. Nothing serious. A few people will find the permissions page during installing a bit unnerving. Reminds me of that phrase: "signing your life away."

Overall?

Get Rockmelt if basically your homepage is Facebook or you check your Facebook every chance you get and you're not a privacy rights Nazi. Which I think is an oxymoron if I ever seen one. It's already a pretty fast and stable browser. Who knows, it might make you more "productive" but that's a long shot.




Thursday, March 15, 2012

Got tired waiting for ICS so back to MIUI

ICS on my phone was sweet - battery life was excellent, games (3d and what not) were running smoothly but and this is a BIG but..No camera. I know that edowar is working on it and its a pretty hard problem to crack. It's a hardware driver problem and Foxconn isn't really going to fork over that one any time soon.

My Home screen
So we go back to MIUI. Imagine my surprise that TJ's MIUI wasn't the only one out there for my CM Magnum. People made forks and ran with it. I mean RAN. I found 4 more other ROMs for my phone and all based on TJ's stuff. TJ is a god!

As for the choosing which on to flash into my phone - I wasn't really that scientific about it. I just basically went for the "eye-candy" factor. I decided on CacingKalung's MIUI 2.2.3 ROM.

It's about 117MB (make that about 120ish if you download the extras which I did.) and it installs flawlessly.

I'm reinstalling my stuff and let's see how this works out while waiting for a stable,working ICS for my phone.

So far, its pretty sweet.


Sunday, March 4, 2012

Quirky stuff with JNDI and MSSQL

My last post talked about getting Glassfish and MSSQL connected. By doing this, we effectively hand over the management of the our database connection to the application container. One less thing to deal with in code.

Now, we try to get some data and see if it works. I decided to try out JDBC first. I could just jump to Hibernate but remember Hibernate just glosses over the details. If JDBC works then I know that Hibernate will work. So my code started as:
        ....
        try{
            InitialContext ctx = new InitialContext();
            DataSource ds = (DataSource)ctx.lookup("MSSQL2008");
            
            Connection conn = ds.getConnection();
            Statement stmt = conn.createStatement();
            
            ResultSet rs = stmt.executeQuery("SELECT * FROM [TestDB].[dbo].[Users]");
            String temp = rs.getString("email");
            
            stmt.close();
            conn.close();
           
            return temp;
        }catch(Exception e){
            e.printStackTrace();
        }
That didn't go off without errors. I got a "SQLServerException: The result set has no current row." error. Apparently, the Microsoft JDBC driver I was using didn't move the cursor to the first row of the result set. Feature or bug?
To fix this we forcibly move the cursor to the first row by adding the line: rs.absolute(1).
The code then will look like:

        ....
        try{
            InitialContext ctx = new InitialContext();
            DataSource ds = (DataSource)ctx.lookup("MSSQL2008");
            
            Connection conn = ds.getConnection();
            Statement stmt = conn.createStatement();
            
            ResultSet rs = stmt.executeQuery("SELECT * FROM [TestDB].[dbo].[Users]");
            rs.absolute(1);
            String temp = rs.getString("email");
            
            stmt.close();
            conn.close();
           
            return temp;
            
        }catch(Exception e){
            e.printStackTrace();
        }
Save, compile and redeploy and.....another error. Typical. This time the error I got was: SQLServerException: The requested operation is not supported on forward only result sets. Can you get what's the error? So we need to NOT create a forward only result set. This is done by adding the line: createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY). 
The final code is then:
        ....
        try{
            InitialContext ctx = new InitialContext();
            DataSource ds = (DataSource)ctx.lookup("MSSQL2008");
            
            Connection conn = ds.getConnection();
            Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
            
            ResultSet rs = stmt.executeQuery("SELECT * FROM [TestDB].[dbo].[Users]");
            rs.absolute(1);
            String temp = rs.getString("email");
            
            stmt.close();
            conn.close();
           
            return temp;
            
        }catch(Exception e){
            e.printStackTrace();
        }
All should be OK now. Now to do some real damage. *evil grin*