Roy's Blog

On Software and Fish.

Hiring Software Developers… You’re Doing It All Wrong.

| Comments

Short blog post on some of the most common mistakes I’ve experienced with the recruiting and hiring of top talent engineers. Although there are many articles written on how to attract and hire great talent, seldom is there word shared over the silly things companies do to shoot themselves in the foot during the hiring process.

“If you think it’s expensive hiring great engineers to build your software, wait and see how expensive it gets with bad engineers.”

Who should read this

If you’re looking to hire A Player Software Developers, this article is for you. If you’re looking for advice on hiring B players, on a C-Player budget, I wish you luck on the “Bozo Explosion” you’re about to embark on, but this article isn’t for you… Read this instead.

Moved to OctoPress

| Comments

I finally grew tired of having to maintain and costantly patch my Wordpress instance at my host server, and so I have completed the move to Octopress from Wordpress. Having my blog hosted by Github, right out of a git repo is a great convenience. A few changes to the DNS record and now royrusso.com points to the github pages repo. The only issues that are obvious, is that the migration of the Wordpress posts doesn’t pull in the images and galleries created in the old blog. Since this isn’t a picture-heavy blog, I chose to do without migrating them at all.

Note to MAC OS Mavericks users: When running any rake command, I find it necessary on boot to initialize my terminal with the proper ruby version that octopress recommends:

rvm install 1.9.3 && rvm use 1.9.3

I’m sure there’s a way to have this automagically, but for now, this suffices.

Debug Maven Test Goal With Intellij IDEA

| Comments

Making it possible to live-debug and add breakpoints to your code during a maven test goal in Intellij Idea, shouldn’t take more than a minute.

  1. Modify your pom to have the debug process fork:

  2. Next, configure your debug process. You reach that under Run > Edit Configuration and add a Remote debugger:

Maven debug remote intellij

  1. Once the above is configured, run the mvn test goal. It should pause, listening on port 5005…

  1. Now execute the remote debugger you configured earlier. It should attach on port 5005. If you don’t have any breakpoints, you should see the below. If you have breakpoints, obviously they will trigger…

ElasticHQ - ElasticSearch Monitoring & Management

| Comments

As a long-time user of ElasticSearch, I’m proud to announce a new project I’ve undertaken, ElasticHQ – an ElasticSearch Management and Monitoring solution that is 100% browser-based, ie. No software to install.

Those who know me, would note that this is a departure from my usual style of coding and architecture, but after studying the ElasticSearch Java API (mainly TransportClient), I decided it would spur mass adoption if the application was run on the client (browser). So using Backbone.js, Underscore.js, Twitter Bootstrap, and Flot charts, I managed to carve out a solid nucleus I can build upon.

Feel free to check it out here: ElasticHQ.org

For those that want to look at the code, you can find it on Github, under ElasticSearch-HQ. There is also a Google Group, although not advertised yet.

[gallery columns=“2” link=“file” ids=“227,228,229,230”]

JWatch - a Quartz Monitor

| Comments

I am proud to announce the release of JWatch v0.8 – An Open Source and Free Monitoring Application for the Quartz Job Scheduler. The browser-based user-interface allows developers to monitor multiple Quartz instances in real-time. In addition, a RESTful API is available for those wishing to extend the application.

Future releases will expand JWatch’s capabilities with the addition of management features, designed to make it easy for users to change Quartz Jobs and Triggers in real-time and monitor the changes.

Note: The current release of JWatch works with Quartz 2.0+. It will not work with previous versions of Quartz.

The current release of JWatch, includes the following features:

  • Monitor multiple Quartz Instances across multiple applications concurrently.

  • Monitor multiple Schedulers and Jobs per Quartz Instance.

  • Drill-down for more information in to Quartz Job and Trigger objects.

  • Real-Time monitoring of presently executing jobs.

  • RESTful JSON API for those wishing to extend the application.

  • Easy to deploy – just drop in a war and configure your instances.

  • It’s free! (LGPL)

  • Easy installation and configuration.

Screenshots:

[gallery link=“file” columns=“2”]

Links:

Terracotta Quartz Relational Model

| Comments

I’ve been working on an OSS project during my spare time which is deeply intertwined with Terracotta Quartz. Because of the nature of the project, I do not interface with Quartz through the standard API (no bundling), but am accessing it via JMX MBean. This is not an easy task, as there are large differences between Quartz 1.x and Quartz 2.x exposed methods and bundling Quartz in the project distro is not an option. Since I plan to support different versions of Quartz, it is left up to my adapters to figure out what version someone has installed and how it should access remote methods. Any guess to what I’m building? ;–)

One thing I was unable to find is how the important Quartz objects relate to each other. In the past, I’ve implemented Quartz in projects, but never really dug around at its internals. Even while implementing Quartz, I found I often ended up with a one-to-one relationship between the major components. Instance –> Schedule –> Group –> (many)Job.

But wouldn’t you know it – Quartz is a lot more flexible than that, allowing many-to-one relationships for several components. Here is a rather raw diagram of how all the pieces pay together. I didn’t do a very good job of showing the many-to-one relationships in the model, but you get the point.

Frankly, I would never have discovered this under normal use, and had to dig around with the JMX MBean to visualize this. It may be documented somewhere, but I couldn’t find it.

Quartz’ flexibility is great, but building a UI around this is going to be interesting. ;–)

Get All Jobs With Terracotta Quartz 2.0+

| Comments

The most recent Terracotta Quartz release seems to have changed some of the API methods to list scheduled jobs. Although minor changes, I thought I’d post sample code here for anyone trying the same thing as I, and hitting a wall with the API differences. Some of the changes are documented here in the latest release, but it’s OSS, so expect the docs to suck. ;–)

The changes, as best I can tell (correct me if I’m wrong), revolve around accessing the Scheduler object.You can see the differences between the 1.8 API and the 2.0 API.

Changes I found:

  • scheduler.getJobGroupNames() now returns a List , and not a String[].

  • scheduler.getJobNames(groupName); has dissapeared.

  • You must now use scheduler.getJobKeys(GroupMatcher.groupEquals(name)); to get a Set, which will be used to call scheduler.getJobDetail((JobKey)iter.next());

Sample Code

      try
      { 
         Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
         List jobGroups = scheduler.getJobGroupNames();
         for (int i = 0; i < jobGroups.size(); i++)
         {
            String name = (String) jobGroups.get(i);
            Set keys = scheduler.getJobKeys(GroupMatcher.groupEquals(name));
            Iterator iter = keys.iterator();
            while (iter.hasNext())
            {
               JobDetail jobDetail = scheduler.getJobDetail((JobKey)iter.next());
               JobDataMap jobDataMap = jobDetail.getJobDataMap();
               // do something
            }
         }
      }
      catch (SchedulerException se)
      {
         se.printStackTrace();
      }

I specially like the addition of scheduler.getJobKeys(GroupMatcher.groupEquals(name));, where GroupMatcher can take some crude expressions like groupContains(String compareTo) and groupStartsWith(String compareTo).

Mapping ISO Country Codes Alpha-2 to Alpha3

| Comments

A recent experiment with IMF, CIA, and World Bank datasets had me fighting to map ISO 3166 Alpha-3 codes to ISO 3166 Alpha-2 codes. The reason I had to perform the mappings, is because most downloaded flag icon libs on the web are based on Alpha-2 codes.

I have managed to map 183 countries in my local database, and am making the clean CSV available for download here.

The format is:

ISO ALPHA-2 Code , ISO ALPHA-3 Code
AF,AFG
AX,ALA
AL,ALB
DZ,DZA

OT: Calculating GDP Growth

| Comments

As I work on a new site, I hit a bit of a wall when trying to calculate GDP Growth Rate, given Quarterly GDP figures (in Billions $). I had a very hard time trying to find this through the almighty Google, and a lot of the formulas on the web, are either wrong or simply cover how GDP is calculated, which is not what I needed:

Y = C + I + E + G, where Y = GDP C = Consumer Spending I = Investment made by industry E = Excess of Exports over Imports G = Government Spending

So dusting off some old Economics books, the formula for calculating Annual GDP growth over two periods (usually measured in Quarters) is:

(((x(t)/x(t-1)) ^ (number_of_observations_per_year)) – 1) * 100

Where:

  • ‘x(t)’ is the value of GDP x at time period t.

  • ‘x(t-1)’ is the value of GDP x at time period t-1, or the previous Quarter.

  • ‘^’ means, to the power of.

  • ‘number_of_observations_per_year’ in this case would be 4.

So given values (in Billions $) for Q3 and Q4 2010, we have:

(((13370.10 / 13278.50)^ 4) -1 )* 100 = 2.8%

Now hopefully Google will lead the other 3 people in the world that are looking for this formula here. ;–)

Java and the Lean SaaS Startup

| Comments

I’ve had a lot of time on my hands lately. I’ve mostly spent it playing with fish tanks, but as of last week, I was all out of fish work and room for new tanks… so I started talking to a few Atlanta startups. I basically go in, they hammer me with questions and I do my best to not look stupid. After what I helped build at LoopFuse, you’d be hard pressed to find someone in this town that can build something that secure, scalable, fault-tolerant and damn intuitive to use! This isn’t San Francisco, and yes, that was an arrogant statement.

There are a few common challenges I see that keep popping-up in the Atlanta Java SaaS startup world. I’ll try my best to summarize what I think is the best-of-breed combination of SaaS startup technologies and hopefully arrive at a decent stack. These are common threads I keep seeing, and also tools that I used one of my many SaaS jobs or while I worked at JBoss.