Apr 302009

An application that I’m working on uses a SOAP web service to send user registration data to a server, which I implemented using Web Services Core Framework. After the user enters his details, I create a SOAP request to send it to the server:


	NSDictionary* headers = [NSDictionary dictionaryWithObjectsAndKeys: soapaction, @"SOAPAction",  "text/xml; charset=utf-8", @"Content-Type", nil];

	fRef = WSMethodInvocationCreate((CFURLRef) url, (CFStringRef) method, (CFStringRef) kWSSOAP2001Protocol);
	WSMethodInvocationSetProperty(fRef, kWSHTTPExtraHeaders, headers);
	WSMethodInvocationSetProperty(fRef, kWSSOAPBodyEncodingStyle, kWSSOAPStyleDoc);
	WSMethodInvocationSetProperty(fRef, kWSSOAPMethodNamespaceURI, Namespace);
        WSMethodInvocationSetParameters(fRef, (CFDictionaryRef)params, nil);
	fResult = (NSDictionary*)WSMethodInvocationInvoke(fRef);

This works perfectly unless the user enters multi-byte Asian characters. I immediately suspected that I was assuming somewhere that characters are one byte, but it turned out to be crashing deep inside CFNetwork code.

Apr 292009

GM and the other auto companies are dying because they continue doing business the same they always did and keep building the same kind of cars, which people don’t want to buy.

Meanwhile, Obama is calling for the development of a high speed rail system. Someone will have to build those trains. Why not GM? I’m sure they could re-tool some of their factories to produce trains instead of cars or trucks.

The way for GM (and other car companies) to survive is to re-invent themselves, not as a car company but as a company that builds all kinds of vehicles, including trains and monorails.

Apr 292009

Apr 282009

Vampire Weekend’s self-titled debut was my favorite album last year, with its catchy blend of afro-pop with ska, classical, and indie pop sounds. This blog post offers some details and a great new song called White Sky. The new song is recognizable as Vampire Weekend’s style and sounds like a lost track from “Graceland”. I’m really looking forward to this album.

Apr 272009

For a good laugh (or cry), read the Oklahoma Republican platform (or download the PDF).

I fail to understand how they can reconcile their belief in “The sanctity of human life, from the moment of conception to its natural end” with this statement:

We support the death penalty and swift execution of criminals who have exhausted the appeals process.

Elsewhere, they state:

While the objective study of philosophy and religion can be beneficial, public schools should not be endorsing any specific religion or philosophy. We believe that students and teachers should enjoy the right of free exercise of religion.

Yet the very next paragraph says:

We support posting the Ten Commandments and our Nation’s motto, “In God We Trust,” in all public schools in recognition of our religious heritage.

The Republican party isn’t only the Party Of No; they’re also the Party Of Contradictions.

Apr 272009

Apr 262009

Over the past few years I’ve become very disgusted with Florida, both politically & socially. I finally decided to do something about it. I’ve set a goal for myself to move out of here by November 24, 2009.

The only reason I moved here was because my mother got sick. Since she’s no longer with us, there’s nothing keeping me here. Socially, there’s nothing for me here. I don’t know any other developers here. Most of my local friends & neighbors barely know how to turn on a computer. Almost everyone I deal with every day is either in the San Francisco bay area or Vancouver. I really need to live in a high-tech area like that, since I feel isolated from everyone else in the computer industry.

I work at home, although I’m not self-employed, so I can live anywhere. If I lived somewhere like San Francisco it would give me the option of working in a co-working space instead of at home, or if I lived in Vancouver I could actually work in the office. I hate driving, but that’s my only option here. I prefer living in a real city with an actual downtown area like San Francisco or Vancouver where I can walk to restaurants, theaters, and clubs.

I’m also strongly at odds with Florida politics. Here, it’s not unusual to see people flying a Confederate flag, but when I see a confederate flag I have the urge to tear it up, spit on it, and stomp on it. My political views were formed growing up in New York City, which makes me feel very out of place here.

The first part of my plan is to start cleaning up my place and getting rid of the junk that has accumulated over the years, a large portion of it includes all of my mother’s possessions & documents which I’m storing in my extra bedroom. I’ve always resisted doing that, which is the main thing that has kept me from moving. Once I have it cleaned up, I can start getting my condo ready to sell. Hopefully prices will start to recover by that time, although even at the worst, units were still selling for more than I paid for this one.

I’ve found in previous moves, especially across the country, it’s a lot easier & cheaper to get rid of my furniture and buy new stuff rather than packing & moving it. I plan to take only my computers & cameras and sell all of my furniture.

Apr 262009

Apr 242009

Apr 202009

My favorite iPhone twitter application, Tweetie, is now available for the Mac. It’s replaced Twhirl & Nambu as my favorite Twitter client.

Tweetie’s user interface is clean & gorgeous. It has the features I want in a Twitter client: separate views for friend’s tweets, replies, and direct messages, and makes it easy to track new tweets by maintaining the proper scroll position to show current tweets until you explicitly scroll.

Atebits paid a lot of attention to detail. Animation effects are a nice touch, without being annoying. Double clicking brings up the user’s profile or all tweets in the reply threads. Most importantly, Tweetie doesn’t get in your face, so you can concentrate on work without being distracted, unlike many other twitter clients that demand your attention, yet you can easily see when new tweets arrive.

The only features Tweetie is missing are groups, saved searches, and trends.

Apr 192009
  • Stock concepts can be hard to come up with. Fear not! Just use this generator to figure out, what your next shoot concept should be. The first three ideas are already there! Hit the button to generate three brand new concepts!
    (tags: photography)

Apr 182009

Apr 172009
  • Using the World Bank API, you can tap into 114 indicators from key data sources like World Development Indicators, Doing Business and Governance Indicators, and more than 12,000 development photos. To get started, you must first receive a valid API key by registering for access.

Apr 172009

Plane Crash

Local Comments Off

Earlier today a small plane crashed into a house a few blocks from here. I wasn’t able to see it from my window, but my neighbor banged on my door to let me know and dragged me over to see it. I just took my point & shoot camera, because I was afraid I’d be hassled too much if I brought the D90. When I got there, the fire was already under control, with fire & rescue workers at the scene.

IMG_0107

I’ve posted more photos here.

Apr 162009

Earlier this week, Nikon introduced the D5000, which shares several features of the D90, but in a smaller & lighter camera that costs several hundred dollars less. It adds several compelling new features, most notably a 180-degree tilt/swivel screen and several new scene modes.

The D5000 uses the same sensor as the D90, so the image quality should be very similar to the D90 and D300, making it a worthwhile step up from the D40 or D60. However, the D5000 has a few very significant drawbacks: it lacks the D90’s internal focus motor, which means it can’t auto-focus with non AF-S lenses, such as Nikon’s wonderful 50mm f/1.8 AF. The D5000’s LCD screen is only 2.7″ with a resolution of 240×320 vs. the D90’s beautiful 640×480 3″ screen. The D5000 also lacks a subcommand dial, so most likely it will be necessary to use the menu for many settings, where they could be changed with one button on the D90. If you use an external flash such as the SB800 or SB900, the D5000’s built-in flash can’t be used as a remote trigger, unlike the D90.

I’d like to see a swivel screen in other future models, but I wouldn’t give up the D90’s features for it.

Apr 162009

Apr 142009

Apr 112009

A lot of developers don’t like having their sites loaded into a frame with Digg’s new DiggBar, inspiring several scripts to get rid of the bar. John Gruber came up with a short PHP script that prevents the page from loading with a nasty message if it detects that it’s being loaded in DiggBar’s frame. Gruber’s script inspired Phil Nelson’s WordPress plugin, which adds that script to any WordPress site.

I decided on a different route, using JavaScript instead of PHP and reloading the page outside the frame instead of displaying a message. The result is my Undigg WordPress plugin, which you can download here.

My plugin simply adds the following bit of JavaScript code to the page:

<script type="text/javascript">if ((top !== self) && ((document.referrer+"").substring(7,11) == "digg")) top.location.href = self.location.href;</script>

This is very similar to a standard frame killer, except it only affects the Digg bar while letting other frames load your page.

To install it, unzip the archive, drop ‘undigg.php’ in /wp-content/plugins, and enable it in the plugins screen.

Apr 112009

Apr 102009

/dev/random is Digg proof thanks to caching by WP Super Cache