Offline Memory Profiling

I think I took care of the DefinitionsPane memory leak that we’ve seen occasionally in our tests during the last years (actually, the last 4 years, 9 months, judging by the repository). The NULL_DOCUMENT instance in AbstractDJPane.java had listeners, and those listeners held references to the DefinitionsPane or the OpenDefinitionsDocument.

For those of you who aren’t that familiar with the code base, the NULL_DOCUMENT is an example of the “null object design pattern”. There is the notion of a “current document”, but in some cases, e.g. during
initialization, there may not be a current document. We could set the field for the current document to null, but then we would have to check for null everywhere the field is used. That’s not very robust. Instead, we created an instance of a document, called NULL_DOCUMENT, that isn’t really used as a document at all. It’s just used to signal that there is no current document, but to act graciously if the field is used.

The document still had listeners, though, even though it should really just be a dummy. It should be as much a dummy as null, without the side effects of a NullPointerException. After tracing the problem to
NULL_DOCUMENT (more on how i did that below), I overrode the addXXXListener
methods for NULL_DOCUMENT to be no-ops. Now listeners just cannot be added to this instance. The memory leak was only intermittent, so it’s difficult to say for sure that the problem has been remedied, but I’ve
run 120 repetitions of the DefinitionsPaneTest and not seen the problem again (before the change, I couldn’t run five repetitions without noticing it).

I want to discuss a little bit how I spotted this problem: There are two tools that Java provides, jmap and jhat (really starting with JDK6; unfortunately not supported on the Mac). jmap dumps the entire heap of a JVM into a file. jhat then analyzes that file and provides a HTML interface to browse the results. For more information, look at this article: Finding Memory Leaks in Java Apps.

The biggest problem here was that the problem wasn’t visible all the time, and when we noticed it (because the unit test failed), it was really too late already to execute jmap to retrieve a heap dump. So I wrote a dumpHeap() method that executes jmap automatically, from within the program; that way, I can dump it only if the memory leak has been detected:

/** Dumps the current heap to a file. */
public static File dumpHeap() throws IOException, InterruptedException {
String javaHome = System.getenv("JAVA_HOME");
char SEP = File.separatorChar;

// try jps first
File jps = new File(javaHome+SEP+"bin"+SEP+"jps");
// if that doesn't work, try jps.exe
if (!jps.exists()) jps = new File(javaHome+SEP+"bin"+SEP+"jps.exe");

// execute jps
ProcessBuilder pb = new ProcessBuilder(jps.getAbsolutePath());
LOG.log(java.util.Arrays.toString(pb.command().toArray()));
Process jpsProc = pb.start();
jpsProc.waitFor();
LOG.log("jps returned "+jpsProc.exitValue());

// read the output of jps
BufferedReader br = new BufferedReader(new InputStreamReader(jpsProc.getInputStream()));
Integer pid = null;
String line = null;
while((pid==null) && (line=br.readLine())!=null) {
LOG.log(line);
// find the PID of JUnitTestRunner, i.e. the PID of the current process
if (line.indexOf("JUnitTestRunner")>=0) {
pid = new Integer(line.substring(0,line.indexOf(' ')));
}
}
if (pid==null) throw new FileNotFoundException("Could not detect PID");
LOG.log("PID is "+pid);

// try jmap first
File jmap = new File(javaHome+SEP+"bin"+SEP+"jmap");
// if that doesn't work, try jmap.exe
if (!jmap.exists()) jmap = new File(javaHome+SEP+"bin"+SEP+"jmap.exe");

// execute jmap -heap:format=b PID
pb = new ProcessBuilder(jmap.getAbsolutePath(),
"-heap:format=b",
pid.toString());
LOG.log(java.util.Arrays.toString(pb.command().toArray()));
Process jmapProc = pb.start();
jmapProc.waitFor();
LOG.log("jmap returned "+jmapProc.exitValue());

// read the output of jmap
br = new BufferedReader(new InputStreamReader(jmapProc.getInputStream()));
while((line=br.readLine())!=null) {
LOG.log(line);
}

// rename the file
File dump = new File("heap.bin");
if (!dump.exists()) { throw new FileNotFoundException("heap.bin not found"); }
File newDump = new File("heap-DefinitionsPaneTest-"+pid+"-"+System.currentTimeMillis()+".bin");
dump.renameTo(newDump);
return newDump;
}

Then I still had to associate the instances of DefinitionsPane and OpenDefinitionsDocument with the instances reported in the HTML output. The contents of integer fields is displayed in the output, so I added a field that contains the identity hash code.

When I looked at the reference chains from the root set (which cannot be garbage-collected) to an instance of DefinitionsPane, I noticed that they all end with the following part:

--> class edu.rice.cs.drjava.ui.AbstractDJPane (84 bytes)  (static field NULL_DOCUMENT:)
--> edu.rice.cs.util.text.SwingDocument@0x72b4b840 (78 bytes) (field listenerList:)
--> javax.swing.event.EventListenerList@0x72b4d450 (12 bytes) (field listenerList:)
--> [Ljava.lang.Object;@0x74f52968 (136 bytes) (Element 23 of [Ljava.lang.Object;@0x74f52968:)
--> javax.swing.plaf.basic.BasicTextUI$UpdateHandler@0x74f6b578 (17 bytes) (field this$0:)
--> javax.swing.plaf.basic.BasicTextPaneUI@0x74f6b5b0 (29 bytes) (field editor:)
--> edu.rice.cs.drjava.ui.DefinitionsPane@0x74f67eb8 (559 bytes)

That means that if we can break this part of the chain, the DefinitionsPane can be deallocated. By not allowing listeners, that’s what I have done.

Share
Posted in DrJava | 2 Comments

Print This Post Print This Post  

Hudson

Another big step in the last two months, I believe, was setting up a Hudson server. Hudson is a continuous integration server. It provides a web interface to run tasks such as compiling, creating documentation, and running unit tests. These tasks can also be scheduled to run at certain times, and Hudson can also monitor source control systems such as Subversion.

Right now, I have Hudson running on my office workstation, finland.cs. It is behind the CSnet firewall, so to use it, you need to SSH into finland.cs and forward port 8080, e.g. using:

ssh -N -L 8080:finland.cs:8080 mgricken@finland.cs

Then you can connect to the web interface by pointing your browser at http://localhost:8080.

Right now, DrJava, the PLT Utilities, Java Language Levels and DynamicJava are all built and unit-tested within 10 minutes of a commit. Once a week, Hudson also updates the FindBugs static analysis reports (both as HTML for the DrJava website and XML reports that can be browsed in the Hudson web interface), Clover code coverage reports and the Javadocs for all of these projects.

I have set up the schedule so that most of the scheduled tasks happen during the night or on weekends when it’s less likely that I am using my workstation:

Hr Mon-Fri Sat Sun
0 DrJava
1   DynamicJava FindBugs DrJava FindBugs
2   DynamicJava FindBugs XML DrJava FindBugs XML
3   DynamicJava Clover DrJava Clover
4   DynamicJava Javadoc DrJava Javadoc
5 DynamicJava
6 DrJava
7  
8
9
10
11
12
13
14
15
16
17
18 DrJava
19 PLT / JLL
20   PLT FindBugs JLL FindBugs
21   PLT FindBugs XML JLL FindBugs XML
22   PLT Clover JLL Clover
23   PLT Javadoc JLL Javadoc

DrJava is built and unit-tested at least 21 times a week; DynamicJava, the PLT Utilities and the Java Language Levels are built 7 times a week.

Every time a build fails or gets fixed again, Hudson sends out emails. That’s probably the most visible part so far. Unfortunately, we have one bug that happens quite frequently now: Sometimes some objects aren’t garbage-collected as we expect. This problem has been around as long as I can remember, i.e. at least since the beginning of 2006. It is difficult to fix, because we can’t really determine which references prevent garbage collection, and we don’t notice it outside of the unit tests.

There are also some problems with Hudson getting stuck or not being able to allocate an X server for the GUI parts of the unit tests, causing the builds to fail. In general, however, I feel a lot better, knowing that Hudson is there, catching errors usually within 10 minutes. I’m also glad I don’t have to build and copy Javadoc and the different reports manually anymore.

Hudson exports the test results to a Google Calendar (XML), which made it quite easy for me to check that the builds were still on track.

In the future, it would be nice to have Hudson run on a dedicated machine, so it doesn’t interfere with my work. Perhaps when a new machine comes in, we can use my current workstation solely for Hudson.

Share
Posted in DrJava | Leave a comment

Print This Post Print This Post  

Two-Thousand Nine

Okay, I have neglected my blog for about two months now, and I have received complaints about it, so I will try to make up for that with a summary: I’ve been spending my time mostly on three different subjects: COMP 402, DrJava and Concutest.

The month of January was pretty thoroughly in the hands of COMP 402. In the past, the class called “Production Programming” was numbered COMP 312, and it was traditionally taught by my advisor, Corky, but this semester I am teaching it. I hope I’m doing an adequate job.

During the first four weeks, we discussed concurrency issues, SourceForge, Ant and Subversion, and we have also played around with some dynamic analysis tools, namely Clover for code coverage and YourKit as profiler. After the lecture phase was over, we started working in pairs in the lab, first writing some more unit tests, and then began finishing off the tasks on the lists I had prepared.

By now, we have finished the following tasks:

  1. Test-Run Hourglass Freeze (Bug 2221819)
  2. Focus Jumps to Interactions Pane (Bug 2153310)
  3. Turn on “Hour Glass” When Indenting Code (Bug 687674)
  4. displays internal representation of command-line args (2117750)
  5. Empty java files cause junit test error
  6. Debugging twice throws a DeadlockException (Bug 2106569)
  7. Javadoc deletes directories (Bug 2498253)
  8. Project Main Document Heuristics should not be hard-coded
  9. Menu Item and Customizable Shortcut for Ctrl-D End of Stream
  10. Imports should persist over breakpoints (Feature 1418853)
  11. Allow “end of file” in System.in input (Feature 1470491)

We are still working on these tasks:

  1. Project Main Document Heuristics should not be hard-coded
  2. Default Imports for Interactions Pane
  3. Change Double-Click Selection and Next/Prev Word

We still have a bunch of tasks on the list. The two most important tasks, though, are:

  1. Network paths
  2. New keyboard shortcut system

In general, most of these tasks don’t introduce big features. I have declared that this semester’s development is all under the name of stability.

Okay, it’s getting late. I think I will continue with the summary tomorrow.

Share
Posted in COMP402, DrJava | Leave a comment

Print This Post Print This Post  

DrJava Survey Results, February 9, 2009

Here are the latest results from the DrJava Survey. Since the last time I looked at the survey, developer builds were not relevant, I did not distinguish between developer builds and official releases this time, or look at the different DrJava versions that were used.

An analysis of the data is below, but here are my conclusions:

  • We need to test on Windows Vista. One third of our users now have Vista.
  • We need to test on MacOS Leopard. There are four times as many users with 10.5 than with 10.4.
  • Only 205 users ran Java 1.4 — about one percent. Abandoning Java 1.4 should not cause any problems.
  • Most users (85%) are now working with JDK6.
  • 66 users ran Java 1.7, so we should keep an eye on that.

Operating system:

  • Darwin: 1 (0%)
  • FreeBSD: 4 (0%)
  • OpenVMS: 1 (0%)
  • Linux: 1612 (6%)
  • MacOS, all: 2721 (10%)
    • 10.2.x: 3 (0%)
    • 10.3.x: 20 (0%)
    • 10.4.x: 656 (2%)
    • 10.5.x: 2041 (8%)
  • SunOS: 122 (0%)
  • Windows, all: 22010 (83%)
    • Windows 98: 4 (0%)
    • Windows ME: 3 (0%)
    • Windows NT: 11 (0%)
    • Windows 2000: 132 (0%)
    • Windows 2003: 79 (0%)
    • Windows XP: 13732 (52%)
    • Windows Vista: 8038 (30%)
  • Windows Server 2008: 11 (0%)

Total: 26470 (100%)

Java:

  • 1.4.x: 205 (1%)
  • 1.5.x: 3686 (14%)
  • 1.6.x: 22513 (85%)
  • 1.7.x: 66 (0%)

Total: 26470 (100%)

Response rate (responses / downloads): 26470 / 147676 = 18%

Share
Posted in DrJava | Leave a comment

Print This Post Print This Post  

Merry Christmas

This semester is now over, I have submitted the final grades for the COMP 202 class that I taught this semester. I’m sure I’ll always fondly look back to this opportunity. Now I’m waiting for my grades, of course: for the instructor evaluations.

We had an Othello tournament again, and it was great fun. Some of the games were really close, even though one strategy won all games.

Now I’m working on the lecture schedule and the homework for the COMP 402 – Production Programming class for next semester.

Share
Posted in COMP202, COMP402, DrJava | Leave a comment

Print This Post Print This Post  

Upgrade to WordPress 2.7

I just upgraded to WordPress 2.7. Everything seems to work as usual now. I did have to update the WP-Email, WP-Print and WP-Sticky plugins, and regenerate the permalinks.

Now, of course, the entire administration side of WordPress looks different, and I have to get used to it, but in general I have to say it looks nice. If you notice any errors on this blog, please let me know.

Share
Posted in Uncategorized | Leave a comment

Print This Post Print This Post  

“50 in 50”

“50 in 50”

A presentation by Richard Gabriel and Guy Steele, containing fifty statements of fifty words each from the realm of programming languages. Probably the most entertaining computer science lecture I have ever watched.

Share
Posted in Uncategorized | Leave a comment

Print This Post Print This Post  

ANTLRWorks and OpenJDK Compiler Grammar

Now that my qualifying exam is behind me, I’ve got more time to focus on other things. I have to admit that the exam pretty much occupied all of my thoughts and hogged lots of time, to the degree that I didn’t prepare as well as I used to for my COMP 202 class. I think that has changed again now.

I’m also starting to look at the Java multi-stage programming project again, and I discovered that the OpenJDK people have added a Compiler Grammar project. This project is trying to replace the hand-coded parser for javac by a parser generated from an ANTLR grammar file. I haven’t fully checked how far this has progressed, but it is interesting. Modifying the grammar to allow annotations on statements and expressions should be easier than rewriting the interpreter by hand. It seems like there is a Java 5 grammar that integrates into javac, but of course there is no JSR 308 grammar, so I’d have to develop that first.

When I looked at ANTLR and the Compiler Grammar project, I also noticed an interesting IDE that has been built to make developing grammars easier: ANTLRWorks. It integrates a several checking tools and a debugger and looks tremendously helpful. For example, it can explain how a grammar is ambiguous. In my case, an annotation on a parenthetical expression could be parsed in two different ways, so I’ll have to be careful there.

ANTLR Ambiguous Path Visualization

ANTLR Ambiguous Path Visualization

On MacOS, I’m still struggling a bit to get the Compiler Grammar project and ANTLRWorks running. It seems like Compiler Grammar needs SoyLatte to work, and I have managed to build the Compiler Grammar javac from the command line, but when I try to run it inside ANTLRWorks, then it seems like it is using the default Apple Java version 1.6.0-dp, which doesn’t work. Maybe I’ll take a look at it on Windows first.

I also need to start thinking about the COMP 202 final exam, and about a lecture schedule and programming tasks for COMP 402 next semester.

Share
Posted in COMP202, DrJava, Pictures, Research, Review, xajavac | Leave a comment

Print This Post Print This Post  

Knocking on the Table

I’ve been listening to Deutsche Welle Radio a lot lately, and today they had a quiz on their “Cool” culture show: “When a group of people are sitting around a table in Germany and start knocking on the table, what does that mean?”

This is, of course, easy to answer for me, but I think it’s a really interesting issue. I remember that when I was in the Sekundarstufe I (middle school, grades 7-10), we generally clapped after someone’s talk. Then I went to the US as a high school exchange student in grade 11, and there we clapped. But after I came back for 12th and 13th grade in Sekundarstufe II (high school), students knocked on the table.

I was originally very confused, but I liked it. It somehow seems more dignified than clapping, you can do it longer without having your hands hurt, and it can be done with just one hand. When I then started college and later graduate school in the US, of course I had to learn to applaud again.

I’m still tempted to somehow introduce knocking on the table to the US — I just like it so much better — but I doubt I will succeed. Anyway, after hearing about the quiz above on the radio, I searched a bit on Google, and I found an interesting collection of responses from linguists.

On a not necessarily related note, I passed my Ph.D. qualification exam and have now completed all preliminaries for Ph.D. candidacy. Knock knock knock :)

Share
Posted in Uncategorized | Leave a comment

Print This Post Print This Post  

SourceForge Subversion Problems

Corky and I are having problems on the CSnet machines when we are trying to check source out from Subversion:

% svn co https://drjava.svn.sourceforge.net/svnroot/drjava/trunk/drjava
svn: PROPFIND request failed on '/svnroot/drjava/!svn/vcc/default'
svn: PROPFIND of '/svnroot/drjava/!svn/vcc/default': SSL negotiation failed:
SSL error: decryption failed or bad record mac (https://drjava.svn.sourceforge.net)

Has anyone else encountered this? I can’t find any useful search results. However, when I do a checkout with http instead of https, it works (although I haven’t attempted to commit anything):

% svn co http://drjava.svn.sourceforge.net/svnroot/drjava/trunk/drjava
A    drjava/strip-license
A    drjava/LICENSE
...

Any advice is appreciated. I’m starting to think this is a SourceForge issue again, because I have been finding a handful of SSL issues.

Judging by my experience in the last few months and all the support requests (“We’ve been making some changes, try again \*request closed\*”), SourceForge has turned into a steaming bucket of excrement. Someone please flush.

I do have some new pictures from today’s lecture about parsing and the extended visitor pattern, though. Explaining the extended visitor pattern with all the type parameters is more difficult than I thought. I’ve decided to spend another day on it.

Update

It turned out that an upgrade to the latest OpenSSL and Subversion software on our side took care of the problem. I figured that would be a more sensible first attempt, rather than downgrading to an ancient version of OpenSSL, which is what SourceForge recommended.

Share
Posted in COMP202, DrJava, Pictures, Ramblings | Leave a comment

Print This Post Print This Post  

Integrity and Everything

I just wanted to mention two programs that I’ve found very useful: Integrity and Everything.

Integrity is a very convenient, easy to use HTML link checker for MacOS. It’s “donationware” and has helped me make sure I don’t have any broken links in my work website, my personal website, and my course website. And currently, it’s working on this blog.

Everything is a fast NTFS file name search program for Windows. Here’s a review. It’s not quite Spotlight for MacOS, because it doesn’t search file contents, it only scans file names, but it is very fast.

Share
Posted in Uncategorized | Leave a comment

Print This Post Print This Post  

Academia.edu and Publications Category

A few days ago, I got an email from Academia.edu, which seems to be something like Facebook for people in academia. It’s a tree of universities, departments, faculty members and students. I originally wasn’t too interested in it, but decided to fill out my profile anyway.

There are profile pages that allow you to upload papers, presentations, declare research interests and describe your teaching experience, so I did that. The documents are uploaded as “iPaper”, and honestly, the preview still needs improvement. Right now, this part of the website is a bit annoying, as are most parts that use the AJAX “Web 2.0” style of editing (not reloading the entire page).

So, right now I wouldn’t use Academia.edu to find material or people, but apparently it has a really high Google PageRank, and therefore a lot of weight for links. It seems like it has given my own website a considerable bump. I think it can be quite beneficial simply from the point of view of publicity.

The website also has an interesting feature that records what Google search terms lead web surfers to your Academia.edu profile. Here are the keywords that lead people to me — the actual things that they typed into Google:

  • converting to a new temperature scale
  • junit concurrent test
  • conclusion on marine biology
  • how to calculate the complexity of a given code using big o notation with exercise and solutions
  • design pattern parser
  • change in temperature calculations
  • In java, show an example of a conversion from celsius to Fahrenheit temperature
  • parsing design pattern

Apparently, temperature conversion is a very popular assignment, and my Temperature Calculator comes up quite often. I’m also amused by the fact that people type whole questions or requests into Google. “Google, please tell me why they do that. Thanks, bye.”

Additionally, Academia.edu has inspired me to collect all my papers, presentations and posters in one place, and I’ve created the Publications category. In that category, I have inserted my publications, both refereed and unrefereed, on the day they were made available. Because of that, the calendar of my blog now stretches back to 2003.

I decided to use a category on this blog mainly because now there is an RSS feed for my publications, and interested readers can easily subscribe and be notified of new material. On my non-blog work website, I have also added a publications page, both with long descriptions and without.

Finally, I’ve added an extra credit part to the COMP 202 schedule, worth 20 points which will be counted towards the midterm. It’s hard to believe that only five weeks are left in the semester. Two thirds are done.

Share
Posted in COMP202, Ramblings, Research, Uncategorized | Leave a comment

Print This Post Print This Post  

Sometimes I feel really dumb

I was reading this MixGen paper, and I came across this symbol in the antisymmetry lemma (5.13). It looked kind of like $\not\vdash$ and I thought maybe that was supposed to be the symbol for antisymmetry, but it wasn’t defined anywhere.

After minutes of confusion and scanning through the paper I realized that it was simply a turnstyle $\vdash$ crossed out. Durrh.

Share
Posted in Ramblings, Uncategorized | Leave a comment

Print This Post Print This Post  

volatile For Synchronizing non-volatile Data

Jevgeni Kabanov on dow.ngra.de made an interesting observation that I had noticed at one point when I was studying the new Java Memory Model, but that I had forgotten again.

A shared volatile variable that thread A writes to and thread B subsequently reads from guarantees that thread B sees everything that thread A saw when it wrote to the volatile variable, even if the other data is not volatile itself.

The most easily accessible documentation about this is from Bill Pugh’s JSR-133 FAQ:

Under the new memory model, it is still true that volatile variables cannot be reordered with each other. The difference is that it is now no longer so easy to reorder normal field accesses around them. Writing to a volatile field has the same memory effect as a monitor release, and reading from a volatile field has the same memory effect as a monitor acquire. In effect, because the new memory model places stricter constraints on reordering of volatile field accesses with other field accesses, volatile or not, anything that was visible to thread A when it writes to volatile field f becomes visible to thread B when it reads f.

Update

A very similar post popped up, Thread-safe non-synchronized read/writes?, and a commenter Matthias (not me, I have just one ‘t’) makes an important point:

Since the revision of the memory model, writing to a ‘volatile’ guarantees that no previous write will be reordered beyond it. Vice versa with reads. That’s why you can use volatiles for synchronization purposes – but only if you both write it in one thread _and_ read it in the other.

(Emphasis added by me).

Share
Posted in Concurrent Unit Testing, Ramblings, Uncategorized | Leave a comment

Print This Post Print This Post  

Mixed Bag

This post is just a mixed bag of things. First, a handful of things I’d like to achieve. I guess you could call them resolutions, although I’m haven’t quite reached the point of resolving them yet:

  • Learn to write the one-sentence email. A few people do this, and while it sometimes annoys me, especially in personal emails and because I like to write, it is really more effective. Last week, I sent out an email that had three short paragraphs with two questions; my conversation partner only replied to the first. When I sent out the second question again by itself, I got a reply.
  • Get up early more consistently even on days when I don’t have to get up early, and go to bed around the same time, even when I could stay up a bit. I have gotten a lot better this year, but there is still room for improvement. When I get up later, the whole day seems to be messed up somehow. To do that, I need to go to bed around the same time, but I love staying up late, browsing the web. It’s one of my guilty pleasures.
  • Take better notes when I read papers. Writing helps retention. I’m more of a big-picture person, so I tend to forget seemingly unimportant details like names of authors or even which papers I’ve read (that doesn’t mean I forget what it was about, I just couldn’t tell you if I’ve read “Smith 2007” or “An Efficient Semantics the Theta Calculus with Futures and Traces”).
    While I can read much better if I don’t have a computer with me, I think using Papers by mekentosj.com could help. It has been described as “iTunes for Papers”, and it can help to get bibliography items right, to tag and search papers, and to store notes. I’ve shelled out the $25.20 for a license after 40% student discount.

And in the past few weeks, I have taken a great liking to some online radio stations and podcasts, and an internet TV station:

  • DW-RADIO liveDeutsche Welle, news from the heart of Europe. World and German news in English. Unfortunately, the program repeats a lot, so you can’t listen to it all day.
  • Scientific American 60 Second Psych, 60 Second Science, and Science Talk. 1 minute/1 minute/30 minutes of miscellaneous science news. Especially the 1-minute podcasts fit in many little breaks during a day.
  • AAAS Science Update – Same. 6 to 10 minutes.
  • Hulu – has many shows that I would otherwise miss by accident or because I have cable. It’s almost a TiVo on the web, and you can time-shift the shows. 30 second advertisement only. I’m watching “The Colbert Report”, “The Tonight Show”, “American Dad!”, “Family Guy”, “House”, “Saturday Night Live” and “Terminator” there.

And finally, ever since returning from Germany and Finland, I’ve started to eat a lot of these foods:

  • Blueberries – I miss having my own blueberry bushes outside.
  • German muesli bread – relatively cheap at my local Fiesta. Now my mom doesn’t have to bring me bread anymore when she visits.
Share
Posted in Ramblings, Uncategorized | Leave a comment

Print This Post Print This Post  

Re: Dear Apple: Some Java Love, Please?

Joey Gibson expresses exactly how I feel. I love Apple, but the state of Java on the Mac is probably beyond what’s rationally bearable.

Share
Posted in Ramblings | Leave a comment

Print This Post Print This Post  

Java Annotations for Types, Expressions and Multi-Staging

I gave another presentation in our PLT seminar today. The title was “Annotations for Types and Expressions”, but I really should have squeezed multi-stage programming (MSP) in there, because that was really the big benefit I want to achieve from adding annotations to expressions and statements.

I’ve been feeling a bit under the weather the last couple of days, so it makes me very happy to think the presentation went well. I got some good feedback again, mainly that I should have advertised the MSP part more. Someone also said that I have a “soothing voice”, which doesn’t aid in keeping tired audience members awake. I need to work on my vocal variety.

I spent the rest of the day grading the COMP 202 midterm and doing some maintenance for the course.

Share
Posted in Graduate School | Leave a comment

Print This Post Print This Post  

Presentation: Java Annotations for Types and Expressions

Java Annotations for Types and Expressions

Where: Rice University Computer Science Department, RAP Seminar
When: October 24, 2008

As defined in Java 1.5, Java annotations can only be attached to very few targets: Classes, methods, method parameters, fields, and other annotations. The Java community intends to extend the list of targets and has issued Java Specification Request (JSR) 308, “Annotations on Types”. The current proposal for JSR 308 is considering allowing annotations on statements, but not on expressions.

In this talk, I discuss how the changes proposed by JSR 308 and its Checker Framework allow programmers to enhance Java’s type system and provide additional static guarantees. Additionally, I demonstrate that the same mechanism proposed for annotations on statements can be used to describe multi-stage programs in Java.

Share
Posted in Publications | Leave a comment

Print This Post Print This Post  

Bad Shortcuts

Sometimes, trying to take a shortcut can make your life more difficult: Today I didn’t plan on staying long after giving my two lectures, COMP 202 at 10 AM and COMP 311 at 1 PM, so I felt I didn’t need to bring my notebook to do some “serious” work. What I had forgotten, though, was that the room in which COMP 311 is held does not have a podium PC, and I didn’t realize that until I had already arrived at my office.

So I had to go back home during my lunch break to get the notebook. I should have just brought it in the first place.

I ended up going through detailed hand evaluations for the first and third sample program, both in call-by-value and call-by-name, and discussed the second program at a higher level, because it was less interesting.

I extracted some new pictures from today’s lecture, Dictionaries & Hashing (#22):

Share
Posted in Pictures, Ramblings, Teaching | Leave a comment

Print This Post Print This Post  

Symphony and Exams

Yesterday, I finally went to the first symphony concert of my subscription. Originally, I was supposed to have gone to a concert over a month ago already, but it was the night that hurricane Ike hit, so I rescheduled it. The new concert was yesterday afternoon, Beethoven 2 and Tchaikovsky’s Rococo.

Beethoven, of course, was fantastic. The cello solist, 25-year-old Alisa Wellerstein, was also very good, although I typically enjoy the entire orchestra more than solists. Therefore, I didn’t like Tchaikovsky as much as Beethoven’s 2nd Symphony. The first of the smaller pieces, “Adagio con Variationi” for cello and orchestra by Respighi was just amazing. Instantly I knew again why I am going to symphony concerts. Here, the interplay between the cello solo and the orchestra was perfect. Finally, Debussy’s “La Mer” was impressive as well.

In a few minutes I will hand out and proctor the COMP 202 midterm. Early today a student told me that he is sick and may not be able to take the exam. I said I will write a make-up exam and schedule a new time for him to take it. I spent the early afternoon writing a second midterm, but now it appears he feels better. If he does take the exam and I end up not needing the make-up exam (@ He ended up not taking the exam, so I need the make-up exam. @), I will probably just use the questions for the final.

On Wednesday I’ll be pulling double duty when it comes to teaching, as Corky has asked me to sub in for him in his COMP 311 class.

Share
Posted in COMP202, Ramblings, Teaching | Leave a comment

Print This Post Print This Post