Home

Sun, Oct. 11th, 2009, 03:53 pm
Lisp

Tacking a new method onto an existing class...

Integer
.of
  Method :: squared
  .is
    @ * @

3 squared

= <Integer: 9>

Sat, Oct. 10th, 2009, 10:07 pm

I think I fixed the parser.  I had to resort to append instead of straight cons to build up the parse tree but I imagine it can be refactored (not that I care to do so, cons-lists in cons-lists are painful enough let alone cons-lists in cons-lists being manipulated in Java).

Thu, Oct. 8th, 2009, 08:35 pm

Latin was worth it!

Sat, Oct. 3rd, 2009, 07:37 pm

Today I stopped for a vanilla cappuccino at lunch.  I think I'm coming down with yuppyism.  It must have been that Starbuck's outside of the hotel in California.  Ordinarily I wouldn't go in such a place, but it was much more convenient than walking down to the grocery store for a bottle of water.

Wait...Bottled water?  That sounds yuppyish.

It's worse than I thought.

* * *

In Lisp news, I keep on running into trouble with the parser.  Every time I rewrite it or tweak it I seem to miss something.  The problems keep on coming up with this rule:
a b c
.x y z

de-layouts to
( (a b c) x y z )

I think I might have created an LL(∞) grammar.  I wish I had a little more background to draw on.

Sat, Sep. 26th, 2009, 07:25 pm
Home

Not doing that again for a while.

Sun, Sep. 20th, 2009, 06:56 pm
Random Thoughts

Having to eat out every night got me thinking on the subject of tipping. How do I decide what to tip inside that 15-20% acceptable range? There's really not much the waiter can do to tilt the balance either way.

How fast I'm seated is a function of the other patrons. I only occasionally need the waiter to describe a menu item. The cooks are responsible for how quickly my food is ready. Pretty much the only objective measure I have is how long it takes for my water glass to be refilled (and some of the blame for that is on whoever chose the 8oz glasses over the 12oz).

Instead maybe I should tip on the harm/benefit I cause the waiter (as opposed to the average patron). For example, if I'm seated at a 2-seat table my presence is hurting the waiter since that table could be occupied by a two-person party yielding a tip twice as large, so I should tip higher. Inversely, a party of filling their booth table should tip less since they're providing the maximum return on that table. Similarly one should tip more if you eat slowly since otherwise your table would be free to seat another patron earning the waiter another tip. Also you should tip more when purchasing a cheap dish, but less for an expensive dish.

- - -

To channel as much insanity out of my brain, I'm going with an Object-oriented lisp variant. It's going to be so horrible that the symbol table is an object and you define new types by invoking the add-type method on the symbol table.

Writing a Lisp seems to involve a lot of bashing you head into a wall. I keep on running into the question of when does 'x' mean the symbol 'x' and when does it mean evaluate whatever 'x' is bound to. I puzzle over that, realize the root of the problem is when is (+ 1 2) a list containing '+' 1 and 2 and when it's just a CPU-intensive way of saying 3. After concluding that this will never work I realize that there is no such thing as the variable 'x'--it's always a symbol, if you want what's stored in 'x' you're saying something like "Lookup the symbol 'x' in this object"--and the whole problem goes away, 'x' is always a symbol.

- - -

Also on restaurants, why don't they give you menus and let you order while you're waiting for a table? Why make you wait 15 minutes for a table, then wait another 5 minutes to collect your order, then wait another 10 minutes to cook the food?

- - -

I swear the hotel's AC is plotting behind my back. Whenever I'm in the room it's running, putting out cold air and bringing the room to a nice 76F. Whenever I come into the room however the temperature has managed to climb to 78-80F in my absence.

- - -

With all the Chinese/Japanese/Misc. Asian places around here I figured I'd give the chop sticks a try.

I don't see what the fuss is. Primed with a few you-tube videos I ate nearly all of my twice-cooked pork with them (toward the end the last bits of rice had soaked up the sauce and no longer stuck together well). It seems like once you get them parallel (which I admit takes me a minute or two each time I pick them up) it's effortless.

Sat, Sep. 19th, 2009, 10:40 pm
Stuck in California

Last week I came out here to debug an application on-site. On thursday I agreed to stay an extra week to continue making last-minute fixes. Now it's saturday and I've just realized what I've done.

The 2-seater rental car feels like I'm sitting in a pot hole. I don't feel safe driving more than a few miles. Especially not in California traffic. I have a theory: it's not that the people out are bad drivers. Sure they have some strange delusions like right-of-way for pedestrians, but it's not their fault. When you get to an intersection, you're presented with four choices here: a right-turn lane, a go-straight lane, a left-turn lane and a u-turn lane. So every intersection results in a mad scramble to get into the correct lane.

Handling the situation though minor insanity failed. GHC refuses to compile my code with the cryptic error "C:\ghc\ghc-6.10.4\network-2.2.1.2/libHSnetwork-2.2.1.2.a(Socket__531.o):fake:(.text+0x51c): undefined reference to `getnameinfo'" So the only logical thing to do is start writing a Lisp.

Wed, Sep. 9th, 2009, 09:29 pm
Brain Broken

Yesterday I was writing Java code fixing yet another overlooked feature request for the end-of-september go-live (always fun when the clients don't even know what they want the system to do). I found a case where a map could be used but fortunately stopped myself before I got around to "public class Transform<A,R>".

I should have taken that as a warning sign. Today I threw away some perfectly good Perl code just because I thought the data looked easy to process as a cons list. Of course I don't know the Haskell equivilent of List::Util::shuffle so...

The Horror... )

...and people think Perl's opaque.

Tue, Sep. 1st, 2009, 09:42 pm

It's been three days since I've got back from California and my internal clock is still off.  It feels like it shifted the wrong way and I'm on Hawaii time now.

Sat, Aug. 22nd, 2009, 08:11 am
Found this in my Inbox...

The Japanese take on Nigerian e-mail scams: polite, rational, well-written:

Hello Desired Lawfirm,
Please confirm the receipt of this mail if you are in a position to represent on our company in matters of delinquent accounts.

We contact you to represent our company after a careful review of your profile. We are of the opinion that you represent us in North America and other part of America/Canada in order for us to recover monies due to our organization by our America/Canada clients.

In order to achieve these objectives a good and reputable law firm like yours will be required to handle this service. Please advice once you take in this issue.

Once more thank you for taking time from your busy schedule to read this mail.

Wed, Aug. 12th, 2009, 07:44 pm

Ran across one of those 1st and 2nd amendment rights are now un-american under the present administration comments.  Do you realize that if this trend continues with the 3rd through 8th, President Obama will end up being serious about national security AND tough on crime.

Think positively people!

Sat, Aug. 8th, 2009, 10:43 am

Learned to play riichi mahjong.  Very addictive.

Wed, Jul. 15th, 2009, 06:54 pm

Amazon wins.

Thu, Jun. 25th, 2009, 08:10 pm

Luckily I finally figured out what Haskell's monads are (and it's scary, I think these things have more firepower than Lisp macros).  I'm going to need to move on the smalltalk soon, the logo is makes an irresistible argument.

Mon, Jun. 22nd, 2009, 06:38 pm

Just implemented Haskell's Either type in Java.

unclean...

[Edit]

It's getting worse.  I just refactored a clunky Java class into something that looks suspiciously like a mix of Haskell's algebraic types and closures.

...and then spent the rest of the day writing a page-long comment so the unenlightened java programmer that comes after me has a chance.

Sun, Jun. 14th, 2009, 11:39 am

Nifty: http://www.fritolay.com/our-snacks/where-to-buy.html. It's hard to find the chili-cheese fritos around here but this saves a lot of time. Why can't there be similar services to track down live wire mountain dew?

Fri, Jun. 12th, 2009, 06:45 pm

I've been taking a stab at learning C#.  It's interesting.  When I encountered C++ (coming from C), I felt like I was moving backwards language-wise in spite of all the new features C++ supported.  I'm getting that same feeling now moving from Java to C#.  C# plenty of features that Java doesn't, yet I feel like I'm going backwards learning it.  I hope I can force my way through this, I never did learn C++ well.

Sun, May. 31st, 2009, 11:41 am

Off to California on Monday.

Fri, May. 22nd, 2009, 08:36 pm

Discovered the power of git checkout-index today.  Creating a branch has really pushed me to learn the commands.

Travel plans are finalized: I'm heading out to California 1st week of June.  The Java disaster I've been coding for the past month will get to terrorize its first users.

Thu, May. 21st, 2009, 06:53 pm

Nifty trick I just tried:

Take a pound of bacon, weave it into a mat and cook it in the oven.  Then cut it into squares and freeze it.  30 seconds in the microwave and now any burger/sandwich can be a bacon-burger or bacon-sandwich.

The only hangup was the bacon mat came out to 7 strips square making it a bit difficult to cut.  Even so the squares remained intact.

20 most recent