Skip to content


Prints not moving from queue

Had an issue where prints from the printer remained in the queue even when the prints were completed. This wouldn’t allow printing any other document. Solution which worked for me:

Turn off the Print Spooler in Services under Administrative Tools.
You can then use Windows Explorer to go to System32\Spool\Printers to delete the offending jobs. Stopping the Print Spooler service will also turn off the Fax Service, so turn it back on after starting the Print Spooler again.


Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon

Posted in Misc.

java and jdbc date and time

Stumbled upon the news today that jsr 310 http://jcp.org/en/jsr/detail?id=310 is looking to re-model the date and the time issues finally!

This video also mentions that they are looking to resolve the jdbc timestamp issues as well ! Trying to find their proposal on jcp, but no success yet.


Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon

Posted in Techie. Tagged with , .

Android Developers Blog: Game Development for Android: A Quick Primer

Android Developers Blog: Game Development for Android: A Quick Primer.


Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon

Posted in Android. Tagged with .

Google Confirms Froyo Launch: “The roll out to Nexus One devices has begun!”

Google Confirms Froyo Launch: “The roll out to Nexus One devices has begun!”.

How do I get it for my HTC desire? I won’t – till it comes officially – or atleast the platform is stable. There would be a bunch of apps that would definitely not work initially, and its probably prudent to wait a few weeks for glitches to get ironed out, if any.


Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon

Posted in Android. Tagged with , , , , .

Spring jdbc insert

Found a nice way to insert records using spring’s utilities classes for jdbc. ( obviously not required if using some ORM such as hibernate)

Standard way of insert:

String sql = "insert into Emp values (?, ?)";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setInt(1, 10);
ps.setString(2, "some name");
ps.execute();

Here, I need to know what type the column is, call setInt if the column is of int type, setString if it is string, and so on.
Plus, I also need to know the ordering of the columns, so if I have to alter the table, the numbers in the above setters could change as well.

If we want to make this insertion code generic enough so that it could be used by all components looking to insert something to any table, we would need to pass in the table name, the column names, and the values we want to set for those columns:


void insertData(String tableName, Map valuesData);

Map above would have the key as column name, and value as the value we want to set on those columns.

Spring lets us to do exactly that:

public void insertData(String tableName, Map valuesData) {
insertActor =
new SimpleJdbcInsert(dataSource).withTableName(tableName);

insertActor.execute(valuesData);
}

This cute little code above looks into the meta data of the table, and does all the dirty mapping stuff behind the scenes, making this very re-usable.


Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon

Posted in Techie. Tagged with , , , , , .

WordPress SEO The Definitive Guide To Higher Rankings For Your Blog « Black & White Notes

WordPress SEO The Definitive Guide To Higher Rankings For Your Blog « Black & White Notes.


Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon

Posted in Wordpress. Tagged with , , .

Inheritance and composition

One of the most common design decisions is to choose between inheritance and composition.
Inheritance at a very basic level is:

interface (or abstract) Blog {
  createTheme();
  addPlugins();
}

class MyBlog implements (or extends) Blog {//provide implementations for the methods...}

Composition on the other hand is:

class Theme { theme's attributes }

class Plugin { plugin's attributes }

class MyBlog {
  Theme myTheme;
  Plugin myPlugin;
}

Taking a look again at above, it should help suggest the point of this blog: favour composition over inheritance. Inheritance related code can very quickly get brittle, any new feature needs to be propagated everywhere, and there would always be some new feature which would want to break away from the inheritance rules but would be retrofitted somehow, affecting readability, and suggesting an unnatural flow.

Composition leads to cleaner separation of components, and most of these components can be as generic or as specific as one wants to be. There are no tight rules to follow, and the code is clearly readable and understandable.


Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon

Posted in Techie. Tagged with , , , .