Posted on August 25, 2007 in Software Development by Rob Di MarcoNo Comments »

Nowadays, I spend so much time online, that I have little time to do real reading.  But after missing my flight to Boston yesterday, I found myself with a few hours to burn and could actually put a dent in my backlog of Harvard Business Reviews that I had been meaning to get to for a while.  I wound up reading a great article, an excerpt from Management Challenges for the 21st Century by the late management guru Peter Drucker.  The thesis is that knowledge workers must take responsibility for their career path and act as their own personal CEO.  No one other than you is looking out for your career.  You will have a working life span of 40-50 years and it is up to you to make sure that you are both productive in and satisfied with your job.  If your expertise is Java today, it better not be your expertise in thirty years.  You had better adapt.

So how should a developer operate as a CEO?  What do they need to think about.  What questions do they need to have answered?  Let’s discuss a couple required characteristics of a good CEO and then apply them to your career path.

SIDENOTE: Often, when we think of career growth, we equate growth to earning more money or a getting a better title.  These may be evidence of growth, but are not requirements.  Career growth may also involve trying new technologies, changing roles, or changing industries.  It may mean getting out of technology

Taking Responsibility

You, and only you, are responsible for your career path.  Accept this.  It is not your boss’s job to get you trained on new technologies, it is your responsibility to make this happen.  Figure out what you would like to learn and then ask your boss to help you make it happen.  If you do not take responsibility for asking, it is very unlikely that you will get what you want.  Regardless of whether your employer will pay for your education, do it anyhow.  Learn a new language (programming or foreign).  Read books and then apply them to your work.  Go to an interesting conference.  While it is definitely preferred for your boss to play a part in what languages you learn or what books you read, it is your responsibility not your boss’s to make it happen.

Determine Strengths

What are you good at doing?  Drucker posits that the only way to figure this out is by using feedback analysis.  He suggests that after every key decision or action that you make, write down what you expect the result to be and then review it in 9 to 12 months.  See if there are patterns between where you anticipated the results and where you did not.  From this feedback, figure out what you are good at and what you need to improve.  In addition, you may see things that you have no business doing.  For example, software developers often make atrocious project managers.  For some, this may because they lack training in the area; for others it may be that they lack the ability to develop an effective plan.  By looking at how you have done, you can see if consistent lack of planning is a problem and try to figure out if you can improve it or if you need others to help you with it.

In addition, look at how you operate outside of just writing code.  Take the opportunity to learn about things that extend outside your area of expertise.  Read books on marketing principles, go out on sales calls, take a basic class on accounting.  Improving yourself in non-technical areas will help you better understand demands on your co-workers and you may find that you have strengths in areas you never anticipated.

Know Your Core Values

Core values are the things that you feel are truly important to you; they are different than ethics.  Ethics relates to doing what is right.  Values relate to doing what you believe in.  For example, one of my key values is that I feel you should only hire the very best technical resources, that these resources should have problems explained to them and then should be empowered to make decisions as to how to best solve the problems.  The corporation I was working for decided to take a different philosophy where the business users were more responsible for deciding how to solve the problem.  That may be the right decision for the organization, but it violated my personal values.  Other examples of value decisions a company will need to make may include:

  • The level of R&D investment to make
  • Use and contribution to open source software
  • Whether people should be compensated by stock options or by cash
  • What accounting rules to use to recognize revenue
  • Support for telecommuting

Just because you may disagree with a company’s values does not mean it is a “bad” company.  But trying to stay in an organization that has values that conflict with your values will only lead to frustration.

Planning for the Future

Take some time to think about what you where you want to be in five years.  Figure out what skills and experiences you will need to achieve this goal.  Write down what it will take and review the list regularly.  Another great suggestion that Drucker has is to have a hobby.  You never know if that hobby will lead to a second career.  After twenty years working with technology, you may lose your passion and you may be prefer a change in career direction.  By encouraging other interests, you may find that your desired career path is no longer in technology but is in another area

Popularity: 6% [?]

Posted on August 21, 2007 in Uncategorized by Rob Di Marco1 Comment »

A recent blog post let’s the world know that the Java Kernel will be a part of JDK 6 Update 4.  There is not a lot of information around what this means outside of Ethan Nicholas’s blog entry in May and some of his earlier posts describing the intent project and the official announcement about the project.  Seems like a cool idea to shrink the default download size of the JRE, but it is hard to understand the impact of this.

This really irritates the hell out of me.  How can there not be an easy to find example and demonstration of this functionality?  Maybe I am just blind, but I could not find anything from Ethan’s blog pages or by searching Google where I could see examples and understand how the implementation works.  Will there be tight coupling with JavaFX?  How significantly will it reduce start up times.  Is this really such a minor feature it should be released in a JDK update rather than JDK 7?  This announcement seems to create more questions than it answers.

Some other discussion pages:

Popularity: 19% [?]

Posted on August 20, 2007 in Software Development by Rob Di Marco1 Comment »

For the past few days, I have been doing a little work with embedded JavaScript within the HtmlUnit project.  HtmlUnit is a really cool project that is a headless web browser written in Java that is really useful if you are trying to do automated testing or web scraping and want to simulate how a real browser works.  One of the neat features is that it supports JavaScript execution within the HTML page so scripts that modify the DOM can be supported.  One site that I was trying to automate a script for uses the YUI JavaScript libraries and I was having some problems with HtmlUnit, so I volunteered to have a shot at trying to get all of the unit tests to pass.

The hardest part of the development has been trying to debug why the hell all of the scripts have been failing.  Most of the problems seem to fall into one or more of a few categories:

  • Hacks in the YUI libraries to deal with the fact that IE and Firefox both operate differently and NEITHER is fully compliant with the DOM specification.  That has made for lots of fun times.  I have found a certain irony that I am cursing the Yahoo developers for the hacks that they wrote while probably cursing
  • Bugs with the Rhino JavaScript libraries.  For example, I could not even start the YUI tests until I upgraded to 1.6R6.  Also, I think I found a subtle bug that is causing one of the unit tests to fail related to the for…in syntax, but it has been a bitch to reproduce.
  • No integrated debugging of the JavaScript code.  The only way I can diagnose what is really breaking is by liberal use of the alert() method and then a review of the output.  Hopefully this will change in Rhino 1.7.  Huge problem.
  • Unhelpful error messages.  For example, I was getting a NullPointerException being thrown from SOMEWHERE in a script, but the stack trace was lost when it was transformed to a ScriptException.  The only way I was able to debug the problem was to put a breakpoint on the constructor for NullPointerException and then look at the runtime stack when it was thrown, then grep through the Yahoo JavaScript to try to figure out where the problem could possibly be.

So if you ever having to work with the implementation

  • Make sure you are using a good IDE with a debugger.  I cannot stress this enough.  I have had to put breakpoints all over the damn place.  And integrate as much of the source code around as you can and integrate it with the debugger.
  • If you are using Java 6, I would STRONGLY RECOMMEND NOT USING THE DEFAULT SCRIPTING IMPLEMENTATIONS!!!  I have now worked with both the JRuby and JavaScript libraries.  It is way easier to upgrade versions of your libraries to work around bugs if you are using the standalone implementations rather than the versions built into the JVMs.  By the way, how much fun will it be when a later version of Java comes out with new scripting libraries that I am sure will not be 100% backwards compatible.
  • Take Mozilla, MSDN, and especially W3C reference documents with a grain of salt.  They may not fully describe the behavior that you are seeing in the browser.

Popularity: 23% [?]

Posted on August 20, 2007 in More Information by Rob Di MarcoNo Comments »

See, I’m on to something with this Innovation on the Run.  Just ran across a New York Times article on how exercise helps your brain.

Scientists have suspected for decades that exercise, particularly regular aerobic exercise, can affect the brain. But they could only speculate as to how. Now an expanding body of research shows that exercise can improve the performance of the brain by boosting memory and cognitive processing speed. Exercise can, in fact, create a stronger, faster brain.

I know that I work better when I am standing up and moving around.  And most of my creative ideas come to me when I am running, usually at a medium pace.  Too fast, and I cannot focus, too slow and I get bored.  But a run at a moderate pace really energizes and allows me to think of things in ways that I cannot think of while sitting still.

Of course the article comes with a big downer for me.

But something else happened as a result of all those workouts: blood flowed at a much higher volume to a part of the brain responsible for neurogenesis. Functional M.R.I.’s showed that a portion of each person’s hippocampus received almost twice the blood volume as it did before. Scientists suspect that the blood pumping into that part of the brain was helping to produce fresh neurons.

The hippocampus plays a large role in how mammals create and process memories; it also plays a role in cognition. If your hippocampus is damaged, you most likely have trouble learning facts and forming new memories. Age plays a factor, too. As you get older, your brain gets smaller, and one of the areas most prone to this shrinkage is the hippocampus. (This can start depressingly early, in your 30’s.)

Guess I should get all of my ideas out quickly before my hippocampus wastes away.

Popularity: 15% [?]

Posted on August 7, 2007 in Software Development by Rob Di Marco3 Comments »

One of the projects I am currently on is to create a Java based headless browser that I can easily control programmatically.  I have wanted this for a couple of reasons over the years, one for navigating websites when trying to scrape information and secondly for use in automated functional testing.  I love the Selenium IDE but I find that it is impossible to automate your Selenium scripts into an automated build because it requires an actual browser (e.g. Firefox, Internet Explorer, etc.) to be started and executed each time.  So I want a headless browser that will do navigation, manage the DOM model of the page, and execute JavaScript to handle AJAX calls.  (SIDENOTE:  I am planning on open sourcing this and am waiting for approval from SourceForge to move the code out there).

To support JavaScript, I wanted to just use the ScriptEngineManager found in Java 6 to execute JavaScript.  Well, one problem that I found is that it is a real pain to get at objects that have been created in an executed script.  Consider the following JavaScript example:

sample.js

var foo = ["a","b"];

To execute that in Java 6, you would do the following:

ScriptEngineManager sm = new ScriptEngineManager();
ScriptEngine e = sm.getEngineByExtension(”js”);

String script = readFromFile(”sample.js”);

e.eval(script);

OK, so far so good.  Now let’s say you want to retrieve the value of foo from the ScriptEngine environment and iterate over the values.  The ScriptEngine class has a get method, however, this returns an Object of type sun.org.mozilla.javascript.internal.NativeArray, not a Java Array.  So to access values, you will need to cast the Object to a NativeArray.  Then, as you iterate the array, you might have to cast each value to a NativeObject as the get method on NativeArray only returns an object.

NativeArray a = (sun.org.mozilla.javascript.internal.NativeArray)e.get(”foo”);

for (int i = 0; i < a.getLength(); i++) {

  System.out.println(a.get(i, a));

}

Now your code is relying on a Sun internal class and not a base JDK class.  The appropriate classes exist in the $JAVA_HOME/lib/rt.jar file.  Unfortunately, this jar file is NOT used by default when running javac.  So to get my code to compile, I had to use the rt.jar in my bootclasspath.  Since I am using Maven 2.0 as my build system, I had to add the following to the pom.xml where I am defining my compiler

<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <configuration>
        <source>1.6</source>
        <target>1.6</target>
        <compilerArguments>
          <verbose />
          <bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
        </compilerArguments>
  </configuration>
</plugin>

This put the rt.jar into the bootclasspath when building and allowed my code to compile.  What I had hoped would be a simple task turned out to be a real ordeal.

Using the sun.org.mozilla.javascript.internal classes is very, very ugly and has the added distraction that it is hard to build and will be hard to maintain.  I do not see a way around the problem and I have found other people having similar problems working with the scripting API.  If anyone has a better approach, I am all ears.

Popularity: 18% [?]

Next Page »