Forerunner 30x in Linux...

Posted on December 30, 2008

I’ve been ‘toying’ with using my Garmin Forerunner 30x training GPSes in Linux. I’d been having all kinds of problems getting gpsd to work with it. Neither my 301 or 305 units are “supported” by gpsd – but, there was plenty of posts floating in the Interstew that led me to believe it could be done.

The key ingredient was this dandy diddle:

$ sudo mount -t usbfs none /proc/bus/usb/ 

I accidentally found it in an Ubuntu forum and to my surprise I was quickly able to get gpsd working.

Now, on to the fun stuff – reading gpsd from Ruby. :-)

This Is Why I Love Open Source...

Posted on December 29, 2008
checking whether to support zlib... using included version
checking for libusb... checking for libusb-config... true
checking for usb_interrupt_read in -lusb... yes
checking for random stuff to make you feel better... failed


To protect the innocent I’ll keep the app protected…but, I just love the embedded humor. And to top it all off ”./configure” failed to find anything random to make me feel better. Geez.

Maven-License-Plugin, Nice but Still Maven...

Posted on December 12, 2008

Any time I have to figure out a new Maven I cringe with sour anticipation. This go ‘round is with the maven-license-plugin. All things considered my expectations were pretty low.

This is one of those good news/bad news stories.

The good news is that I was able to get the plugin integration into my Maven structure very quickly. The bad news is that it took me forever to get things going through all of my Modules correctly. In fact, one of the modules is a Grails project – which still isn’t getting its .gsp files checked. Figuring out the “exclusion” list is still a work in progress. But, here’s the deal. The element true doesn’t work through to modules.

So I ended up with something like this:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
<excludes>
    <exclude>**/pom.xml</exclude>
    <exclude>**/webtest/**</exclude>
    <exclude>**/web-app/**</exclude>
    <exclude>**/test/reports/**</exclude>
    <exclude>**/products/**</exclude>
    <exclude>**/plugins/**</exclude>
    <exclude>**/*.log</exclude>
    <exclude>**/*.jar</exclude>
    <exclude>**/*.properties</exclude>
    <exclude>**/*.dtd</exclude>
    <exclude>**/*.tld</exclude>
    <exclude>**/*.txt</exclude>
    <exclude>**/*.gif</exclude>
    <exclude>**/*.png</exclude>
    <exclude>**/target/**</exclude>
    <exclude>**/*.class</exclude>
</excludes>

And according to the docs this:

  1
  2
  3
  4
  5
<mapping>
    <kml>XML_STYLE</kml>
    <gsp>XML_STYLE</gsp>
    <launch>XML_STYLE</launch>
</mapping>

Should provide the added file extension handling needed for my Grails project. No va. Well, actually it worked once…in typical Maven fashion.

Ok, enough of the negativity. The plugin is awesome. It has the ability to specify a different header for each module, and maps many different comment styles to different language/texts. Just be sure to not use a header that is already commented out. ;) As soon as I resolve my issues I will update.

Just Finished...Masters of Software Engineering.

Posted on December 07, 2008

definitionofdone.JPG

Quite literally I just submitted my team’s final project deliverables, putting the final touch on a long and arduous process. Time to celebrate…or just do nothing for a bit. The Wii awaits!

ROI

Now, to determine if it really was worth it. I don’t suspect I’ll be able to understand the real value, in terms of productivity, or position within an organization. I believe, more than anything, the act of trudging through something to the end is more enduring than any one course, project, paper, or task. So, if nothing else I HAVE finished. I feel like I now have earned my right to just work.

Though, the financial ROI may not reveal itself for sometime. Between loans, and a stale employment progression path – I’m not to excited about the near-term. But, as Lyndon B. Johnson stated: Education is an opportunity. So, then if I follow Seneca’s famous equation all I need is to be prepared and I’ll will arrive at Luck.

Still Not Prepared

For those that may be familiar with my opinion of current CS programs will know that I have a belief that graduates are ill-prepared (at the fault of academia) for the working world as a software engineer. I am now also of the belief that traditionally trained project managers are ill-prepared to lead software engineering projects. I am most definitely not saying the those graduating from Masters of Software Engineering projects are guaranteed success – just that it is more probable. I would also assert that a software developer without formal software engineering training/education will not make a suitable software engineering manager (though I’m not precluding that I have/will). I’m still missing a few pieces, but am in hot pursuit of those. ;)

I have no idea who originally said it but the old adage “failing to prepare, is preparing to fail” rings very true to me. So, I shall do everything I can to provide the preparedness to Seneca.

Academic Downturn

Right in the middle of my academic work, my university pulled the plug on the Masters of Software Engineering program. Obviously, they were not able to support the program with quality students or teachers/professors. Other unis like CMU are light-years ahead in terms of both students and faculty. But, if this uni can maintain one??? It is not my intent to dog my peers (for they are working professionals like me, employed at places like Microsoft, EA, Lockheed Martin, etc.). There simply were too few quality (software engineering skilled) backgrounds to provide value across the board (multi-directional). A real program would’ve weeded out the weak – potentially saving the program, by exclusiveness. But, too late for that. The solution was to simply make the once program a track under an IS/IT program. I’m not sure why this makes sense. But, if CMU does it – then it must include logic somewhere.

It is hard for me to swallow a downturn. It really is just an issue of quality losing to quantity. As more become unemployed I can only imagine that this will get worse. But, then maybe all of those that turned to IT in the late 90’s to cash in on the .com rollercoaster will finally get the deserved boot. No different than the automotive industrial self-inflicted crisis we must endure – so be it that we have to watch the fat get chucked from our IT organizations. Unfortunately, much of this fat will just blame those who’d been carrying them anyway – and turn to re-education. Again the academic dowturn will be one of quality not, quantity.

It is Worth It!

Anyway…I’d offer those that actually read this, the encouragement to pursue a Masters degree. And, even more so in times bordering on desperation (in terms of employment). Differentiation is important…and not from a networking perspective. It is a social learning activity – and counters the “it isn’t what you know, but who you know” principle. Who you know will get you work, what you know will keep you employed. Lastly, what you know is highly dependent on continued learning. A Masters degree is but one way to continue learning; a very creditable method. I applaud my peers for sticking with me, tolerating my “Agilizing”, and putting in the effort. Congratulations to you all too!

Back to Ruby, MacOS X Upgrade...

Posted on December 06, 2008

Well…it has been a while since I’ve had a chance to do anything with Ruby, which sucked. I’d figured I start with upgrading Ruby itself since the version I’ve installed (default) is 1.8.6. But, since 1.8.7 is the current (all the dev must be going into 1.9+) I figured updating RubyGems and all of my gems would be the best place to start.

I instantly hit a wall with ‘gem update—system’ or even ‘gem update’.

But thanks to the Internet and people hitting this problem many months back I found solutions:

Merbivore was killing me first, solution found here

Then, I ran into an issue with an older version of RubyGems itself. Found a decent blog here describing the steps to resolve – upgrading RubyGems to 1.3.1.

Phew…I’d have hated to have had to figure it out myself. On to playing with RSS feed parsing.

From OSGi back to Grails...

Posted on December 04, 2008

One of the interesting architecture/design issues we’ve had to overcome in building our OSGi -powered Grails web-app was how to get from OSGi bundles to GORM’s domain models. At the risks associated with toying in relatively uncharted waters we avoided the Hibernate/GORM combo in the OSGI side. Initially we just made basic SQL queries to perform CRUD actions on the tables. Obviously this isn’t remotely optimal (db changes, no hibernate events, etc.). So the next logical step was to have the OSGi bundles communication straight to the already built REST interfaces for the web-app. This gives us fairly good decoupling, and the ability to work against the builtin validations and events provided by GORM.

Knowing that we needed a basic HTTP layer from within the OSGi bundles I needed a library (surprisingly there’s really know REST-abstraction lib either). Found that the lastest and greatest Http Components project at Apache builds out OSGi bundles. They are still beta or SNAPSHOT material but I’m pretty confident the functionality I need is solid.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
...
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.http.HttpEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.HttpClient;
import org.apache.http.StatusLine;
import org.apache.http.HttpResponse;
import org.apache.http.conn.HttpHostConnectException;
...

public Boolean writeView(String subViewName, String data, String viewId, String restInf) {

    try {
        HttpClient client = new DefaultHttpClient();

        // restInf is the Grails app URL provided into this class, view the resource.
        HttpPost post = new HttpPost(restInf + "/view/" + viewId);

        // load up the data into the parameters
        List <NameValuePair> nvps = new ArrayList <NameValuePair>();
        nvps.add(new BasicNameValuePair("data", data));
        post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));

        // execute - the REST request
        HttpResponse response = client.execute(post);
        if (response.getStatusLine().getStatusCode() == 200) {
            return true;
        } else {
            return false;
        }
    } catch (HttpHostConnectException e) {
        return false;
    } catch (Exception e) {
        e.printStackTrace();
        return false;
    } 

}

Not too bad. Have similar operations for Update and Delete too. Be forewarned we did have trouble using HttpPut (PUT) methods to perform Update actions. One of the application servers (OAS) we must deploy too simply couldn’t handle it – and had to revert to using POST.

Now we can use the Hibernate events to perform model functionality from both the external and internal interfaces. Much better. Getting the OSGi bundles to build with HTTPComponents was a simple add to our Maven pom.xml and setting the requisite “import” for the each bundle.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
<dependency>
  <groupId>org.apache.httpcomponents</groupId>
  <artifactId>httpclient</artifactId>
  <version>4.0-beta1</version>
</dependency>
<dependency>
  <groupId>org.apache.httpcomponents</groupId>
  <artifactId>httpcore-osgi</artifactId>
  <version>4.0-beta3</version>
</dependency>