Friday, June 26, 2009

Scala + Eclipse: Still Not Quite Right

 I like Scala, and I am excited about it. But for some reason, every time I try to use it I encounter some minor annoying issue that sort of turns me off and prevents me from making more use of it. Not something significant mind you (type system, performance) but rather something simply annoying.

This time: I just read about improvements to the Eclipse IDE which would make it easy to create mixed Java/Scala projects, which would be great for Plural. So I downloaded it, installed it, and what do you know, I can't even create an object without a syntax error! This is definitely a bug, since I created an object using the wizards, but when I do it I get a syntax error, "Syntax Error: Delete these tokens" on my object declaration. This bug has been reported, but not fixed, and makes the plugin entirely unusable for me. Boo!

Tuesday, June 23, 2009

Creating an Eclipse Update Site with Source Code

This is going to be a rather technical post. Sorry, but I couldn't find information about this anywhere online, or at least I was misunderstanding what information was available online. What I am going to try to explain is something that I just figured out. Let's say you are creating an Eclipse plugin, and part of the functionality provided by your plugin is some classes that will be usable by other programmers who are using your plugin. How can you make it so that the update site for your plugin includes the source code for your plugin, so that users can hover over class names, see the Java docs, etc.?

A good example of this type of plugin would be Crystal, a static analysis framework for Java that I have spent a lof of time working on. See the problem is that just using the regular update site functionality is not good enough. So let's discuss:

Symptom: You create an update site for your plugin, but when you do it does not include source code for your plugin, or alternatively you'd like to but haven't figured out how. The most frustrating thing that I encountered was that, while a regular "Export"-style plugin deployment would work (wherein you right-click on your project, select "Export," go to "Deployable Plug-ins and Fragments" and then be sure to check "Include Source Code", image 1) the JAR file that was getting created for the purposes of the Update Site would not include any source. This was verified by examining the JAR files produced by each mechanism with WinZip.

Solution: The most important thing to realize, I guess, is that the options offered to you in the standard "Update Site Build" screen (image 2) are not everything that is available. Here's how I made this work: 
  1. First, I am assuming you have three projects, your plugin project, your feature project, and your update site project.
  2.  In the Feature project, the only thing that seemed important was that I had to uncheck "Unpack the plug-in archive after the installation" on the "Plug-ins" tab. It did not work with this tab checked. (You do have to set up the feature normally, but I am omiting those details, since they are standard.)
  3. In the Update Site project, add a category and add your feature, as shown in image 2, and as you'd expect to do. However, don't bother hitting "Build" or "Build All." They will only get you a source-free plugin.
  4. Right-click on your feature project, select "Export..." and then select "Deployable Features." Now here are all the options we are looking for! (Image 3)
  5. You need to select a place for all this stuff to go, but choosing the directory export option, and choosing your update site project seems to be the best bet.
  6. Choose "Include Source Code," and also you want to package as individual JARs and include metadata. This will generate the archive.xml and contents.xml files we need for the update site!
  7. I also saved an ANT file, so I could automate this in the future, for when I am ready to make my next release.
  8. It will do a bunch of building stuff, but basically you're done!
So yeah, I found this whole process to be pretty easy once I figured it out, but very poorly documented! Now programmers who write static analyses that extend the Crystal framework can see the source and the documentation for the files they are using. Awesome!


Wednesday, June 10, 2009

Computer Problems Fixed & Terrible Visions

I fixed my computer! I'd been having the same problem for about 2 weeks, which rendered my computer more or less useless. After 10 minutes it would freeze, and then each time I would restart after that, it would basically freeze immediately. The problem? My video card! I figured out that that was the problem when the screen was frozen on the Windows error recovery prompt (You know, the one that says, "Windows did not shut down properly, would you like to start in safe mode, etc., etc.), but continued to start up and eventually played the Windows login sound. I tried using my computer's built-in video card, which still has DVI output, and everything is now grand. During the whole process I remembered vaguely that when I bought this video card it needed at  least a 300Watt power supply but recommend 350 (or something like that) and I only had the bare minimum. I'll chaulk it up to that and move on.

I had a less pleasant experience this past week. Kevin, Maja and I have been attempting to pass the Enless Setlist 2, on Rock Band 2. That's where you play every song in the game (84) without saving or anything. You can pause it though, so we were definitely taking breaks. Anyway, we were doing fine, ripping through every song without dying until song #82, a catchy little number called "Visions," by Abnormality. Suffice to say that, a.) even though I was playing on hard, when I normally play on expert b.) Kevin & Maja were both playing on medium c.) we called over Tom VII, our designated RB ringer, we still could not beat this crappy song, and we gave up. It was so hard and completely a-rhythmic. Compounding this was some kind of synchronization issue with their TV, but it wasn't a problem at all before then. Harmonix, I hate you. I may be done with Rock Band. Here's video of a guy actually beating the song on hard.

Monday, June 8, 2009

D.C. for like 36 hours

This weekend I went to Washington D.C.! But not for very long...

You see a certain special lady found a super sweet deal on a flight to Europe, and that flight was leaving from Washington D.C. Because of her copious friends in that city, we decided to turn in into a mini vacation, one that started on Friday morning driving to D.C., and ended up with me driving back Saturday night by myself.

The trip was fun. We basically did no real touristy stuff. We mostly hung out with friends. For example, on Friday night we went to a Korean BBQ restaurant, which was amazing, and then to Asian style Karaoke, where I sang many songs over the course of four hours. Best song? Escape (The Pina Colada Song). Worst song? Land of Confusion, by Genesis. It's not so much a bad song as it didn't go over very well. No one else knew it, and the Karaoke video was full of wierd imagry (e.g., Adolph Hitler).

Saturday we went to a crepe place called Crepes A-Go-Go. Also very cool.