07 May 2007

Haskell Update

Computerisms

The good news is I think I grok monads. They make sense now. What was holding me back for so long was the syntactic sugar that masked what they were actually doing. It supplied an aura of magic which was really hard to cut through. Once I saw how the monad value was passed transparently in a sequence in a do construct it clicked.

The bad news is I still can’t get ghc for freebsd on amd64. I found some mailing list posts from mid/end of April on the topic. It looks like work is being done. It feels like it will be done quickly. But I hope I still have ambition to work in Haskell by the time that rolls around. It feels very much like a neat and powerful language with a lot of personality.

But I can actually do things in Python.

07 May 2007

View From Home

Bloggy Stuff

My mom sent me an email today and included a picture from where I grew up. I’m slightly bitter and jaded because of the isolation, but it really is a beautiful and magical place. For those who didn’t know, fifty percent of my english final was based on an essay about a place. I wrote about here and I lost only a single mark that I’m sure is from spelling or the like.

25 Apr 2007

English!

Bloggy Stuff, School

I got 90% on my English final!

22 Apr 2007

Haskell Code Number One

Computerisms

So I decided to stop reading tutorials and actually try to apply some of what I’ve been learning and write my own program. I’ve been musing about doing a massively multiplayer online space strategy game so I decided to start defining simple base for that and build from there.

Functional programming is… well it’s neat. And different. I fought for a long time with almost every data definition and function I wrote, but as the hours wore on it started to feel more and more natural and I went back and re-factored a bunch of my code. In no time flat I had everything up and working great. One little problem. Something felt wrong. I wrote a function to recursively blast alterations into my list and when I checked it out it looked like it wasn’t freeing memory and keeping a copy of each list ever touched. Bummer.

I dropped into #haskell and asked for advice. Man. I got so many things I didn’t understand thrown at me, also a few compliments. Apparently for a first solo Haskell project, my code was far more Haskell like than expected. Anyways, I had a bunch of things pointed out to me to fix or improve and was introduced to the concept of thunks. Haskell has lazy computation which means it only evaluates things when it needs to. Thunks as I understand are partially evaluated computations which sit around taking up ram waiting to be useful again.

Pretty sure I have to go back to trying to learn monads better to fix it though.

Code: here
Executable: here

19 Apr 2007

First Haskell Tutorial Finished

Computerisms

I just finished off the Haskell tutorial I was running through and I feel slightly enlightened and also disappointed. My expectations were fairly simple. By the end of a 150 page introduction to a language I should feel like I can do something interesting with it. Interesting being defined by me in any way I like. I didn’t get that feeling with Two Dozen Short Lessons.

The entire body was overly technical and I spent more time beating my head against understanding the content of the examples than I did trying to grok the actual Haskell lessons. I found it very neat to be walked through building a DES cryptography system, but I don’t feel it made me understand Haskell better.

On the upside, I can now look at Haskell code and generally work out what’s going on. The syntax mostly makes sense to me, though the typing of functions still messes with my head from time to time. Some of the random code flying past on #haskell is becoming less alien. I’ve written a few small proof of concept tools and am gaining more confidence and comfort with the language.

However I don’t feel ready to set out on my own and write something real world that solves a problem yet. I don’t think I have enough of a grounding in Haskell and its workings. So I’m off to find another online tutorial to work through!

17 Apr 2007

The Internet Doesn’t Forget

Bloggy Stuff

I found my old website that I did back in my first year of University. Man I was horrible. This wasn’t even my first website. It was my third attempt at a website and ugly as sin.

My previous attempts were worse. At least I had stopped using frames by then. And no animated GIF’s or marquee or blink tags.

15 Apr 2007

Strawberry Coconut Sauce

Cooking

I was out shopping with Erik and Kate and got it into my head I would try cooking *something* with coconut milk. At seventy cents and over two hundred percent my daily recommended intake of saturated fats per can, I couldn’t go wrong. So I bought two. Then today Erik mentioned he was going to throw out some strawberries. Can’t have waste so my mind started spinning and came up with a plan to make something of these two things.

Ingredients:
Coconut Milk – Half can (200 ml)
Strawberries – Four good sized ones
Mozzarella Cheese – Chunk
Nutmeg – Pinch
Salt – Pinch

Sauce:

1) Pour milk into pan and bring to boil
2) Dice cheese and toss in pan
3) Slice strawberries and toss in pan
4) Pinch nutmeg and salt into pan
5) Cook on medium heat until thick

I added the cheese mostly to make the sauce not so liquid and thicken it up a bit. I’m not sure what else I could have used as a thickening agent with coconut milk. I’ll have to look into it.

I put this on fettucini noodles and it looked… well… limp. Smelled very interesting, strawberries yet somehow more subtle and masked. The actual flavor was deeply progressive. By that I mean the flavor progressed through stages.

First bite was a very mellow strawberry flavor with very soft undertones. It stayed like that for a while until I noticed a gradient. The softness was actually a fatty taste not unlike licking a block of margarine. As time progressed the strawberry flavor seemed to fade away and the fat became stronger and stronger. I couldn’t finish it the sensation was so strong.

It was an experience and I feel more enlightened because of it. I’m not going to try it again.

15 Apr 2007

Ghostbusters Party

Bloggy Stuff, Cooking

We had a ghostbusters themed party at our place yesterday which went off fairly well. Lots was drunk and much green food coloring was used. We watched both ghostbusters movies, saw Ron Jeremy , and ate too much sugar. Annnyways, I made a cake!

15 Apr 2007

Haskell Stuff

Computerisms

While working through the haskell tutorial I came to a point where they’re teaching about modules. Basically how to load up and import libraries. Fairly standard stuff. The haskell way to do this makes sense and I have no issues with… but the chapter teaches it by getting me to build DES encryption.

Seriously. My brain hurts from the concepts and math of the encryption, not from the programming logic. Also of annoyance is the so called helpful library they have in the appendix which you can download from their website. For non standard definitions of can that is. I could be retarded, it has happened to me before. However, I could not find it, nor could Google .

I’ve gone and formatted it all pretty like and put it on the web:
SequenceUtilities.lhs

12 Apr 2007

My First Job

Business, Stories

When I was six I wanted a remote controlled truck. It was bright blue and in the Sears catalog. I wanted it real bad but my parents told me they wouldn’t buy it for me. I had to buy it myself. It was a hundred dollars. That much money to me seemed insane.

My parents both made crafts and went to craft shows to sell their wares. I asked if I could sell stuff too and they were overjoyed. I made little fluffy things out of Fun Fur: little snake with googly eyes that rose up when you petted it and tufts glued to the end of pencils to look like those little troll dolls. Each one was priced at a dollar and my mom subsidized my venture by buying all the materials. I had to sell a hundred of them to buy my truck. I was an ADD kid so I couldn’t even count that high without getting distracted.

Time rolled on and slowly over the course of a dozen or so craft sales my pile of cash grew and grew until I had enough. Just for me my parents made the three hour long (round trip)journey into the city. I was so excited. I had worked so hard and now I was getting what I wanted.

Life rarely works out as planned unfortunately. The truck also required one of those fancy batteries that wasn’t included. The kind that cost another $40. My parents didn’t come to my rescue. They just told me I’d have to work harder to afford the new cost. On the way back I was in tears, my heart broken. My mother then told me that I shouldn’t be sad, and to remember the smiles of the people I sold my stuff to. Money was just a way to say thank you, but the real reward was in making other people happy.