What is Toluu?
Toluu is a free service for sharing the feeds you read and discovering new ones.
Get Invite

Step One Feed


Making A Time BudgetDecember 14 2008

Like many people, I have a problem with overcommitting myself. I love getting things done, so I often jump on every opportunity I have. This weekend, I found out about an exciting opportunity for me to conduct some training in the spring. In order to see if that will be feasible, I sat down and made a time budget.

To make a time budget, you start with a table like the following:

A blank time budget

I’ve split each day into morning, afternoon, and evening, with about four expected hours in each. Between eating and miscellaneous stuff, that’s probably as much as I’m going to have.

Then, you write down everything you have to or want to do, with an estimated number of hours it’ll take per week beside it.

Work: 40 (M-F afternoon)
School: 12
Ruby hack night: 4 (1/mon 1st Thu)
Refresh the Triangle: 4 (1/mon 4th Thu)
Functional Meetup: 4 (1/mon 3rd Thu)
Church stewardship committee: 4
Services: 2 (Sun morning)
ERUUF-CF: 2 (2x/month Sun afternoon)
Camp Nerdly planning: 2
Self-organization: 2 (Sun afternoon)
Friday night date: 4 (Fri night)
Game with friends: 4 (Mon night)
Spanish classes: 2 (Wed 6-8pm)
Create Scala course: 4
1 night/week relaxing: 4

All that equals about 86 hours, which is more than I have in a week.

After th















Recursive Requirements Between Scala And JavaDecember 12 2008

Because of a great professor, I’ve gotten to use Scala instead of Java for my Advanced Data Structures and Analysis class this semester. He warned me I’d be on my own, and that provided materials would be in Java. I thought this would be simple because of Scala’s interoperability with Java, and I was right.

For our last assignment, we were given the skeleton of a spreadsheet application, the GUI and some of the logic. We had to build the calculator that would parse expressions in the spreadsheet and find cycles in them. I became worried when I realized that my Calculator class, written in Scala, would require the SpreadSheet class, written in Java, and vice-versa. (I’m not claiming this is a good design, by the way. Between reusing an earlier calculator written in the class and not writing the GUI, the recursive requirements seemed the easiest way.)

I’d used Java classes already compiled as bytecode before, but never had to compile Java classes requiring my Scala code. It ended up being much easier than I expected.

From my Ant build.xml:

<target name="build" depends="prepare" description="Build source"> <scalac srcdir="${path.src}"
Scala, SWT, and OS XDecember 3 2008

Mac OS X and the Eclipse SWT do not get along well together. I find Swing to be sluggish and overly verbose, and so I gave SWT a try tonight. As you can see on the SWT website and elsewhere, there’s a known issue with SWT and OS X where you have to pass the -XrunOnFirstThread option to Java. I banged my head against the wall a bit trying to figure out how to do this with Scala, until I realized the obvious:

JAVA_OPTS="-XstartOnFirstThread" \ scala -cp target/classes:swt/swt.jar CalliopeSWT

Another lesson learned that may not be obvious: you can’t use 64-bit Java with SWT on OS X, which eliminates the Apple-released version of Java 6. (I have no idea about SoyLatte and SWT, but if you know the deal there, please comment.)

Anyway, the limitations of SWT on OS X lead me to think I either need to go back to using Linux or quit trying to use SWT. One good thing came out of the experiment: a Scala port of Bruce Eckel’s SWTApplication from Thinking in Java.

474299696
Building a Text Editor in ScalaDecember 3 2008

I think the default project for learning a language these days is building your own blog software, but I wanted to go the classic route for Scala: I’m building a text editor. I haven’t done a lot of GUI development, and I wanted more experience with it, plus I already like my blogging software.

I encountered a ton of frustration on my first try, mainly because I don’t know Java well, I know Swing even less, and Scala’s got some big holes in documentation. The API is well documented for the most part, but practical tutorials are missing. I hope posting this code and describing my issues help someone.

Programming in Scala from Artima Press showed me the basics of Swing in Scala, up until when I wanted to pop up a file chooser dialog. If you know Java, this is probably obvious, but for me, it was baffling. You don’t create a file chooser when you need it, but during app construction, and then call showOpenDialog(parent) and showSaveDialog(parent) to pop up the dialogs. (Looking now, it seems I could have made them when I needed them.) The parent in this situation has to be a Component that the dialog will pop up over, and not every graphical element in your app is a Component. After looking through plenty of docs and following inheritance chains, I found that Panes are Components, and I had to put

Talks by Clinton R. NixonNovember 13 2008
Page updated 2008-11-13: Talks by Clinton R. Nixon.334550688