Fun in the Snow, Work from Home

Today is the third snow day in a row. I’m glad that my job offers me the flexibility to work from home, because the last two days, it was dangerous out there, and now it is just nasty. I can’t wait to go back to the office, though. Even though my productivity has been descent (better than I expected — maybe it’s the lack of meetings), working from home does get a bit lonely.

Sliding in the snow, January 18, 2012

Sliding in the snow, January 18, 2012

It’s been a long time since I’ve seen this much snow. Definitely an experience.

Posted in Pictures | Leave a comment

Print This Print This   Email This Email This

Seattle, a Winter Wonderland

Before I moved to Seattle, people told me it “never snows in Seattle.” In the first few months of 2011, I had already found that to be incorrect. But today, more snow fell than I’ve seen here before. It’s really quite pretty, but it’s also Sunday, and I don’t have to go anywhere.

We’ll see how I feel about the snow tomorrow. Fortunately, my manager is great and has already said we could all work from home if necessary. I do have a meeting, though, that I don’t want to miss.

Posted in Pictures, Uncategorized | Leave a comment

Print This Print This   Email This Email This

People Who Crash into Cars I’m in Continue to Suck

The accident last week was the second time that I was involved in a car accident (it happened more often if you count cars hitting me on a bike).

The first time, a Houston rapper rear-ended my friend’s car, with my friend and me in it, and totaled it. He had an insurance card that he handed over, but what we didn’t know was that he had canceled the policy. He had had enough money to buy his new car in cash, but then he was too stingy to have the legally-required insurance.

You suck, man.

The accident last week wasn’t nearly as bad. Some people might not even care. There is some bent metal on the fender and a bunch of long scratches. The woman gave me her insurance card and her phone number. I talked to her insurance last week, but they didn’t get anywhere, because the phone number they had wasn’t working. I tried calling her, and it was the same number. She had given me a phone number that didn’t work.

That sucks too.

I tracked her down on Google and called her at work. I’m glad she honored my request to call her insurance as soon as possible. She acknowledged she was at fault, and now I can go get an estimate. She stunned me a little, though, when she grumpily said “I’m disappointed you got the insurance involved. I wish you had just gotten an estimate, and I would have paid for the repairs.” Tough luck, missy.

A co-worker of mine had the perfect response. He asked, “Did you say ‘I’m disappointed you hit my car’?” I wish I had.

Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This

A Grammar Change Saves the Day

At work, we deployed the latest version of our code on Wednesday night. It included a new query language. We used ANTLR to do the parsing.

We had never tested the new queries in a production setting, but the deployments to our Alpha, Gamma, and two regional clusters worked without problems. A few hours after deploying to the last clusters, a customer started using it, and that’s when all hell broke lose. I ended up rolling back to the previous version at 4 AM on Thursday.

A quick analysis by my coworkers yesterday showed that most of the time was spent doing the parsing.

The grammar that we used was essentially this one, which required backtracking by ANTLR:

1
2
3
4
E ::= ( E )
    | C
C ::= ( E and E )
    | ( E or E )

We never even let our test query finish, but it had been running for 45 minutes non-stop. I suggested a small change, which amounted to something like this:

1
2
3
4
E ::= ( E R
R ::= )
    | and E )
    | or E )

Sometimes it is helpful that I spent grad school in the programming languages group.

The parser that ANTLR generated now parsed our test query in under a second. Sure, we changed an LL(*) parser into an LL(1) parser, but I never would have thought that changing the grammar could result in an improvement by a factor of 2700.

Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This

Happy New Year (?)

Happy new year!

I haven’t written in a while, but I’ve also been busy. You know the story. I’ve done some traveling in private matters, but mostly it was large scale designs and some important improvements for work. I took every Monday off in December, and I still think that was a genial idea. Now it’s back to work without time off. It’s a marathon of sprints.

This year has not started so well for me, though. The girl I had been dating says she “needs some time.” I don’t know what that means. I don’t know if I am single or still in a relationship. Not that that really matters, I don’t have the nerve to meet anyone new right now anyway. I’ll just bury myself in work as a distraction.

On January 4, a woman drove her car into mine when she tried to squeeze into the left turn lane as I was stopped at a red light. So unnecessary. The damage isn’t bad, but it’s annoying. My car wasn’t even a year old. And now I have to deal with insurance and repairs. The hours wasted are what annoy me the most.

And yesterday I missed my bus because I ripped my shoelace when I put on my left boot. Argh.

Makes me kind of worry about Friday, January 13.

Posted in Ramblings | Leave a comment

Print This Print This   Email This Email This

Where Citations Come From — xkcd: Citogenesis

via xkcd: Citogenesis.

Something similar actually happened with the Karl-Theodor zu Guttenberg, who used to be the German Minister for Economics and Technology and later the Minister of Defense, before it became clear that he had plagiarized his doctoral dissertation.

Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This

DrJava DefinitionsPaneMemoryLeakTest fails on Mac

I submitted a bugfix for a problem with the debug panel when no debugger is available.

I noticed that on the Mac, the DefinitionsPaneMemoryLeakTest now fails:

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
   [junit] DefinitionsPaneMemoryLeakTest                26.92 sec
   [junit] Testsuite: edu.rice.cs.drjava.ui.DefinitionsPaneMemoryLeakTest
   [junit] Tests run: 1, Failures: 1, Errors: 0
   [junit] ------------- Standard Error -----------------
   [junit] Skipped analysing class java.security.ProtectionDomain
because of java.lang.AssertionError
   [junit] ------------- ---------------- ---------------
   [junit] Testcase:
testDocumentPaneMemoryLeak(edu.rice.cs.drjava.ui.DefinitionsPaneMemoryLeakTest):        FAILED
   [junit] Document 0 leaked:
   [junit] private static sun.awt.AppContext
sun.awt.AppContext.mainAppContext->
   [junit] sun.awt.AppContext@4998a455-table->
   [junit] java.util.HashMap@7f1bfcfc-table->

...

   [junit] [Ljava.beans.PropertyChangeListener;@67b50846-[373]->
   [junit] javax.swing.JViewport$1@7ceade87-this$0->
   [junit] javax.swing.JViewport@48be3a5e-component->
   [junit] java.util.ArrayList@6b333f77-elementData->
   [junit] [Ljava.lang.Object;@559b52d3-[0]->
   [junit] edu.rice.cs.drjava.ui.DefinitionsPane@2a38d0a8-_doc->
   [junit] edu.rice.cs.drjava.model.DefaultGlobalModel$ConcreteOpenDefDoc@557e5cbd
   [junit]     at
org.netbeans.test.MemoryTestUtils.assertGC(MemoryTestUtils.java:137)

It passes on Windows, and I haven’t tried it on Linux. I rolled back as far as revision 5266, which was from June 3, 2010, and it was still failing on the Mac. I have a feeling that something must have changed in Mac OS (Lion) or the Java version I have running (1.6.0_29). I know I’ve successfully run the unit tests many times since then on the Mac, even on my MacBook Pro. I even think I have run them successfully on Mac OS Lion.

It would be great if I could still run the unit tests on an older Mac, with an older Mac OS. I’ll dig into this, but it may take some time.

Posted in DrJava | 5 Comments

Print This Print This   Email This Email This

Awful King County Metro Changes Coming Up

I just found out that King County Metro is planning to cut off service for Route 27 at 12th Avenue at non-peak times. This is awful.

Route 27 is the only bus that takes me directly to my office. It already takes me 40 to 45 minutes with that bus; in fact, I can walk faster, which I do when the weather is nice. Coming back from work on the 27, or any bus for that matter, is already bad enough with the current service running outside of peak times. I would have hoped that service improves instead of being cut. I guess buses are really more intended for the homeless, who don’t care where the route ends, and not for people who aren’t going home from work at 6 PM yet, when peak time ends.

If these changes go into effect, I guess I’ll just drive every day. That means I’ll have to pay for parking, but I’m not going to change buses and spend two hours every day commuting in the company of the drunk, drugged, and unwashed when I can drive to work in under 15 minutes.

Posted in Ramblings | Leave a comment

Print This Print This   Email This Email This

Back from SPLASH 2011

I returned from SPLASH 2011 in Portland tonight. I attended only the Educators’ Symposium on Monday and the first day of the conference proper, but it was worth it. And how could it not be, given that it was so close, in Portland, even though the still-new-for-me title “SPLASH — Systems, Programming, Languages and Applications: Software for Humanity” has something very hippy-like.

I got to see Corky, Vivek and Vincent again, my doctoral advisor and two of my collaborators. I ran into a bunch of people I had met before, like Matthew Flatt, Eelco Visser, Michael Ernst, and Eugene Wallingford, but Igor Peshansky was one of the few people who seemed to recognize me as well. Thanks, and that’s just the way it goes for folks like me.

Vivek and Vincent did a great job with our DrHJ demonstration. Of the other presentations that I watched, I think PREFAIL impressed me the most. That was really good work. I liked the idea of the DSL to test languages and wish I’d had something like that for my work on Mint. And Zef Hemel’s mobl language demo was just damn cool.

I’m glad that I got to go, and I wish I had had more time, time to stay and be involved. I have more interests and responsibilities now, but I enjoy keeping in touch.

Here are some pictures:

Portland from the top of the Hilton, where the Educators' Symposium was held.

Portland from the top of the Hilton, where the Educators' Symposium was held.

Turing Award-winner Ivan Sutherland speaking.

Turing Award-winner Ivan Sutherland speaking.

PREFAIL Talk.

PREFAIL talk by Pallavi Joshi, UC Berkeley.

PREFAIL Talk, finishing slide.

PREFAIL Talk, finishing slide.

Integrated Language Definition Testing Talk.

Integrated Language Definition Testing Talk by Lennart Kats, Delft University of Technology

Integrated Language Definition Testing, example slide.

Integrated Language Definition Testing, example slide.

Posted in Pictures, Uncategorized | Leave a comment

Print This Print This   Email This Email This

John McCarthy Died

John McCarthy, Turing Award winner and one of the luminaries of computer science, died yesterday. I’ve spent the evening after the SPLASH Educators’ Symposium listening to McCarthy’s OOPSLA 2007 keynote speech (mp3).

Dick Gabriel introducing Stanford professor McCarthy's keynote at OOPSLA'07 in Montreal

Dick Gabriel introducing Stanford professor McCarthy's keynote at OOPSLA'07 in Montreal

John McCarthy was one of the earliest collaborators of my doctoral advisor, Robert “Corky” Cartwright. They worked on first-order programming logic in 1978 (Recursive programs as functions in a first order theory) and 1979 (First order programming logic).

McCarthy was on Corky’s committee. In Germany, the doctoral advisor is called “Doktorvater”, doctor father. If I haven’t quite lost a doctoral grandfather, I have at least lost a doctoral granduncle.

Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This

It’s Not Warm on Mt. Rainier

I wanted to check if I could squeeze another weekend of camping in this year, so I went to weather.com and typed in Mt. Rainier. It looked great: 23 Celsius on Saturday (73 Fahrenheit).

Mt. Rainier Weather

Mt. Rainier Weather

That did seem a bit odd, though, considering the temperature is hovering between 10 C (50 F) and 17 C (63 F) in Seattle. It turns out, that weather is for Mt. Rainier, Maryland, a suburb of Washington, DC. In Mt. Rainier National Park, WA, it’s snowing:

Mt. Rainier National Park Weather

Mt. Rainier National Park Weather

Oops.

Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This

Better Number Highlighting in DrJava More Difficult

Getting the lexing right for the syntax highlighting will be a little bit more work than I thought. Right now, DrJava tokenizes numbers like 3.14 separately as “3″ “.” “14″, and then it highlights “3″ and “14″ as numbers. That approach never was quite right, but I think it gets even uglier with the new literals.

I’m continuing the process of giving the compiler adapters more responsibility. The first step that I made for supporting HJ and Mint was to put the list of keywords into the adapters. I was now going to put the highlight determination into the adapters, but it seems like I may have to put tokenization there as well.

Of course, that fits well with plans of eventually supporting more languages, and languages that differ more.

Posted in DrJava | Leave a comment

Print This Print This   Email This Email This

Additional Java 5 Syntax Highlighting Errors in DrJava

While adding syntax highlighting for underscores and binary literals introduced in Java 7 to DrJava, I discovered that a few other numbers aren’t syntax-highlighted correctly. Some of these problems go back to the beginning of Java, others go back to Java 5, when the obscure hexadecimal floating-point literal was introduced.

Here are the numbers that give DrJava’s syntax highlighter trouble:

1
2
3
4
5
6
7
8
9
10
11
12
float f = 6.022137e+23f;
f = 2.f;
f = .3f;

double d = 2.;
d = .3;
d = 1e-9d;

double x = 0x1.8p1;
x = 0x1.fffffffffffffp1023;
x = 0x1.0P-1074;
x = 0x0.0000000000001P-1022;

Did you know about these hexadecimal floating-point literals? I didn’t.

I created a bug report for these Java 5 highlighting bugs.

References:

Posted in DrJava | Leave a comment

Print This Print This   Email This Email This

Lost My Phone

I lost my phone on the bus this morning. I stepped off the bus, went into a store, realized my phone wasn’t in my pocket, turned around and saw the bus drive away. Shoot.

I immediately changed my Google password, then upgraded my Lookout for Android to Premium so I could remotely lock my phone. I then began to track the phone and called the Seattle Metro. I could tell the customer service representative exactly where the bus with my phone was, but the representative said there was nothing he could do. I should try to catch the same bus when it comes back, or call them again tomorrow at 10:30 AM to contact Lost and Found. I tried to watch the bus, but I missed it, and I was at work, and that was more important.

Once, when I called my phone from my office phone, someone somehow picked up. I heard a women’s voice say “Oh-oh. Did you find that phone earlier?” Then there was a man’s voice saying “I can’t answer the call. It’s against the rules.”

Now, unfortunately, the phone’s battery is empty, and I can’t track it anymore. I don’t have a choice but to hope the bus driver found it and will take it to Lost and Found in the morning. The thing about it “being against the rules” makes me hopeful. I hope I had “Glueck im Unglueck” — that I got lucky in this misfortune.

Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This

Three Logicians Walk into a Bar

Three logicians walk into a bar, from Spiked Math via Language Log

Three logicians walk into a bar

I love it. This came to me from Spiked Math by way of Language Log, one of my long-time favorite nerdy blogs.

Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This

Registered for SPLASH 2011

Last night, I registered for SPLASH 2011. I’ll only be there for the Educators Symposium and the Tuesday conference sessions, though. It was a bit of a tough call, but I figured taking vacation days for something I’m still passionate about is worth it.

Yesterday, September 23, was the last day of early registration pricing, and even though it was still September 23 here in the Pacific timezone, the server apparently was on Eastern time. On the website, I did not get the lower price, but Mandy Mann from Registration Systems Lab, the company operating the registration website, already promised an $80 refund in the middle of the night.

Thanks for working so hard!

I haven’t booked a hotel yet. I don’t think I’ll choose the conference hotel, though. I hope it won’t be too cold or rainy yet in Portland and that walking a mile or two won’t be too bad. Of course, I could drive that distance too, park at the conference hotel, and still get a better price.

I also renewed my 24 Hour Fitness membership today by two years. I was a bit skeptical when I signed up a year ago, but the gym membership has become something I do not want to miss anymore.



Update

I now booked my hotel through Hotwire for $69 a night. I had made good experiences with Hotwire in Portland when I stayed in the Courtyard by Marriot near the Convention center. Hotwire had a hotel with a similar rating and price now, but alas, it’s a different one. The Red Lion Hotel does not nearly look as good. Oh well…

Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This

Dissertation and Numbers

I received the bound copies of my dissertation yesterday. They look nice, but they’re kind of thin, for so much work. Including front matter, there are 157 pages.

Some more numbers: The source code for my dissertation project has 35,979 lines with 136,951 words. At 30 lines per page, that would be 1,200 pages; but source code lines rarely fill the whole width of the page. At 250 words per page, that would be 548 pages; but wordsInProgramsAreOftenVeryLong.

It’s somewhere in between. But it’s also been written over the course of seven years.

Bound PhD Thesis Copies

Posted in Graduate School, Pictures, Thesis | Leave a comment

Print This Print This   Email This Email This

No More NDR2 Streaming Radio?

A few days ago, something really bad happened. The live stream of my favorite radio station, NDR2 from Hamburg, Germany, stopped working for me. For the last few years, NDR2 has been the music I listen to, when I’m at home and sometimes also when I’m at work. I listen to it on my mobile phone. It makes me feel like I’m staying in touch, and the last few days without it just weren’t the same.

While the NDR2 team was kind enough to respond and tried to help, unfortunately they did not know why the MP3 stream was not working for me anymore either. If I download the m3u file that NDR2 links to, and I get a streaming MP3 URL, but when I access that, I get a 404:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mgricken@scalar ~
$ wget http://www.ndr.de/resources/metadaten/audio/m3u/ndr2.m3u
Resolving www.ndr.de (www.ndr.de)... 213.71.15.227
HTTP request sent, awaiting response... 200 OK
Length: 59 [audio/x-mpegurl]
Saving to: `ndr2.m3u'
2011-09-18 21:40:34 (1.73 MB/s) - `ndr2.m3u' saved [59/59]

mgricken@scalar ~
$ cat ndr2.m3u
http://ndrstream.ic.llnwd.net/stream/ndrstream_ndr2_hi_mp3

mgricken@scalar ~
$ wget `cat ndr2.m3u`
Resolving ndrstream.ic.llnwd.net (ndrstream.ic.llnwd.net)... 69.28.151.253
HTTP request sent, awaiting response... 404 File Not Found
2011-09-18 21:49:37 ERROR 404: File Not Found.

Curiously, the WMA stream that NDR2 offers is still working; therefore, it’s mainly a problem on my Android phone. Fortunately, on AndroidForums.com I found a work-around that’s not quite as nice as the original NDR2 web player, but at least it works:

Yourmuze.FM offers a link to a Flash web player that plays the WMA stream, and that also works on Android.

I still hope that I get back the nice original NDR2 web player, with current, previous, and next song information, but for now, I have my radio back.

Update

The original NDR2 web player is working again. It seems like whatever service NDR2 uses for streaming fixed the problem.

Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This

Suggestions for Better Java 7 Support in DrJava

I just looked through the new language features in Java 7, and experimented with them in DrJava.

None of the changes are supported in the Interactions Pane, and there will be a lot of required work to make these things work there. We’ll have to change the parser, change the type checker, change the interpreter, and so on.

There are, however, smaller changes that we should do to provide better support in the Definitions Pane:

  1. Binary literals int i = 0b100000; are not syntax-highlighted correctly.
  2. Numeric literals with an underscore in them int i = 1_000; double d = 3.141_5927; are not syntax-highlighted correctly.
  3. In some cases, try-with-resources is indented badly:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
      // badly indented
      public static void tryWithResources2(String f) {
        try (InputStream is = new FileInputStream(new File(f));
             InputStream is2 = new FileInputStream(new File(f))) {
               is.read();
             }
             catch(IOException e) {
               e.printStackTrace();
             }
      }

Everything else looks pretty good. Here’s the sample class that I used:

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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import java.io.*;
import java.util.*;

public class Java7Samples {
  public static void main(String[] args) {
    stringSwitch(args[0]);
    intSwitch(new Integer(args[1]));
    tryWithResources(args[2]);
    tryWithResources2(args[2]);
    multiCatch(new Integer(args[3]));
   
    // bad integer syntax highlighting
    int i = 0b100000;
    System.out.println(i);
   
    // bad numeric syntax highlighting
    i = 1_000_000;
    System.out.println(i);
    i = 2__000__000;
    System.out.println(i);
    // int illegal = _1000;
    // int illegal2 = 1000_;
    double d = 123_456.789_012;
    System.out.println(d);
  }
 
  public static void stringSwitch(String arg) {
    switch(arg) {
      case "one":
        System.out.println("case one");
        break;
      case "two":
      case "three":
        System.out.println("case two or three");
        break;
      default:
        System.out.println("default case");
    }
  }
  public static void intSwitch(int arg) {
    switch(arg) {
      case 1:
        System.out.println("case 1");
        break;
      case 2:
      case 3:
        System.out.println("case 2 or 3");
        break;
      default:
        System.out.println("default case");
    }
  }
 
  public static void tryWithResources(String f) {
    try (InputStream is = new FileInputStream(new File(f))) {
      is.read();
    }
    catch(IOException e) {
      e.printStackTrace();
    }
  }
 
  // badly indented
  public static void tryWithResources2(String f) {
    try (InputStream is = new FileInputStream(new File(f));
         InputStream is2 = new FileInputStream(new File(f))) {
           is.read();
         }
         catch(IOException e) {
           e.printStackTrace();
         }
  }
 
  public static class Ex1 extends RuntimeException { }
  public static class Ex2 extends RuntimeException { }
  public static class Ex3or4 extends RuntimeException { }
  public static class Ex3 extends Ex3or4 { }
  public static class Ex4 extends Ex3or4 { }
 
  public static void doSomething(int i) throws Ex1, Ex2, Ex3, Ex4 {
    switch(i) {
      case 1:
        throw new Ex1();
      case 2:
        throw new Ex2();
      case 3:
        throw new Ex3();
      case 4:
        throw new Ex4();
    }
  }
 
  public static void handleEx1Or2(RuntimeException e) {
    System.out.println("handlEx1Or2");
  }
 
  public static void handleEx3Or4(Ex3or4 e) {
    System.out.println("handlEx3Or4");
  }
 
  public static void multiCatch(int i) {
    try {
      doSomething(i);
    }
    catch(Ex1 | Ex2 ex) {
      handleEx1Or2(ex);
    }
    catch(Ex3 | Ex4 ex) {
      handleEx3Or4(ex);
    }
  }
 
  public static void multiCatch2(int i) {
    try {
      doSomething(i);
    }
    catch(Ex1 |
          Ex2 ex) {
      handleEx1Or2(ex);
    }
    catch(Ex3 |
          Ex4 ex) {
      handleEx3Or4(ex);
    }
  }
 
  public static Map<String, String> diamond() {
    return new HashMap<>();
  }
 
  public static void diamond2() {
    Map<String, String> map = new HashMap<>();
  }
}

Update

I filed bugs 3404387 and 3404389.

Posted in DrJava | Leave a comment

Print This Print This   Email This Email This

Presidential Active Lifestyle Award

I just completed the PALA challenge: Five days of exercising at least 30 minutes, for six out of eight weeks.

I’ve run about 72 miles (115 km), biked several times, and I’ve zumba-ed (if you just look at the instructor, and not at yourself in the mirror, you can pretend that you are an amazing dancer).

Presidential Active Lifestyle Award

Presidential Active Lifestyle Award

I’m pretty satisfied with myself. In absolute terms, this is probably not an achievement worth mentioning. It’s not getting me to the Olympics1. But in relative terms, it is. I have become a much better me. I’m 31 years old, I finished grad school, I’m working full time, and I’m in the best shape of my life.


Footnotes:
  1. Unless you’re talking about the Olympic Mountains, in which case, it does get me there. [back]
Posted in Uncategorized | Leave a comment

Print This Print This   Email This Email This