Running Lejos on RCX 2.0 and Mac OSX Snow Leopard
Mar 27th
Yesterday I purchased a Lego Mindstorms NXT 2.0 for my son.
It was ridiculously expensive. I had a focus on robotics in my BS program, so I was excited to build some robots with him. At the time, we used the Lego Robotics Invention System (now called RCX). I went onto craigslist and found one of these machines so that I could build robots with my son, but without the $300+ pricetag.
After procuring the machine, I spent some time trying to setup the development environment I had used back in college. Unfortunately, the C toolchain I had used was not available for Mac (at least, I couldn’t find a tutorial on setting it up.) I found an interesting firmware replacement at lejos.org that allows you to code your applications in java, using a custom library set.
Being a Java developer by day, this appealed to me quite a bit. So I set about the long process of trying to get lejos to work on my 64-bit Snow Leopard MBP… and failed miserably. There were compilation issues (conversion of 64-bit pointers to 32-bit handles in the code necessary to communicate with the IR tower (used to program the RCX).
Finally, I found http://lejos.sourceforge.net/forum/viewtopic.php?f=10&t=1673, and the link by tsinn where he’d setup an installer for the lejos subsystem and toolchain onto Mac OSX 10.5 (a 32-bit system). After downloading his system, then making a couple of tweaks, I was able to generate the following package: http://kennelbound.com/downloads/lejos3.zip
To use, simply do the following:
1) Download and extract the lejos3,zip to a local folder (such as /personal/lejos3)
2) Edit the lejos.env file and change the LEJOS_HOME to point to the directory where you extracted it.
3) Open a command console, and cd to the LEJOS_HOME directory
4) Type in “source lejos.env” (without the quotes)
5) cd to the LEJOS_HOME/bin directory
6) Install the firmware onto the RCX using “./firmdl” without the quotes
7) You should see some progress. Once it completes, you now have the RCX running lejos!
You can test it with a simple Hello World application:
1) cd to lejos3/examples/test/hworld
2) execute “lejosjc HelloWorld; lejos HelloWorld” without the quotes to compile and send the program to the RCX.
3) Once it’s done, on the RCX, press the “Run” button.
You should see “hello world” on the RCX’s LCD.
Next time, I’ll write down how I have Intellij setup so that I can run and load the applications with ease!
Tasty: Steak for Breakfast?
Mar 14th
I had a leftover pie crust, it was 8 am, and I was hungry.
Whatever is a boy to do?
Since we had leftover steak the night before, I decided to try and make a steak and cheese egg tart. I found various recipe’s online, and got to work.

First, you have to take the pie crust (either homemade or store bought) and cut it into fours. Then roll the sections into roughly circular sections. The directions then said to press the pie crust into the back of a muffin tin. What they meant to say, (and what you should do) is to put a muffin cup into the muffin tin, and then press the pie filling into the muffin cup, so that the pie crust is in the appropriate shape.
Unfortunately, I misunderstood the directions:

You may have noticed that I literally pressed it onto the back on the pie tin.

Here’s a close-up of that epic mistake. The nice thing about having it on the back of the pie tin, is that you end up with perfectly sized cups for the steak, egg, and cheese.

Another close-up of the crust (this is just before I realized my mistake – after baking at 400 degrees for about 8 minutes to firm up before being filled.) Unfortunately it’s almost impossible to peel off the back of the pie tin in one piece. You end up with crumbled messes.

I was able to save two of my pie crust cups, the other 2 were damaged beyond repair. At this point I just stuffed them into the muffin cups, put the sliced steak on the bottom, drizzled cheese and a scrambled egg into the cup and finished baking at 350 for about another 10 minutes (or until the egg was fluffy.)

This was one of the cups that almost made it.

In the end, though, the muffin cups salvaged the meal. Steak + eggs + cheese + pie crust = delicious breakfast food.
Here’s the official recipe:
Ingredients:
1 pie crust mix or store bought pie crust
3 eggs
1 cup grated cheddar cheese
1 cup of sliced steak (cooked bacon or canadian bacon works almost as well)
(Optional) 1 cup of grilled onions
Directions
Preheat the oven to 400 degrees.
Make the pie crust (if using a mix or creating from scratch) and roll it out flat. Cut into 6 equal pieces, and then roll those into generally circular shapes. Put muffin cups into a muffin tin, and then press the pie crust into the muffin cups.
While this is baking, beat the 3 eggs together. You can add salt, pepper, and possibly a dash of dill to the eggs.
Put the muffin tin into the oven and bake for approximately 8 minutes (until the pie crust is just starting to brown.) When you take it out, turn the oven down to 350 degrees.
Fill the bottom of the pie cup with meat and cheese in equal amounts. Pour the scrambled eggs on top of the steak and cheese. Place it back in the over for until the eggs are fluffy (usually about 10 minutes.)
Serve warm.
Update 03/15/10: So I tried it again, using the muffin cups from the beginning with great success (and they look pretty good too.) I’ll try and get pictures up soon. Also, if you scramble the meat and cheese into the eggs you end up with a better distribution of meat, egg, and cheese.
Games: Fallout 3 Hacking Minigame Solver
Oct 29th
I’ve added my Fallout 3 Solver back to the website, so if you were having trouble finding it before it is back now.
For those that haven’t used it before: In Fallout 3 there are computer terminals all around the world. To access some of them you have to pass a “hacking” puzzle. Sometimes its fun to play this out and try and solve the puzzle manually. However, often I really needed what was in the next room and the door was controlled by the computer.
To ensure that I didn’t lose my chances, I wrote this solving tool.
The tool has percentages based upon how common the letters are in it. For example, the letter e is the most common letter in the English language. It seems to me then that a word with an e in it is more likely to occur than a word with no e’s in it. That being said, the percentages are just for fun.
Enjoy and leave me comments!
WSDL2Java with Maven – Fixing “BadCommandLineException: grammar is not specified”
Oct 28th
At my job, we use the wsdl2java maven plugin to generate the appropriate classes from the webservices’ wsdl document. When we received notice that we were to incorporate a new webservice into the system, we thought “No big deal, we’ll just use the plugin and be off!”
Unfortunately, we ran into the dreaded “com.sun.tools.xjc.BadCommandLineException: grammar is not specified” error. After inspecting the code I couldn’t find any issue. The wsdl was right there, and it didn’t reference any outside xsds or anything? What’s the problem?
I did a google search. Found some interesting threads from nabble that had nothing to do with my problem. Eventually, I found that (with a misleading name) the wsdl2java plugin doesn’t automatically pickup xsds. If you are pointed to a directory that has XSDs (usually referenced by the actual wsdl files) it will autogen from those. But if your xsd are in a subdirectory (or not needed for such a simple webservice) then wsdl2java blows up with the grammar error.
I ended up the following in my pom:
<plugin>
<groupId>com.sun.tools.xjc.maven2</groupId>
<artifactId>maven-jaxb-plugin</artifactId>
<executions>
<execution>
<!-- This one has the xsd's in the same directory, so it was already working -->
<id>simple-xsd-wsdl2java</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<!-- directory of the wsdls and the xsds -->
<schemaDirectory>src/main/wsdl/simple</schemaDirectory>
<generateDirectory>src/autogen/simple</generateDirectory>
<readOnly>true</readOnly>
</configuration>
</execution>
<execution>
<!-- This one was only the WSDL files, with no external XSDs -->
<id>wsdlOnly-wsdl2java</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<!-- directory of the wsdl files -->
<schemaDirectory>src/main/wsdl/wsdlOnly</schemaDirectory>
<generateDirectory>src/main/autogen/wsdlOnly</generateDirectory>
<readOnly>true</readOnly>
<includeSchemas>
<!-- Each schema has to be spelled out as an includedSchema, or it will be ignored -->
<includeSchema>AccountService.wsdl</includeSchema>
<includeSchema>SystemService.wsdl</includeSchema>
<includeSchema>GiftService.wsdl</includeSchema>
</includeSchemas>
<!-- Indicates to the grammar parser that the schema files are in the wsdl format -->
<args>-wsdl</args>
</configuration>
</execution>
</executions>
</plugin>
Notice that in the wsdlOnly configuration I have specifed each schema file separately. I think there is a way to specify a directory/wildcard search, but I didn’t spend the time figuring it out. The other immensely important part is adding the args section. This tells the parser that the files are in wsdl format, not in XSD.
I hope that this helps anyone out there looking for a way to auto generate class files to use with SpringWS from stand-alone wsdl files.
Moving to Wordpress!
Sep 15th
I’m migrating my old blog to a Wordpress based one. It might take a while since I had such a vast number of blog posts on blogger. That being said, the Fallout 3 Hacker Solver should be up ASAP.
Let me know what you think of the new look and feel!































