Archive for December, 2007|Monthly archive page

ATM Fees

I was in Inman square last night going to the Family show at Improv Boston. I needed to get some money and saw a Bank of America
ATM machine and balked. Their fee is $3–ridiculous. My bank refunds me fees because they don’t have an ATM network but only up to a limit, $20 a month. So I try to keep an eye on these things but also to make a statement.  Next to Punjabi Dhaba (or maybe a couple store fronts up Beacon) was the Portegese Credit Union. So I used their ATM and paid $1 to access my accounts. Ha! Take that BOA.  I can’t find it but I’m I’ll try to find a table of ATM fees by bank. Lets stick to the cheap ones.

Waitress

I’m at home sick today so I’m working through my backlog of netflix moveis–one cannot live on West Wing alone. Something in the movie Waitress made me choke up (I’m a romantic at heart–don’t tell anyone):

“I was addicted to saying things and have them matter to someone. “

That’s a quote from the movie Waitress.  wow.  Yup, I think that might be a huge component of love. I think that’s what us single people miss about relationships.

Peccadillo Rocks!

Peccadillo, one of the Improv Boston graduating class consists of Maile, Lany, Rob, Jimmy, Craig, Sasha (not shown), Brent, Grace and Annie. Steve our director whipped us into shape for a great show. We Rock! Great job guys!

bad code?

I’m working getting Jay Fenalson’s hack up and running on OS X Leopard. While debugging the code I ran into this sample code that exemplifies Jay’s coding style which I really don’t like:

for(foo=(int *)levl; foo <= (int *)&levl[NX-1][NY-1]; *foo++ = 0)

Take a good look at that. What the heck is going on? Well, he’s converting levl, which is of type:

struct lev levl[NX][NY];

So really levl is type struct lev ** (well, sizeof would disagree about this as levl is a specific size but for the sake of this discussion struct lev ** is fine). Well, he’s type casting that to int * and putting that into foo. I’ll cover the incr part of the foo loop explaining the test.  He’s checking to make sure foo, which contains the address of an array of lev structures–remember each element of the array is a pointer, doesn’t run off the end of the array of levels.  OK, back to incr expr of the for loop,  *foo++ = 0.  John Ousterhoot said that parenthesis should be added when the order of operations is not clear. Is it clear here?   Obviously the intent is to null the array, the deref occurs first then the assignment and finally the increment (actually the generated code copies foo to a tmp, increments foo and then uses tmp for the deref and then assignment).  Precedence aside,  wouldn’t the code be easier to read if it was:

*foo = 0, foo++;

The comma operator in C, evaluates multiple statements as one statement, using the last statement as the return value.

This is how I tend to write and therefore teach people Perl. Although there is more than one way to do it, it’s not necessarily the right way. Write it readable and  let the compiler take care of the rest. If it’s still too slow, and most likely it isn’t, then go back and optimize.

Libraries Rock!

I’ve been keeping a fairly regular schedule since enter the ranks of unemployment. I hit the gym in the morning and then spend 5+ hours at one of the Minunteman network libraries.  I park myself in a cubical and search for jobs, research companies, and work on my own projects. I’ll post a blog entry about my project later. I vary the libraries I’ve been visiting to keep things interesting, although I probably should just stick with the Waltham library as it is a short walk from my home.  Anyway here are some of the libraries I’ve visited and my thoughts.

Newton – amazing. This could easily be a major University’s library. It has a beautiful atrium area and graceful spiral staircas. The views of the cemetery are calming and beautiful (it is winter now and the snow, as James Dubliner used in his short story “The Dead”, enhances slumber of death). I love it here.

Bedford – I like it. It’s a straight forward library with very helpful staff. I used cubical with an ethernet cable because the wireless, for some reason beyond me, wasn’t extended to that wing of the library. But actually being plugged in has it’s advantages–the network latency is much lower.

Waltham – I love their A/V department. They have a fantastic selection of movies that I can rent for a week for $1. I love it. I found a nice cubical near a window on the top floor.

Arlington – I want to visit it. I even tried yesterday after visiting my chiropractor Rob.  Plug: If you need chiropractic care go to his new clinic, ChiroCare in Arlington Center.  One thing I like about the Arlington branch is they let you take out pictures of art like books. Treat yourself to some new art work in your apartment for a month–what a great idea! I might have to try this sometime. Unfortunately on Thursdays they don’t open till 1pm. I find that a little strange even though I’m sure they have their reasons.

Anyway, for a long time I would go to coffee shops and use their free wireless to work. I would, of course, be guilted into buying something since I’m using their internet access. This was not good for my pocket nor my waste line. At the library I don’t have that problem–I’m guilt free! Libraries rock

Where Would I Work?

A little while ago I was let go by my past employer. No hard feelings on my side and I hope none on theirs.  It was amicable I believe. So I’m looking around for work in the Boston area. While I could move to another part of the country, I’m quite happy in Boston. But if a particular company called would I move? What companies would get me to move? Well, after a recent purchase of a MacBook Pro to allow me to be mobile in my pursuit of a job, I would consider Apple. Google? Yes, but they have an office in Cambridge. Anyway, if they wanted me somewhere else I would consider it.  Oh there’s also ActiveState. But I’m not sure if they’ve jumped the shark.  At one point they were the bees knees (is that expression applicable here?) in scripting language support and tools. I don’t know if they are anymore. They are based in Vancouver, supposedly a fantastic city albeit an expensive one.  That’s my list so far. I’ll have to keep thinking about it. If Microsoft called and said they wanted someone to work on scripting support in .NET I might not be able to resist. But, my guess is they have enough people working on that from what I’ve seen in conferences (Ruby, Python and I believe Perl are all working in .NET).

java: anonymous class instance via interfaces

It’s my day job and I enjoy it, particularly learning a new language and tying it back to other languages. I just wrapped my mind around some interesting aspects of Java. You can create an anonymous class by allocating an object via an interface and populating it with public and private items. This is particularly interesting. C# might try to accomplish something like this via delegates but it’s not entirely the same I believe.

In Java you new the interface and give it methods e.g.:

interface CompareOp {

int Compare(Object o1, Object o2);

}

foo = new CompareOp() {

public int Compare(Object o1, Object o2) {

// somecode

}
While it is not necessary to create the anonmyous class, it does I believe lead to better programming style. If you add another method to the interface you are forced to add it to all instances that implement that interface including the anonymous class.

Like most people I assimilate new ideas by grounding it in what I already know. So, how could this exist in Perl5 ?  I’m not familiar with Perl 6 yet so I’ll stick with what I know. Not well, I believe.  Perl’s classes are in fact packages with the methods existing in that package and accessed via references that have been blessed with that package. Note, I did not say “blessed into that package” for the reference doesn’t exist in the package. No, the reference exists outside the package but when a method is invoked through that  it changes the scoping to look in that package. So to create an anonymous class instance one would also have to create an anonymous package. I don’t see how that can work without leaving side effects that would have to be undone. I would use eval() to create the package. However I don’t know how to *delete* a Perl package.  So I don’t see anonymous class instances working in Perl (let alone there is no clear support for interfaces as the title of this post would force me to try to be consistent).

Nice! A new feature in a language that I haven’t seen else where.

Creating Something

My friend Ryan is visiting his parents next week to help finish off a barn his father is working on to house his hobby: tractors. I am a bit jealous of him. I work in software so I don’t create things in the physical world. Don’t get me wrong, I love my work (interesting design patterns, reflection, java, .NET, IDEs), but there’s something about building something in the physical world that evokes a different kind of pride. “Hey! Look at that, I built it!” (perhaps carpenters take a unique pride in the the software they might write?) When commenting on this to Andrea, she said I do make music. So I thought I should post something I’ve created. My contribution to the musical world, a song I wrote. On mandolin is Carl Jones an accomplished mandolin player and nice guy (my favorite quote about him is “he sure talks a lot for a quite guy”).

If anyone is interested I can post a guitar tab for the song.

DRAT! WordPress block posting of MP3s–which makes sense considering I guess to avoid potential lawsuits.

Peter Mulvey

[ Opps, this should have been posted just after the concert on October 11th. It's been hanging out in my drafts box. - Craig ]

I recently went with my friends Liam and Susan (and little Pedro) to see Peter Mulvey in concert. The last time I saw Peter was when he did a free, albeit brief, show at the Music Emporium in Lexington MA. I knew he was a good guitarist, but I was blown away. He was amazing at Club Passim. If I were to put him up against my guitar czar, Ryan Montbleau, I think I’d have give the edge to Peter. He’s bopping around the stage standing and closing his eyes as his fingers fly around the fret board. His banter is great–”There will be cat-scans of my brain available after the show for $3″. He was strange, but delightfully so. But he’s an interesting, full person–at least it seems that way. That little clause was because I’ll bet Mr. Mulvey would laugh at someone calling him a “full person”. I know I did when someone said “I [me] get life” ™. Anyway, the persona is an amazing balance between a growing individual with introspection, and mirth. But to his songs. His song whose title I’ve forgotten but features the characters of “January Medley” and Dynamite Bill is amazing. Bluesy words and music. It really grabs you. I really want to get Peter Mulvey and Ryan Montbleau on stage together and have them discuss their music and life on the road. It would be cool if they would try to cover each other and discuss, in laymen’s terms, how they interpreted each other’s songs. There was a stark difference between the opener, Naomi Sommers and Peter Mulvey. Naomi said it well, and Liam repeated the phrase to remind me of it’s truth. After Peter left the stage after joining her for one song she said, “I feel like the band has left the stage”. She was right–sonically Peter is so full it feels like there are multiple musicians playing. Wow.

Mr. Mulvey please never stop making music. Never stop touring…”That same old thirst for more until they put me in the dirt”.