Archive for the ‘coding’ Category

SDL problems on Mac OS X in Python and Ruby

Sunday, October 9th, 2005

So I wanted to get the SDL working on my Mac at home so I can tinker with game programming in either Python or Ruby.

My preference would be Ruby since I think the language is cooler… but both RuDL and Ruby_SDL kept giving me this weird NSInternalInconsistencyException that I didn’t know what to do with… “Huh,” I thought. “These projects must not be very stable yet.”

Then, using Fink I started installing Pygame and started getting a similar problem even though Pygame had been working the previous week! (I had downloaded it from somewhere but wanted to get latest) WTF!! Turns out, more specifically, that the problem was in making windows… going fullscreen worked just fine. It was making windows that was causing the problem.

Thank God for the Interweb. This guy used this post to diagnose what was wrong with my finky installation of pygame. So, once I’d made the simple change in my init python script in pygame… voila!

Makes me want to go find RuDL and Ruby-sdl in my trash and see if I can’t fix’em.

BTW, the code I had to hack is this:

from objc import loadBundleFunctions
import AppKit
import Foundation
+ if not AppKit.NSApp():
+ AppKit.NSApplicationLoad()
except ImportError:
raise ImportError(“PyObjC 1.2 or later is required to use pygame on Mac OS X”)

The +s indicate where you should add the lines and eventually I’ll get around to fixing my site so I can display code properly (indenting and all that). Whew!

Spring.NET and OS X

Wednesday, September 28th, 2005

I’m a big, big fan of the Spring framework, or, more accurately, the .NET implementation. I’m also a fan of the C# language.

That’s why I’m very pleased that Mono has a Mac distribution (they’ve had it for a while) and that, apparently, Spring.NET works fine on the Mac.

So, uh, cool. ( =

Joel Spolsky Hates Agile Software Development

Wednesday, September 21st, 2005

Okay, no, not really. But in that funny and scathing way of his Joel says no to agile development practices.

So let me try on the Joel hat for a while. In the example he gives, Speedy doesn’t actually have a customer on site and doesn’t actually produce any stories about the user experience. Which agile method, exactly, proposes starting out by coding without talking to the user? If he was truly agile, Speedy wouldn’t go off and code in the weeds for three weeks. He’d have gathered some user input, generated user stories, defined some basic models and mock-ups… y’know, everything that an agile software developer would do.

And I’m glad Mr. Rogers at WellTemperedSoft had such a positive experience… unfortunately for him, though, he appears to have stopped talking to the user during those three weeks of development and has suffered from some requirements drift. Too bad Mr. Rogers wasn’t talking with his customer or else he could have noticed that drift. And, y’know, too bad Mr. Rogers has a disconnected relationship with his managers or else the managers would be more understanding when Mr. Rogers has to adjust the end product to meet his changing requirements.

To be fair, I don’t like searching for silver bullets and holy grails and I’m not a fan of zealotry. But I do think that the argument should be fairly represented, at least.

Technology I need to keep track of

Wednesday, March 16th, 2005

Per Ryan, here are some technologies/trends that I want to keep my eye on:

  • del.icio.us – open social bookmarking to see what people are looking at. From the site: “What makes del.icio.us a social system is its ability to let you see the links that others have collected, as well as showing you who else has bookmarked a specific site. You can also view the links collected by others, and subscribe to the links of people whose lists you find interesting.”
  • Dijjer – free P2P software that works transparently and is, again, open. If you host a big file on your system simply prepend http://dijjer.org/get/ to the url (like this: http://dijjer.org/get/http://mysite.org/video.mov) and people downloading it will swarm like a BitTorrent
  • Kenosis – P2P software built on top of XML-RPC. They seem to have a nice solution for the problem of discovery of P2P hosts.
  • Freecycle – P2P meets real life! Instead of throwing something away or donating it to the Salvation Army you first post about it to a mailing list and someone in your area, if they want it, will come pick it up. More focused than simple donation… too bad poor people generally don’t have computers. But it’s a start. (Here’s my local Freecycle group page.)
  • Your Redesign Toolbox – a bunch of handy tools for giving a site a facelift
  • CSS Zen Garden – a great site featuring the amazing things you can do with CSS while still maintaining accessibility and standards compliance

Here’s Ryan’s original post that inspired this one. He and I were talking about the sea change we’ve both felt recently in regards to the industry. There’s definitely something afoot, some sort of critical mass that we’re reaching in terms of design, usability, plain ol’ usefulness, socialability, open-ness… it’s in the air, that’s for sure.

Ruby on Rails and MySQL issue

Wednesday, March 9th, 2005

Had an issue developing my todo application on Rails. It took me a bit of digging but I finally found out what was going on.

To get going I downloaded XAMPP and started up the MySQL server that got installed with it. That’s where I hit my snag. I started up the MySQL server, generated my scaffold, tried to browse to http://localhost:3000/todo/list and got the following weird error:


ActiveRecord::StatementInvalid in Recipe#index

Invalid argument: SELECT * FROM recipes

“WTF?” I thought to myself. After some digging, I found the answer1. It seems that Rails (smartly) relies on MySQL using its Brand Spankin’ New™ Password Scheme but XAMPP, out of the box, had MySQL configured to use the old password scheme. The upshot was that once I set my passwords in my database.yml to a blank line (don’t try this at home or in production, kids) everything worked out just fine.

Now I just have to get MySQL to use its Brand Spankin’ New™ Password Scheme.

1 This guy seems to be having my problem. This discussion is a good place to start to find out what went wrong.

Bookmarks Synchronizer

Wednesday, March 2nd, 2005

This is the coolest Firefox extension. Indicate an ftp or WebDAV server and it will synch up your bookmarks on start and exit. That way, people like me who use three computers (work computer, notebook and home computer) can have the same bookmarks on each one. This is fantastic.

In the continuing saga of me and Ruby, Ruby on Rails and all things made with it (including Basecamp and 43 things) I got my home computer working again which means I can do two things:


  1. Start doing music again with my spiffy new mAudio firewire module once the Firewire card starts working

  2. Start attempting some serious Ruby development with Rails et. al. It’s hard to do serious development on laptop keyboards.

“Invalid argument” when setting options on a multicast socket

Tuesday, February 22nd, 2005

Okay, check check check it:


private static void Main(string[] args)
{
try
{
Socket mcSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

mcSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse(“224.168.100.2”)));

// purposefully throw a null exception here to show that WriteException is working
Socket tempSocket = null;
if (tempSocket.SocketType == SocketType.Dgram)
{
// crash here
}
}
catch (Exception e)
{
WriteException(e);
}
}

private static void WriteException(Exception e)
{
Console.Out.WriteLine(“”);
Console.Out.WriteLine(”—————- Exception——————”);
Console.Out.WriteLine(“e.Message = {0}”, e.Message);

if (e.InnerException != null)
{
WriteException(e.InnerException);
}
}

Would you expect that innocent looking call to SetSocketOption to cause mayhem and mischief? Well, in one case, it does. And I have no idea why.

I get an “Invalid argument supplied” error (WinSock error 10022) on a certain person’s machine when making that call. What gives? What’s going on underneath that could cause this?

Things that are not causing it:


  1. A firewall is not running

  2. There is a network card in the computer

  3. The correct version of .NET is installed

  4. Windows XP Service Pack 2 is installed

  5. Not getting flagged by anti-virus software

I’m stumped.