Why does an array index start at 0, not 1

Posted by Nick Sieger Thu, 27 Jul 2006 14:57:00 GMT

If you were looking for an answer to this question, you apparently cannot get a straight one in the java forums. Just one of many choice quotes:

Anyway, any logically counting would start at 0.

I tried that once. I referred to my son as “Number Zero Son”. Got a definitely negative response.

Posted in , ,  | 5 comments | no trackbacks


Posted by Nick Sieger Tue, 06 Jun 2006 15:03:00 GMT

Spotted the following thread on ruby-talk:

Pat Maddox: I hate when languages put a condom on my code.
Gennady Bystritsky: What does it make your code, then? ;-)
Mat Schaffer: Pregnant!

Posted in ,  | Tags  | no comments | no trackbacks

Alley Liberties

Posted by Nick Sieger Thu, 01 Jun 2006 03:54:00 GMT

And now, a break from the tech- and ruby-related tidbits to add some color to a local issue.

Today a news story of seemingly minor consequence passed through the local news outlets on a proposal for a possible new Minneapolis city ordinance:

The proposal would prohibit anyone from walking in an alley who doesn’t live on that block or who isn’t a guest of someone who does. Police, paramedics and firefighters would be exempt, as would garbage haulers, meter readers, code inspectors and others whose jobs take them there.

Before you call your councilperson and complain that your tax dollars will be wasted, or you call the ACLU and complain that your civil liberties will be infringed, consider this.

It strikes me as no small coincidence that my next-door neighbor was shot at point-blank range last night by an assailant who was attempting to car-jack him. He’s doing fine now, fortunately he had his wits about him and the bullet only grazed his midsection before he retreated back into his garage until the authorities arrived.

Would the ordinance have helped my neighbor in this case? Probably not. But what it will do is give the police a legal reason to patrol alleys and question conspicuous behavior. Fast-forward to a time in the future where the ordinance has been in effect for a while and has made Minneapolis neighborhoods safer, and maybe the environment for the crime doesn’t even exist anymore.

One legitimate question is whether an ordinance like this would give police more power to abuse and make it easier to profile and harass people with no other probable cause.

For now, given my personal experience, I’ll gladly give up my right to walk in other alleys in exchange for safety. Why would you want to be back there anyway?

Posted in  | Tags ,  | no comments | no trackbacks

Podcasting with Typo and externally-hosted content

Posted by Nick Sieger Tue, 23 May 2006 03:59:00 GMT

My first trials in podcasting have been relatively enjoyable with Typo. Although I wouldn’t recommend the approach I’ve taken for someone who isn’t willing to get their hands pretty dirty.

I chose to save money at the expense of time and posted my podcasts to ourmedia.org before realizing that Typo (svn rev 947) does not have native support for externally-hosted enclosures. Following are the hacks I’ve taken to work around that.

  • In Typo Admin->Resources, upload a “blank” or dummy version of the file you want to serve in your feed. Save the filename you use for later (in the example below I use minnebar20060506edwards.mp3).
  • Upload the real file to the system that will be hosting the file. Get the real length of the file, e.g., using curl -I:
[22:48:37][~]$ curl -I http://www.archive.org/download/NickSiegerAgileDesign/minnebar20060506edwards.mp3
HTTP/1.1 302 Found
Date: Tue, 23 May 2006 03:47:54 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) PHP/5.0.4-0.4
X-Powered-By: PHP/5.0.4-0.4
Location: http://ia301231.us.archive.org/3/items/NickSiegerAgileDesign/minnebar20060506edwards.mp3
Content-Type: text/html; charset=iso-8859-1

[22:48:51][~]$ curl -I http://ia301231.us.archive.org/3/items/NickSiegerAgileDesign/minnebar20060506edwards.mp3
HTTP/1.1 200 OK
Date: Tue, 23 May 2006 03:49:10 GMT
Server: Apache/2.0.54 (Ubuntu) PHP/5.0.5-2ubuntu1.2 mod_ssl/2.0.54 OpenSSL/0.9.7g
Last-Modified: Sat, 20 May 2006 03:39:32 GMT
ETag: "3c-1d8b320-46bc500"
Accept-Ranges: bytes
Content-Length: 30978848
Content-Type: audio/mpeg
  • Now open up a Rails console in production mode on your server -- be careful! We need to patch in the real length of the file into the resource record so that the actual length of the file appears in the RSS and Atom feeds.
$ ./script/console production
Loading production environment.
>> r = Resource.find :first, :conditions => ['filename = ?', 'minnebar20060506edwards.mp3']
=> #<Resource:0xb747c2e4 ...>
>> r.size = "30978848"                                                              
=> "30978848"
>> r.save
=> true
>> quit
  • Assuming you’re deployed on Apache (you are right?), put a permanent redirect in your public/.htaccess file:
Redirect permanent /files/minnebar20060506edwards.mp3 http://www.archive.org/download/NickSiegerAgileDesign/minnebar20060506edwards.mp3
  • Post your entry, and associate the resource to the post.
  • Check your feed to verify the enclosure entry appears as desired. Put your feed into a podcatcher and ensure the podcast can be downloaded.

As you can see, not exactly the ideal scenario. I haven’t been following recent Typo development closely but hopefully this can be made to be super-easy in a future rev of Typo. If I was a hardcore podcaster I would probably code up a patch but the above steps work fine for now.

Posted in  | Tags ,  | no comments | no trackbacks

Minnebar Podcast: Agile Design

Posted by Nick Sieger Tue, 23 May 2006 02:44:00 GMT

In this podcast from minnebar 1, Ben Edwards presents on the topic of agile design. Using memes from the Agile Manifesto and 37 signals among others, Ben does a great job fostering a discussion.

Download the podcast here, or put my feed in iTunes or another podcatcher to have the podcast downloaded for you.

Posted in  | Tags ,  | no comments | no trackbacks

Minnebar Podcast: Web 2.0 in the Real World

Posted by Nick Sieger Fri, 12 May 2006 03:25:00 GMT

In this podcast from minnebar 1, Jamie Thingelstad, CTO of marketwatch.com, describes a real-world, scalable application of asynchronous javascript that uses an event-driven model rather than polling.

I enjoyed the session and think it’s worth a listen -- there are some interesting approaches discussed, including a back-off strategy that helps give the server a chance to tell its javascript clients to not hit it so hard when it’s under duress.

Download the podcast here, or put my feed in iTunes or another podcatcher to have the podcast downloaded for you. I should be posting more minnebar podcasts in the coming days.

Posted in  | Tags ,  | no comments | no trackbacks

Let's keep the minnebar high

Posted by Nick Sieger Mon, 08 May 2006 03:17:00 GMT

It’s going to take me a while to recover from minnēbar. I met some great people, got motivated by some new noble ideas, and generally had a blast. A thousand kudos to Ben as well as the sponsors for making the event a smashing success.

But, let’s not stop there. We made some initial contact, hit it off well, vibed off of the energy in the venue. I’d be disappointed to say the least if I didn’t hear from anyone for another six months until the next event gets planned and scheduled.

So, can we make a concerted effort to keep in touch? May I suggest a monthly (or so) geek dinner, drinks or something similarly informal (e.g., the Friday night get together? I wasn’t there) where we can keep some momentum going and build our relationships? Find out where our own strengths are and how we complement each other?

If there’s one thing coming out of Saturday’s event where I hope we have a shared vision, it’s for increasing the amount of innovation in the technology sector in the Twin Cities. This group of people has the talent to make that real.

On a side note, I recorded four sessions of audio from Saturday, and at first listen they appeared to come out pretty well. I hope to post them in the coming days.

Another side note: the “ē” in minnēbar is represented in HTML as unicode entity &#x0113;. Don’t let your minnēbar posts suffer encoding issues on the highway!

Posted in  | Tags  | 1 comment | no trackbacks

Jazz and Creativity

Posted by Nick Sieger Sat, 29 Apr 2006 03:43:00 GMT

Short bio moment: I am a jazz musician. I have not been actively playing in recent years as my dual life as information economy worker and father have dominated, but the essence of jazz as a form of communication, interaction, problem solving, patterns, repetition, and creativity have remained in the core of who I am. Whenever I’m having a down-cycle in my life, it always seems like it’s because I’ve gotten away from listening to jazz.

So, with that as background, imagine you’re me and go read Garr Reynold’s recent post on Jazz and the art of connecting. Even if you’re not a jazz lover, many of the quotes there resonate so well with any aspect of a creative profession. My favorite (and Garr’s):

“Anyone can make the simple complicated. Creativity is making the complicated simple.” -- Charles Mingus

Now, 37 signals may appear to have the recent trademark on “embracing constraints” and its relation to creativity, but it sounds like Charles beat them to the punch! Time to go dig around in some jazz biographies again!

Posted in  | no comments | no trackbacks

Quote of the day

Posted by Nick Sieger Wed, 26 Apr 2006 18:39:00 GMT

Just stumbled upon this interview with Bill Joy from a couple years ago and it’s full of quotables. This one caught my eye:

What about the open source idea in general?

Open source is fine, but it doesn’t take a worldwide community to create a great operating system. Look at Ken Thompson creating Unix, Stephen Wolfram writing Mathematica in a summer, James Gosling in his office making Java. Now, there’s nothing wrong with letting other people help, but open source doesn’t assist the initial creative act. What we need now are great things. I don’t need to see the source code. I just want a system that works.

It’s a good reminder that just because something is “open source” that doesn’t make it a great idea. Brilliant ideas are created in the minds of a few -- the wisdom of the crowds usually just ends up diluting a good idea.

Posted in  | no comments | no trackbacks