Monthly Archives: August 2012

Steve Yegge blog posts

I’ve recently been browsing some of Steve Yegge’s (lengthy) blog posts, something I’ve been meaning to do since I found out about him after his platforms rant. Here are a few that I found interesting.

Singleton Considered Stupid – when you use singletons, what you’re often actually doing is forgetting all about OO programming, and simply use classes as namespaces.

Google’s Secret Weapon – how Google was winning the smart people recruiting game back in 2004 (and probably still is).

Being the Averageist – why programmers don’t know how competent they are (we can’t measure it), why most don’t bother trying to improve (lack of incentive, or a company culture), and many other things.

Practicing Programming – how your day job isn’t real practice that’ll improve your skills, why you need to learn/practice, and what sort of practice you should do.

jps and other lesser known tools from the Java JDK bin

I recently needed to programmatically find out which java.exe was running which application. Simple on Linux using the output of the ps command, simple on Windows 7 with the tasklist command. But not so on Windows XP, where tasklist doesn’t provide the invoking command line string for each process. I could have used the WMIC tool, but I didn’t have this available.

So after a bit of Googling I came across the JVM Process Status Tool (jps) tool, which has just the output I need.

This led me to wonder what the other tools in the bin folder that I don’t use are, turns out they’re documented on this page – JDK Tools and Utilities. Quite a few of them are experimental, here are a few ones of general interest:

  • jdb – command line debugger
  • javap – class file disassembler
  • native2ascii – convert text to Unicode Latin-1 (useful for Resource Bundles in particular)
  • serialver – returns serialVersionUID of a class
  • keytool – key and certificate management
  • jstat – statistics monitoring for a JVM
  • jconsole – JMX compliant graphical monitoring tool
  • jvisualvm – JVM monitoring tool
  • jinfo – configuration info for a process/core file
  • jhat – heap dump browser (launches a web server so you can view it in your browser)
  • jmap – memory map for a process/core file
  • jsadebugd – “attaches to a Java process or core file and acts as a debug server”, seems would be useful if you needed to debug an application that wasn’t started in debug mode
  • jrunscript – command line script shell, using JavaScript by default (turns out this is Mozilla Rhino)

IE10 will drop support for conditional comments

IE10 will be dropping support for conditional comments. As stated in the post, feature and behaviour detection is preferable to browser detection – but with so many quirks in previous versions of IE, those aren’t often enough. So conditional comments to add classes to the html element for IE<10 will stay around for quite a while longer.

Useful Eclipse plugins

Following on from my note on FileSync, I thought I’d gather a list of useful plugins I use and have a look around for any new ones that are useful.

First, my usual ones:

  • Subclipse
  • eclipse-cs (Checkstyle)
  • PMD
  • FindBugs
  • Maven Integration for Eclipse WTP
  • Apache IvyDE

And ones I’ve recently tried out and found useful:

  • LogViewer – allows tailing of multiple log files, with coloured highlighting based on configured words and regular expressions
  • MoreUnit – allows quick creation of test classes, quick switching between a class and its test, amongst many other things
  • EclEmma – highlights code coverage of unit tests directly in the editor when you run the tests
  • Mousefeed – aids learning of keyboard shortcuts by displaying the corresponding shortcut when you perform an action using a mouse click