windows vista shadowstorage

April 29, 2010 Comments off

I did a recovery on my laptop running vista, and after that had my partitions split from my c: to several other drives. After a few days, the free space on my c: reduced drastically, even though i did not install any software or store any huge files. And doing a “Properties” on the folders would show only a lesser amount of space, but the drive shows only 8GB free out of 150GB. Not sure of whats going and googling around for a while, found this command to cleanup all the used space.
“vssadmin list shadowstorage” – will show how much space will be used up for shadowstorage, and it was showing 98GB in my laptop.
“vssadmin resize shadowstorage /on=C: /for=C: /MaxSize=500MB”, would reduce the size taken in the disk for shadowstorage. After restarting windows, all the free space was reclaimed. A simple setting but most of my friends suggested it was a bug with vista.

Categories: random Tags: , ,

Accessing private members outside a Java class…

March 18, 2010 Comments off

In a discussion with my colleague, who was bored of writing getter and setter methods for member variables in a Java class, was wondering if there is way to access a private variable or a method of a class outside its scope in a different class. In C++ world, this is quite very much possible using friend classes or probably accessing the address of the object to the class…

In the Java world as well, this is a long existing feature since the introduction of the reflection APIs. A sample code below illustrates how it can be done simply:

A TestObject that has a private member without any public getter and setter methods.

package one;

public class TestObject {
    private String testStr = "Hello World!";
}

An AccessTest class that reads the value of testStr private member using an object of TestObject class.

package two;

import java.lang.reflect.Field;

import one.TestObject;

public class AccessTest {

    public static void main(String[] args) {
        try {
            Class tObjClass = Class.forName("one.TestObject");
            Field tField = tObjClass.getDeclaredField("testStr");
            tField.setAccessible(true);
            System.out.println("TestStr Value: "+tField.get(new TestObject()));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Using the java.lang.reflect APIs any private member or method of a class can be accessed from anywhere. One way to prevent this access is to run the program using a security manager as below:

java –Djava.security.manager AccessTest

would give the below exception:

access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)

This feature is quite useful in unit testing when there is a need to test the private methods using a test suite.

Categories: tech Tags: , ,

Weekend @ Houston

March 16, 2010 Comments off

Almost for 6 months, all my weekends have been just movies and shopping. Putting together a quick plan to get away from Dallas and spend a weekend sounds better and easier than coding Java. With most of the folks here new to Dallas, everyone were anxious to go on a trip. So Parthi and family, Mugunth, Kishore, Senthil readily accepted the invitation to join the trip. Most of them being first timers to long trips, made the group more bubbling with excitement. Mugunth and myself made the initial arrangements, renting a car, booking the tickets to the attractions at Houston (nothing but just NASA), and most important of all buying the snacks from the Indian store. Even though we planned to leave Dallas by 4AM on Saturday, as usual we started late by more than an hour. With some devotional songs filling the air, Mugunth finally drove us out of Dallas.  03132010032

As the CDs kept changing, “hasile fisile en raasamani” continued by interesting-totally-waste-of-time discussions on movies, heroes and all the comedies. Almost an hour passed by, it was about sunrise after 6AM, and our veteran was in full form with his goggles on… Soon, Senthil, the youngest of all (Kutti – we call him), raised his interest to drive on the highway for the first time. We agreed to let him drive if he would stop his dry poor jokes. After coffee @ Starbucks, continued by breakfast @ BK, Kishore and then Parthi drove, and by the time we reached Houston it was half past 11AM, but Kutti never drove, as he never stopped his PJs in the entire trip.

DSC04996

Meenakshi Amman Temple, one of the biggest temples in US, I would say, is one of the most peaceful too. After praying to Goddess Meenakshi, Lord Sundareswara and Lord Vishnu for “World Peace” and our own prosperity, we went around the temple more than once to find if any “unda katti” is being served. With a camera in everyone’s hand, there was no one to pose for pictures, :)  finally a casual shot from Ramya…who was very happy clicking the Sony cam in whichever angle she could, after I abandoned it since my E72. I did not even care if she was taking a photo, being busy with my phone processing all the photos I took proudly with…Kutti was as usual in his own feelings, no one knows what it is…Parthi and wife were the only ones who seemed to be giving a pose…and no comments on what Mugunth and Kishore were trying to do :)   As the noon sun was bright up on the sky, we started moving towards Pongal and Puliyodharai. With a nominal priced canteen at the temple, we ordered each and everything on the menu and decided to share. Eventually we went for second serving on most of the items. DSC05030

Our next destination was the Space Center, NASA. It was 10 miles away from the temple, and we reached there in about 15 minutes. As soon as we entered the space center, cameras started taking shots of anything and everything that met the eyes. After watching a short movie followed by a run through the exhibits of a space station, highly impressed, Ramya and I decided to buy a plane for ourselves instead of our favorite yellow Corvette… ;)

More than the short movie, the space center had quite a number of exhibits and simulation games, which was worth learning and watching. I was expecting a EPCOT kind of space simulation ride, but that is way too much of an expectation for the ten bucks ticket cost. Only after the trip, talking to my uncle I came to know that NASA has exhibited the famous quotes of  “ஔவையார்”  (Auvaiyar)

“கற்றது கை மண் அளவு, கல்லாதது உலகளவு”

“What you have learnt is a mere handful, What you haven’t is like the world in its size”

which I never came across in this space center.

Next was the tram tour to the “Rocket Park” and “Mission Control Center”. The Mission Control Center, the way it looks, is more like my old Unix lab at college, ignoring what is being done at both places…then the Rocket park, reminded me of my visit to RCI, Hyderabad…watching a real Saturn V, was worth missing two return trams to the space center. It was time to try out the panorama mode on my phone camera, and I guess its not too bad for a mobile cam.

03132010087

So that was all at Space Center, it was almost sunset, and Galveston Beach was 45 minutes away from NASA. Though it would be dark when we reach there, we still drove all the way. With nothing to see at the beach, we returned immediately. With several options for dinner…seeing Olive Garden crowded to the streets, we finally ended up grabbing several of those “5$ foot longs” from Subway, and headed our way back to Dallas.

Shutter Island

March 10, 2010 Comments off

Martin Scorsese’s main stream film starring Leonardo DiCaprio for the fourth consecutive time, Shutter Island, is based on the novel by Dennis Lehane. The story line is quite usual repeated in many movies of a psycho, killer, dual personality, etc. etc. But the movie is still a classic, portrays the experience of Martin Scorsese as a director. Leonardo has once again given a dramatic performance as in Blood Diamond and The Departed.

image

The movie is set in 1954, in an island hospital treating insane criminals. The story starts with  Edward (TEDDY) Daniels (Leonardo DiCaprio) from US Marshalls along with Chuck Aule (Mark Ruffalo), deputed for an investigation of a missing person in the hospital. With lot of resistance from the hospital chief Dr.Cawley (Ben Kingsley) to cooperate, Teddy takes the help of Chuck to explore the island and sets out in finding the truth.  In his attempt to reach the lighthouse, meets Rachel Solando the missing person, which unfolds the entire mystery about the island and Teddy decides to get away from the island.  When his accomplice Chuck goes missing, Teddy goes to lighthouse in search of Chuck. He does find Dr.Cawley and Chuck in the lighthouse.  What happens after that is the movie all about…

The movie ends with a question to the audience…

“Do you think it would be worse to live as a monster or die as a good man?”

Yet another classic from Martin Scorsese, depicting the concepts of guilt and redemption. Must watch! Definitely a nominee for Academy Awards!!!

Categories: random

Oracle TimesTen

March 4, 2010 Comments off

Database operations have always been expensive for any high volume application. There have been several techniques to cache data either during application deployment or application activation. Several cache loading mechanisms offer efficient algorithms for replacement policies as well.

The problem I would like to discuss here is a little different. An existing application probably with no thoughts of scalability has been designed and implemented without any caching mechanism. As a stable application, it works for low volume of data, but fails when the data volume exponentially increases. There is a need to plug-in a caching implementation somewhere to handle the suddenly increasing load. The complication comes when the caching mechanism has to connect to a database and sync up data very frequently and the application is deployed across multiple servers distributed. This requirement probably needs a design / code change in most of the situations. Most of the caching software that I came across so far does need a application design change at some point. Some of them do not support ANSI SQL or the Oracle standard.

On the other hand, application development and testing environments can afford mostly up to one or two database instances for several developers working simultaneously. It is not very uncommon that applications store all the configuration data in database tables and the configuration does differ for each environment. One thought would be to have a switch, to change between configurations in a db for functional testing and in a xml file for local / unit testing. But there definitely is a more effective solution to this.

TimesTen is a lightweight in-memory database and also provides caching with Oracle Database (only Oracle). TimesTen is simple to configure as a separate footprint. Does not involve the complexity of creating database, table space, etc. It could be easily connected to any Oracle database remote or local, with some few steps configurations. Not only that, from an application perspective, just a change in the data source configurations were required to enable caching.

In Windows, it took me exactly 10 minutes to configure TimesTen for my Weblogic Application server (more application servers are supported). Initial configuration needs a “System DSN” to be created from the Control Panel. The first time connect to the DSN using “ttisql” command line interface, a database gets created automatically. All the usual SQL commands can be then used to create users, tables, etc.

To connect with an Oracle DB and enable caching, just create a table space and a user in the Oracle DB for TimesTen to store its cache grids. And then its all configuration on the TimesTen database to create dynamic cache loading and performance tuning. I am not getting into any details, better to refer the extensive timesten docs.

Of course this solution for caching is very much limited to Oracle DB but is an ideal solution when an application code change is not viable. For the latter problem, this is one of the fitting solution, where each developer can have a separate instance of TimesTen and sync up with the remote oracle db whenever needed.

Categories: tech

Nokia E72

Nokia E72 – its been a week I bought it.

I have read several reviews of this phone, and most people have been comparing this with iPhone. Apples and Oranges are not same. Clearly this is a phone for business segment, and it does its job really well. Having said that, I must explain why.

A quick glance at its specifications would say most of what it can do. With a 16 million color display and 2.4 inch screen, a good enough resolution to watch a video on YouTube. Symbian S60 3rd Edition running on an ARMS 600Mhz with 128MB RAM and 4GB microSD extension, fast enough to run email, chat and other software. 5MP camera with a powerful flash, can take clear pictures even in low light. The keypad does invite one to type more, adding to it the optical navi key is certainly a smooth way to scroll through the items. The battery is a strong 1500mAh Li-ion and holds for a solid 2 days being connected to mobile internet or Wi-Fi as well as GPS when driving. With such a high end spec better than a Blackberry Bold and its thinner than iPhone, a price tag reading 300 USD is worth the buy.

DSC04951 

The basic email and chat applications support Mail for Exchange, Lotus Notes, Google and Yahoo. The phone comes with Office 2007 editor from Quick Office package. It also has a VPN client, printer setup and multi-scanner (card reader software). If you need even more, Nokia Ovi does not let you down with a huge collection of apps to download. The Ovi maps are definitely a plus, with maps downloadable for most of the countries free. Fring and Nimbuzz are supported very well.

More than all this, the phone has a much better camera (5MP) unusual in a business phone, all the music software (MP3, FM, Recorder) and a good number of games.

A get-used-to factor which I count as negative in a way is the applications are installed all over the place. It really is difficult to remember and access them quickly whenever I need them. There definitely is a way to re-group the applications to where I need those, yet to figure out.

To conclude, this phone has certainly re-defined how a business phone should be. Definitely a competitor for all the RIM’s out there.

Categories: reviews

Sonar and Continuous Integration

July 29, 2009 Comments off

My previous blog was about Sonar – the open source code quality management tool. Deploying Sonar in a machine, and then running it manually for every code change is not desirable for many of us. Definitely there must be an automation step possible, to run Sonar whenever there is a change in the code base. It would be really wonderful if a nightly build or a weekly build software can trigger Sonar, and just publish reports about the violations in the code changes recently done. I never expected it be more easier than integrating Hudson with Sonar. Hudson is a widely used continuous integration tool, that works with any kind of version control software like CVS, VSS, SVN, Clear Case, etc.

Hudson is another web based tool where various types of projects can be scheduled to build in any specific interval. Hudson supports projects with Maven, Ant and those do not have any build script as well. It is quite simple to setup Hudson, just download Hudson and start using the command: java –jar hudson.war.

Before configuring a project, install the Sonar plug-in for Hudson from Dashboard –> Manage Hudson –> Manage Plugins –> Available plug-in list. Hudson must be restarted for the plug-in to be applied.

To setup a project in Hudson, create a New Job from the dashboard. Provide a job name and select what type of project needs to be created.

HudsonNewJob

The next page shows up is the job configuration. There are several options that can be configured, from source code management software, build triggers, build settings and post build actions. The post build actions feature Sonar which must be enabled for Sonar to run automatically after the build is complete. Sonar configurations can also be changed appropriately.

Job Configuration

PostBuildActions

There is a little manual configuration that needs to be done here. The maven project configuration in Hudson does not allow you to specify an absolute path for the pom.xml to be used to build the project. When the project configuration is saved, a workspace directory is created. The pom.xml file used for the project build must be manually copied to the workspace directory for Hudson to perform the build. I wished there is a configuration to specify the pom.xml from any directory. Unfortunately no! Once all the configurations are done, its time to build the project.

From the Hudson dashboard, click on the project name and then do a Build Now, and the project build starts. A progress bar is shown when the build is in progress. Once build is successful, the build history is updated with the build results.

HudsonBuildJob

Now the Sonar dashboard can be accessed to view the updated reports. Sonar over-writes the reports that were generated earlier for the same project. So, to compare results of build history, the version in pom.xml must be changed every time manually before the build.

SonarReportsComparison

The integration between Sonar and Hudson has been very simple and without much manual work. But still more exploration is needed to find out how Sonar can show incremental differences in the violations rather than over-writing the entire report.

With a whole lot of plug-ins and ease of use Sonar, Hudson & Maven can provide a complete build process solution for any organization.

Sonar – Open Source Static Code Analyzer

One of the major challenges in today’s software development lifecycle is effective review and testing of software. There are many ways to perform code reviews and walkthroughs, which depend on the reviewer’s efficiency and experience. It involves lot of manual effort to go through the code line by line, review and analyze the code and find defects.

As far as Java is concerned, there are several code review and standard check open source tools that are being used nowadays. The most predominant are Check Style, Find Bugs, PMD. All these tools are very efficient in their own way. There are eclipse plug-ins for these tools, and can be used during the coding phase to avoid standard errors. They help in finding most of the standard and style errors, during development.

All these tools define rules to check the code for various standard and style violations. The developer can either choose to fix all the violations or can also ignore them. Some of them may not be mandatory to be fixed, and some may cause a serious issue during testing as well as when the software goes live. Also collating the results and analysis from three different tools again involves manual effort. All these activities are error prone.

A better solution to overcome these drawbacks (not all of them) is Sonar. An open source code quality management software, combines the expertise of Check Style, Find Bugs and PMD as well as provides a graphical way of analyzing and reporting code quality. Even though there is no eclipse plug-in or any other graphical editor, setting up of Sonar is quite a cakewalk. Just install Sonar and Apache Maven along with JDK1.5 or above.

Sonar provides support for a whole bunch of platforms, AIX, Linux, HPUX, Mac, Solaris and Windows. Just by running the StartSonar command, the server starts up by creating the schema for the default embedded database, which is Derby. Sonar can also be configured for other database, by changing the conf\sonar.properties.

SonarServer

Once the server has started, the GUI would appear empty without any projects. The default login is admin / admin, for configurations to be changed. Before configuring a project, its better to configure the rules. The Sonar Profiles are by default defined with a lot of rules from Check Style, Find Bugs and PMD.

SonarProfiles

To configure a profile, copy a profile and provide a new name to the profile, then change the rules as necessary. The rules can be made Mandatory, Optional or Inactive. Once the rule levels are defined, then set the new profile to default profile to be used for the projects.

SonarRules

Setting up a project for analysis is also quite simple. If the project is already using maven, then after running the install goal on Maven, then run the mvn sonar:sonar goal from the same directory.

Non-Maven Projects need to create the pom.xml file in any directory. The contents of the file as below:

PomXml

Once the pom.xml is created, then run mvn sonar:sonar to start collecting data for the project. Once the project successfully built, the project will be available in the GUI, for analysis.

Screenshots:

ViolationsSummary        ViolationsDrilldown 

Certain features that could have been made available are the integration with an IDE to fix the problem found either automatically or with a ‘Fix Now’ button and also integration with a version control software for continuous integration and review. Leveraging the Maven APIs and Plug-ins for integration with version control software, the latter can also be achieved.

Overall Sonar is a very useful tool for code quality management. If Sonar can be enhanced with the above mentioned features there is no doubt that it will become a necessity for every developer as well as organizations.

Facebook and FIOS

I have always dreamt of browsing internet and watching movies at the same time. Using tv tuner cards on laptop, digital tv over internet one could watch TV as well as browse internet from PC or laptop. But bringing a different experience, Verizon FIOS, has launched a bazaar of widgets on their FIOS service. For those who do not know, FIOS is the Fiber Optic Service for TV and Internet provided by Verizon. A series of widgets for Weather, Traffic, News Headlines, Sports Headlines, Facebook, Twitter, etc. fill up the catalog. Though not all the features are available on Facebook and Twitter, friends list and photo albums can be viewed. The interface is quite cool and colorful. It also has a on-screen keyboard for typing information with the TV remote.

Screenshots:

DSC03402 DSC03405 

DSC03407 DSC03408

DSC03410

Technology:

So, coming to the technical part of it, how are these widgets programmed? Verizon uses an open source programming language called Lua. Lua is a C like programming language, and has APIs for GUI, HTTP Network, Keyboard event handlers and a lot more. With an eclipse plugin developing Lua applications is also much easier.

It is also expected that Verizon would soon public the open source SDK to third party developers for widget development.

And more widgets to come soon for video sharing sites like Veoh, blip.tv and DailyMotion.

More on Lua soon!

Categories: tech Tags: , ,

My New Lenovo

       When my old HP had power problems and went useless, my search for a new laptop began. I wanted to try something new other than HP and Dell. Sony, Lenovo, Apple, Acer, Toshiba…quite a few choices to pick from.

        I was concerned about a couple of things, the battery life and over heating. Mac and Sony were very appealing to look at, but totally out of my budget. Acer & Toshiba, am really not confident enough on the reviews I found on them. The list narrowed down to Lenovo.

        All I have seen in Lenovos are the T series, a lot of them at work, and I dont want to feel like office at home. Looking for something more stylish. What other options has Lenovo got? Found the S, Y and U series. I decided to go for the Y series. The Y x50 series was quite latest in the market, released in early 2009. There are a couple of models to choose from. I would have chosen the 550 or 650 if the keyboard layout was different. May be the Ins, ScrLk, Pause, NumLk keys could have been kept separated to fill the keyboard, it has lot of unused space left on either side of the keyboard and makes the laptop look huge.

        The Y450 looked perfect. With its black exterior and white interior, it looked different. But some of the reviews I came across, had mentioned problems about over heating. Little upset but after a lot of thinking back and forth, I decided to take the risk. I thought I could buy a cooling pad if required. Finally placed the order. Fast enough got it in a weeks time.

The Review:

DSC02830

        At first look, the Y450 is a sleek lightweight, with lot of features packed. The battery life is around 3.20 hours. As far as the over heating, may be after an hour, it gets little warm running on battery. But when connected to power, it gets real hot. Some approximate readings from CPUID:

Power – Processor: 123F, HDD: 115F.

Battery – Processor: 103F, HDD: 100F.

        The keyboard is excellent to type. The speakers are quite good without any distortion even in the highest volume.

        I have to write a separate section on the touchpad. The touchpad needs some getting-used-to for most people. The Synaptics device driver comes with a whole bunch of settings.

Touch Sensitivity: Controls the pressure you need to apply.

Palm Check: Controls the accidental tapping by your palm or thumb on the touch pad when typing.

Pinch: The zooming functionality for most applications. With default settings this might be little annoying, but with some palm check and touch sensitivity controls customized, this is a cool feature to have.

Tap Zones: Another cool thing to have, defines what each zone would do in the touch pad when tapped on. You dont have to scroll to the Start menu, rather, tap on the bottom left corner of your touchpad to bring it up.

        The inbuilt camera and the mic are too good. The clarity of the pictures over Yahoo Messenger are very clear and the mic picks up when I talk away from it as well. The VeriFace is a cool thing to have. The USB, Card reader, DVD drive are all excellent. They just do their job pretty well. The monitor is a clear bright wide screen, but the screen resolution is a little out of ratio. Its little too wide and shorter, makes you think it could be a 13 inch. The desktop navigator keys are of no use at all. I never tried the one touch recovery key as well.

        Overall its a great laptop to have except the odd ratio on the wide screen monitor. A good value for money if purchased under 650$ and the right laptop for home entertainment.

Categories: reviews