Stump Extracted

Using sheer determination and a couple of shovels, I dug up this stump from the area I plan(ned) to use as a garden. I didn’t need to dig it up, but it suited me better to have a more uniform garden space. I also enjoyed the challenge of it and having an excuse to play in the dirt.


Click image for big version

This reminds of a Czech movie, Little Otik (Otesánek), I saw a few years ago where a woman wants to have a baby but can’t, so her husband carves one out of a stump or something. It comes alive and starts eating people. It’s a great movie. Scary. Creepy. Recommended.

Posted in gardening | Tagged , , , , , , | 1 Comment

Ruby on Rails… Revisited

Updated with links and a couple typo corrections.

I’ve been working on a fairly big Web site project lately. My partner and I initially decided to use Django to build the site, mainly because I’m a Python “expert” and Django is (apparently) the #1 Python Web framework. We were also lured by the easy admin interface.

After trying to use Django and not really enjoying it, I tried switching to Pylons because I’ve had a good amount of experience with it in the building of byCycle.org. It’s gone through two fairly major releases since then, and so have a bunch of the libraries that tend to get used with it, like SQLAlchemy, Elixir, etc.

I was having a hard time with the Pylons docs, and so I ended screwing around with Grok (which actually looks fairly interesting) and even took a look at the Zope 3 site. I’m sure Zope is really awesome or whatever, but it might as well suck. Every time I look at that site, I’m just like “WTF! This shit has been around for like five years!” Anyway, I might just not be smart enough for Zope.

This led us back toward Rails (even if it is a ghetto). I used Rails a bit last year but never did anything too serious with it. Diving into it today was quite a pleasure. There are issues to be sure, but overall I’m enjoying it by far over any of the other options we had tried. I’m also enjoying learning/relearning Ruby.

If Pylons had good docs, we’d probably be using that.

So, I don’t know if this is a particularly useful post, since I didn’t get into much in the way of reasons (what, i have back this up?!). This subject’s been hashed and rehashed, but I just wanted (needed) to make a qualitative statement about my/our experience, which, of course, is purely personal.

Posted in dev, planet python | Tagged , , , , , , , , , , | 11 Comments

Soilwork

I’m about two thirds of the way toward having the soil in my garden prepared for planting. I got all the weeds pulled, and I’m currently working on digging out a stump. Once that’s done, I’ll just need to till up the dirt and maybe add some topsoil. Then I can move on to the fun stuff. Actually, digging up weeds and stumps is fun too, and it’s foundational. On top of that, it’s a good upper body workout.

The kitties were having a blast running around and chasing each other all over the yard. They are way more active when someone’s outside, which is interesting. They’re somewhat like (certain) people in that way.

According to Wikipedia, “Soilwork is a Swedish melodic death metal band from Helsingborg.” I’ve never listened to them before; I’ve just heard the name and thought it was cool.

Posted in uncategorized | Tagged , , , , , , | Leave a comment

WordPress 2.5

I haven’t seen any posts about WordPress 2.5 on Planet Python yet, so I thought I’d make a quick mention of it. RC2 came out today. I installed it on a test site, and it’s looking pretty sweet. Definitely worth a look. The admin interface is much improved–easier to navigate, reduced clutter, and a new, lighter feel. Also, amongst other things, photo galleries are now built in.

Anyway, I just wanted to mention that I think it’s worth a look. For details, check out these posts over on the WordPress blog:

http://wordpress.org/development/2008/03/25-sneak-peek/
http://wordpress.org/development/2008/03/wordpress-25-rc2/

Posted in planet python | Tagged , , , | Leave a comment

Blazers vs Wizards

I just got home from yet another Blazers game. Philip M got free tickets through work again. I met some of his coworkers, and there might even be a job opportunity that comes out of this. Cool.

This time we watched from a “sky box.” You can’t see the individual players and moves as well, but it’s a great vantage point to keep an eye on the whole game. It was a fairly uninteresting game, but it was a fun experience.

Blazers vs Wizards from sky box
A dark & blurry view of the proceedings.

Philip and I spent most of the time chatting about relationships and love and meeting new people and what not. That was good. Very therapeutic, although we didn’t arrive at any definite answers to the harder questions/issues.

Blazers vs Wizards - view above skybox
A semi-interesting photo of the view above our heads. It took me a while to notice this.

Posted in social | Tagged , , , , , , , , | Leave a comment

The Farm

Friday night started with dinner at The Farm with Philip. Michael B. stopped by also and had a couple beers with us. The Farm “support[s] local farmers by buying direct when ever possible.” They are located at SE 7th & Burnside.

I had a cup of split pea soup. Philip and I both had the “Herb Crusted Tofu with Mushrooms Marsala.” Holy shit! That is some good grub. Menu.

From the outside, the place looks like kind of dump, but inside it’s quite nice and homey–in fact, it’s in an old Victorian house.

Slightly spendy but definitely recommended.

Posted in social | Tagged , , | Leave a comment

First Ramble in Two Weeks

In spite of pain from having my wisdom teeth removed and a secondary sinus infection, I decided to tough out a two hour, fast ramble this evening. I went to the oral surgeon for a checkup today and everything looked “pritty gud.” Sitting around the house was getting old, so I decided to go for it. I wasn’t sure I would make it, but since I’m such a badass, you know I did. I pushed myself maybe just a tad harder than I “should” have, so I might be sitting out Thursday’s ramble (gotta “date” anyway, so… yeah, skippin’ it).

It was a stair ramble, my first. We climbed about two thousand stairs. We also climbed some pretty major hills. Blah blah blah. Here are some photos (as usual, taken with iPhone & edited with GIMP).

Stairs from bottomStairs from top

Downtown through foliage at top of stairsSome other stairs from bottom

Downtown with mountains in background

Moon

Moon and buildings downtown

Posted in health | Tagged , , , , , , | Leave a comment

iPhone as Primary Internet Device

So, “whiddiya do” when your home Internet access is cut off without warning*? Especially when you’ve just had your wisdom teeth extracted and don’t have much else to do (except lay in bed with the kitties and read Timeline by Michael Crichton)? Use yer iPhone, of course! So, how well does it work? Pretty well, all things considered–about what you’d expect from a tiny l’il computer talking to the Internet via an EDGE cellular network connection.

Checking and reading email is a breeze. Writing email is slow but not too bad, as long as the recipient understands that you’re being concise and not terse. Taking photos of the kitties and emailing them is always fun, especially when you’re on a call at the same time.

Browsing the Internet is decent too–sometimes fast, usually not too slow–especially sites like Gmail or Ta-da Lists that have mobile-specific versions of their sites. Note to self: create one of these for byCycle (right after we get some funding and finish up the other thousand items on the byCycle to-do list–any volunteers?).

Side note to Web developers: Flash-only sites with no alternatives suck. At the very least, throw up some text saying that Flash is required. I know this sounds soooo obvious, but even in 2008, it still happens. Another advantage of a text-based, flash-enhanced (or, better yet, DHTML/AJAX) site: it works on iPhone/Safari for free.

In some ways, iPhone is superior to a regular computer. I love the way scrolling and zooming work (fingertips on the screen). Apple’s latest laptop utilizes this technology in its trackpad. The 64GB solid state drive is pretty cool too. I’m more of a Linux fan, but I might consider one of these at some point–maybe in a year or two when the price on the solid state version drops a bit.

I wasn’t able to write this post at home on iPhone, but I should try that some time. Many mini-posts might be an interesting experiment–trying to condense a topic/thought/feeling into a few sentences, reducing it to it’s bare essence and not going off on a bunch of tangents.

Posted in technology | Tagged , , , , | Leave a comment

New Site/Blog

I’ve decided to abandon Mephisto for running this site, since the Mephisto project appears to have been abandoned. Plus I heard that Ruby on Rails really sucks after all. Who knew? On top of all that, WordPress is simpler to deal with and doesn’t crash all the time. Blah blah…

If you don’t know what the hell the above paragraph is on about, that’s OK. The gist of it is, I’m changing the software that runs this site. The practical effect is that A) the style is different and B) all the old posts haven’t been moved to this new site yet.

Perhaps with this change, I’ll be inspired to blog more. We’ll see.

Posted in site | Tagged , , , | Leave a comment

Erlang Linked List Exercise

Yesterday, my copy of Programming Erlang arrived in the mail1. w00t! I’m already part way through chapter three. I don’t know what it is about this language – maybe it’s all hype and a passing fad – but I haven’t been this interested in learning a new language since I started with Python over two and half years ago.

The day before yesterday, I took a shot at implementing a linked list in Erlang. I had one basic rule, which was that I wasn’t allowed to use the built in list type. Getting started was fairly difficult, but once I started to “get it” (e.g., pattern matching, recursion), the task got much easier.

Previously, I had only played around in the shell, so this is the first Erlang module I’ve written. Erlang modules are similar to Python modules, though to make functions available outside an Erlang module, they must be explicitly exported. I haven’t yet come across whether Erlang modules can be organized into packages, although I imagine there must be some kind of higher level system for organizing Erlang programs.

Recently, I did a similar exercise with Python as way to experiment with Behavior Driven Development. That version uses the familiar “destructive assignment” operation throughout. Erlang allows single assignment only, so I had to think about the problem in a different way. For example, an item can’t be appended to a list by manipulating a couple of object references as in Python—instead I used recursion to build up a new list.

After I get further into the book, it will be fun to come back to this implementation and see how it can be improved given a better understanding of the language. I’m also looking forward to exploring Concurrency Oriented Programming in depth. With Python, I tend to not think in terms of concurrency, though I’m sure I’ve got code that could be improved by using it.

Finally, here’s the code. It was written in Emacs, which has a nice Erlang mode. There are two other IDEs available, one based on Eclipse and the other on NetBeans.

-module(linkedlist).
-export([new/0,
     head/1,
     tail/1,
     append/2,
     nth/2,
     last/1,
     length/1,
     is_empty/1,
     main/0
    ]).

-record(list, {head, length=0}).
-record(item, {data, next}).

new() ->
    #list{}.

new_item(Data) ->
    #item{data=Data}.

head(List) ->

    List#list.head.

tail(List) when List == #list{} ->
    undefined;
tail(List) ->
    Length = linkedlist:length(List) - 1,
    #list{head=next(head(List)), length=Length}.

append(Data, List) when List == #list{} ->
    List#list{head=new_item(Data), length=1};
append(Data, List) ->
    Item = append_item(Data, head(List)),
    NewLength = linkedlist:length(List) + 1,
    List#list{head=Item, length=NewLength}.

append_item(Data, Item) when Item#item.next == undefined ->
    Item#item{next=new_item(Data)};
append_item(Data, Item) ->

    Item#item{next=f(Data, next(Item))}.

next(Item) ->
    Item#item.next.

% Get the Nth item from List
% N: Index of item to get
% List: List to get from
nth(N, List) when N < 1 ->
    undefined;
nth(N, List) ->
    nth(N, 1, head(List)).

% N: Index of item to get
% I: Current index
% Item: #item in List corresponding to index I
nth(N, I, Item) when I == N ->
    Item;
nth(N, I, Item) ->

    nth(N, I + 1, next(Item)).

last(List) ->
    nth(linkedlist:length(List), List).

length(List) ->
    List#list.length.

is_empty(List) ->
    List == new().

p() ->
    io:format("\n").
p(Object) ->
    erlang:display(Object).

main() ->

    L = new(),
    test_list(L, "New list"),
    L1 = append(data1, L),
    test_list(L1, "List with one item"),
    L2 = append(data2, L1),
    test_list(L2, "List with two items"),
    L3 = append(data3, L2),
    test_list(L3, "List with three items"),
    ok.

test_list(List, Description) ->
    io:format("~s~n", [Description]),
    Length = linkedlist:length(List),
    p({'list', List}),
    p({'head', head(List)}),
    p({'tail', tail(List)}),
    p({'first', nth(1, List)}),
    p({'nth', nth(Length, List)}),
    p({'last', last(List)}),
    p({'length', Length}),
    p({'is_empty', is_empty(List)}),
    p(),
    ok.

1 A new blade and O-ring for my old-fashioned Oster blender came also. Double w00t!

Posted in planet python | Tagged , , | 2 Comments