scott.hodson.blog

November 11, 2007

WEBrick won’t start on Windows

Filed under: Rails, Ruby — scott @ 9:35 pm

If you get a strange error trying to start WEBrick on Windows like this…


[2007-11-11 20:23:42] INFO WEBrick 1.3.1
[2007-11-11 20:23:42] INFO ruby 1.8.6 (2007-03-13) [i386-mswin32]
[2007-11-11 20:23:42] WARN TCPServer Error: Bad file descriptor - bind(2)
c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': Bad file descriptor - bind(2) (Errno::EBADF)
from c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:73:in `new'
from c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners'
from c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:70:in `each'
from c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners'
from c:/bin/ruby/lib/ruby/1.8/webrick/server.rb:75:in `listen'
from c:/bin/ruby/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
from c:/bin/ruby/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
from c:/bin/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/webrick_server.rb:58:in `new'
... 7 levels...
from c:/bin/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/server.rb:39
from c:/bin/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from c:/bin/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3

This is most likely caused by some other already listening on the default port 3000. Perhaps you have another WEBrick server instance running. To see if you have another app running on that port you can run

netstat -a -b

To show the list of applications and what ports they are listening on. If you want to release the port just kill the application listening on that port, or you can run WEBrick on another port like 8080 like this:

ruby script/server -p8080

References:

August 25, 2007

My First Computer(s)

Filed under: Family, Technology — scott @ 2:44 pm

I stumbled across this series about old computers from the 1970s and I found the first 2 computers we had growing up in my house in San Jose, CA. Having an electrical engineer for a father made it more likely I’d have access to cool gear like this at such an early period in Silicon Valley’s early days.

My first computer was a variant of the IMSAI 8080. At the time my dad and his other hobbyist
friends assembled these computers together. The Altair was an earlier favorite and the IMSAI was an evolutionary follow-on. I think the one my dad had was a little better because it had the Zilog Z80 chip in it (oooh!). It had 64K 8″ floppy disks and ran CP/M. Before we had an OS on it I would have to enter in a 20 or so byte sequence on the front panel, setting each of the 16 bits of each byte, then pressing the Enter switch to enter the byte into memory. When I was ready to run the program I would push the Run switch and it would allow me to type on the keyboard and see what I was typing in the display. This was my first program! When we got CP/M I enjoyed playing some sort of ASCII Star Trek game and another adventure game where you would type commands like “open door” and it would respond with “The door is open but you can’t go in, a troll blocks its path”. You could call this an all-text precursor to Warcraft.

Then later on my dad got the Interact Model One, at that time sold by Micro Video in Ann Arbor,
MI. This was cool because it had some games and joysticks! All storage was on a standard tape deck. Eventually I got tired of the games and wanted to buy more but they were very expensive ($40!) so I picked up a book that taught how to program BASIC on it and I figured out how to write my own games. Those were the funnest games because they were made by me and I think I was about 10 or 11 years old while making my own games. I remember spending hours into the night trying to figure out how to make images move across the screen, how to react to joystick input and collision detection.

We’ve certainly come a long way since then, but I know my love for technology started at a very young age thanks to exposure from my dad, who gave me the tools to discover how much I enjoyed writing software that is useful and fun for me and others to use.

August 20, 2007

Why I Still Buy CDs

Filed under: Music — scott @ 10:46 am

As we mark the 25th anniversary of the CD some of my colleagues and friends are surprised that such a technofile as myself still buys CDs. These detractors fall into 2 camps: one that believe I shouldn’t pay for it because I can get it for free from P2P networks, and the others just buy all of their music on iTunes or some subscription service.

I’m not any particular supporter of the RIAA, and I’ve been down the P2P route. In fact I used to write software using the Gnutella protocol (R.I.P. Gene) and loved P2P as a disruptive and innovative way to provide network services, which eventually led me to found Ubero as a distributed processing service in 2000.

As far as buying music online, I loved AllOfMP3.com not only because of it’s price, but mainly the fact that it was DRM-free and you could buy high bit-rate versions of songs for a higher price that was still very reasonable. However, Russia wants to get in the WTO so they shut it down, although it has resurfaced as MP3Sparks.

So to not upset Russia, I continue to acquire the bulk of my music by buying CDs. Here’s what I get with it

  • All of my songs stored on a physical media that can act as a backup, packaged in a pleasing and artistic manner
  • High bit-rate (about 320kbps) versions { CD-quality :) } of my music
  • DRM-free, can be played at high quality in my car, computer, home audio system, or ripped to MP3s for my computer or MP3 player
  • Usually $9.99 each from Amazon, tax free, 2-day free shipping (I’m an Amazon Prime member) so the price is the same or better than buying a whole album on iTunes
  • CDs usually come with some extras that can’t be had by buying the album online. The music companies are trying to incentivize people to keep buying CDs.

I’m not one to acquire or buy 1 song at a time unless I need it for a specific reason like I want to integrate it into a slide show or something. For those reasons then I’d usually acquire it online. But if an artist I like or follow comes out with a new album I want the whole album, not just the singles they cherry-picked by radio DJs and program managers.

As we look back on the 25th anniversary of the CD many have asked themselves “what was the first CD you bought?” If you don’t know what a CD is then stop reading this blog now. Otherwise, my answer is Love and Rockets “Express“.

August 13, 2007

Suffering from “E-mail Stress”? Achieve “Inbox Zero”

Filed under: GTD — scott @ 12:53 pm

This recent article demonstrates what most people know: we are being flooded and overwhelmed by email! If you’re feeling the same way check out this speech at Google given by Merlin Mann about his GTD-inspired “Inbox Zero” initiative. Following these simple steps will help you achieve an empty inbox and relieve the stress of being overwhelmed by incoming email.

  • Get a System
  • Email’s just a medium
  • One place for everything
  • Process to zero
  • Convert to actions
    • Delete
    • Delegate
    • Respond
    • Defer
    • Do

August 10, 2007

CakePHP: Tasty, Still Undercooked

Filed under: PHP — scott @ 10:53 am

CakePHPLast night I went to a Orange County PHP Roundtable meeting for the first time, primarily to learn about CakePHP, a PHP framework that implements MVC and ActiveRecord a-la Ruby on Rails but for PHP. I was impressed with the amount of work that has gone into the framework and the passion of the presenter (Garrett something, President of the Cake Software Foundation). He was there to demonstrate some of the new features coming out on their 1.2 version.

Having developed in PHP for some time I could appreciate all of the pain and agony they are trying to resolve with CakePHP. The problem is that they’re perhaps 1-2 years too late because many disgruntled PHP developers have already moved onto Rails. Also, Cake is Rails-y in its implementation of ActiveRecord, scaffolding, and RESTful service support, but it doesn’t have any unit testing or database migrations features in it. Also, I think the fact that they go out of their way to support PHP 4 only holds them back. And I couldn’t get over the pain of seeing all of those dollar signs all over the code and having the type “new array()” every time you would create an associative array in PHP, which is used often throughout the framework.

The advantage, however, is that PHP is much more mature and has wide community support and is nearly ubiquitous on the Internet as the lingua-franca of website development. People who have large investments in PHP and plan to continue to leverage those investments should take a look at CakePHP.

CakePHP is a valiant effort to prop up the annoying verbosity and syntax of PHP and will extend the life of those teams that have been eating out of the PHP bakery for some time now.

June 19, 2007

Everybody’s Favorite Text Editor: Notepad (?)

Filed under: Software Development — scott @ 9:45 am

Notepad Rules!
A recent survey from CodeProject reveals when asked “What is your favorite text editor?” the winner is…NOTEPAD! Are you kidding me people? Either the CodeProject community is pretty lame (I doubt that because I know there are some great resources there) or else someone on the notepad development team in Redmond (is there a Notepad development team?) was just trying to rig the results.

While looking at the list to see how my favorite editor fared (Edit+) I didn’t even see it on the list! So maybe I’m lame too. I did check out the runner-up, Notepad++ and it looks pretty cool. I know UltraEdit has been a well-respected editor for a while. I’d never consider vi or emacs as a “favorite” but I’m forced to use it when I’m ssh-ed into a Linux box and I need to modify my httpd.conf or something like that. Actually, I use nano in that instance if it’s available (thanks Ubuntu!)

June 16, 2007

Netbeans 6: A Rails IDE? Part 1

Filed under: NetBeans, Rails, Ruby — scott @ 5:36 pm

So I downloaded the M9 pre-release of NetBeans 6.0 to preview for Ruby/Rails development. WAIT!

NetBeans? Ruby? I haven’t used NetBeans forever. I remember using some 4.x version for J2EE stuff years back but it was a giant and slow hairball. So I switched to Eclipse like most Java developers, then upgraded to IntelliJ for a few extra bucks and never looked back. So my initial response at the thought of using NetBeans for Rails development was one of thoughts of waiting, sludgy response times and buggy IDE responsiveness. Being greeted with a 166MB download (get the “Full” version) didn’t help to assuage my fears of history repeating itself. After downloading, extracting, installing, and then launching for the first time (10-15 minutes later) it came up and I immediately went to create a new Rails project. The process was quite painless and simple:

I would like some Rails please! Let’s build “depot”.

OK, fine, put it there, whatever

Hmm, it suggests that my rails may be out of date, let me go to a command-line and…oh wait, I’ll just press the button…voila!

Thanks, I was just thinking the other day that I needed that ActiveRecord-JDBC bridge (?). Actually, this is required if you plan to use Rails on JRuby, and if you’re using NetBeans you’re going to be encouraged to use JRuby if not forced (I’m not sure if it’s going to use my native Ruby runtime or JRuby, assuming it got installed).

OK, we’re up and running! Nice color coding, collapsible sections, some extraneous comments and some session management code thrown in I’m not use to Rails putting in there but NetBeans has done it for me.

And all of this only took up 125+MB of RAM!

Well, that’s all for now. I’ll spend some time actually developing with this and get back to you.

What Will Kill OS X: iLife on Windows

Filed under: Apple, Microsoft, OS X, Vista — scott @ 10:12 am

With the release of iTunes and Safari on Windows, Apple Inc (former known as “Apple Computer Inc”) seems to be heading towards becoming a software company. Recent comments from Steve Jobs at D5 that “it’s all about the software” seem to reinforce that point. However, the bulk of Apple’s revenue comes from hardware devices (iPods, Macs and soon, iPhones). Since the switch to Intel, Apple has had to refresh their Mac lines more frequently than before to stay more price-competitive to comparably equipped Wintel boxes which has to be cutting into their Mac profit margins.

While the software is an important and differentiating part of the entire closed-system’s functionality I think the temptation to port iLife to Windows is probably very tempting to Apple because of software’s higher margins and hardware’s increased commoditization. The reason iLife hasn’t been updated in over 1.5 years could be partly due to the fact that they’re trying to release an iLife for OS X and Windows simultaneously. Indeed, there is fertile ground for an integrated digital media suite in the Windows camp as the Windows side is fragmented with one-off companies that are good at making DVD burning software, while others are good at authoring, while others are good at audio production but none of them really provide solid, well-integrated picture, audio, and video content creation and management as smoothly as iLife.

The problem is that iLife is practically viewed as part of the OS X experience. Indeed, an oft-repeated selling point of OS X is that it comes with all of this neato iLife software to manage your digital lifestyle. But if there’s a Windows version of iLife isn’t the reason to not use Windows less compelling, especially as it succeeds at becoming more and more secure as Vista has shown? And how many people will keep switching to OS X if they can do most of the things they love on a Mac also on a Windows box which is more open, more easily upgradable and costs less?

I think porting iLife to Windows would be great for Apple’s bottom line but would decrease OS X’s chances at becoming a more mainstream operating system and would more exclusively be relegated to the “media professional” market it so strongly dominates now. However, Apple could potentially sell more copies of iLife on Windows for $129 that would make up for the lost revenue of OS X/Mac sales.

June 13, 2007

What American Accent do you Speak?

Filed under: Culture — scott @ 3:44 pm

Take the quiz, see what dialect of American English you speak. Mine was “Midland”

http://www.youthink.com/quiz.asp?action=take&quiz_id=9827

June 11, 2007

The End is Near!

Filed under: Apple — scott @ 5:19 pm

Safari on Windows!?!?!?!

« Previous PageNext Page »

Powered by WordPress