/dev/random

Reality has a liberal bias

/dev/random random header image

Entries Tagged as 'Programming'

I Can Has Video

May 27th, 2009 · Comments Off · Programming, iPhone

As you’ve probably noticed, movies rarely work in I Can Has Cheezburger app (as a work-around, you can open the web page and click the video to play it).
The reason it doesn’t work is the movie URL returned in the feed, which is something like http://www.youtube.com/v/cxLG2wtE7TM won’t work when passed directly to a UIWebView [...]

[Read more →]

Tags:

Rewriting code without fear

May 24th, 2009 · Comments Off · Programming, iPhone

Over the last few days, I’ve been rewriting some major pieces of ICanHasCheezburger.app to simplify and clean up the way I handle movies. Currently I use a single image view, which is set to a ‘play’ image for movies, which then open in the browser when clicked. I’m changing it to swap between the image [...]

[Read more →]

Tags:·

Web Services and Unicode

April 30th, 2009 · Comments Off · Macintosh, Programming

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 [...]

[Read more →]

Tags:

Useful XCode tricks

April 9th, 2009 · 2 Comments · Macintosh, Programming

XCode provides several ways to make your work easier by cutting down on repetitive typing. The simplest (from a usage standpoint) is text macros. You simply type an abbreviation and hit Escape to substitute it. A text macro can have variable substitutions where you can add text.
I’ve seen a few contradictory articles telling how to [...]

[Read more →]

Tags:

Languages & Locales are different

March 27th, 2009 · Comments Off · Macintosh, Programming

If you’re writing a Mac or iPhone application that supports localization, you should be aware that the language & locale could be different. The preferred language can be changed in the International preference pane by changing the order of languages in the list.

However, when you change the language order, it doesn’t change the locale, which [...]

[Read more →]

Tags:

Sigma 10-20mm Lens

March 11th, 2009 · Comments Off · Programming

Today I got my first wide angle lens, a Sigma 10-20mm f/4-5.6D EX DC HSM. I’ve been very impressed with the quality of Sigma lenses since I got the 70-300mm and this lens didn’t disappoint me. The 10-20mm is very sharp and the auto focus is extremely fast and quiet.

Since most of my lenses are [...]

[Read more →]

Tags:·

iDjembe 2.0 submitted

March 1st, 2009 · Comments Off · Programming, iPhone

I just submitted iDjembe 2.0 to the app store. I decided to change the version number to 2.0 because I did a major rewrite of the audio player code.
For the first version, I just wanted to make something quick that hopefully would cash in on the app craze and make some money. This time I’m [...]

[Read more →]

Tags:

Simple fix for 1Password & Safari 4

February 24th, 2009 · 1 Comment · Macintosh, Programming

When Safari 4 was released today, a lot of people reported that 1Passsword won’t work with it. Since I rely on 1Password, I was very reluctant to upgrade. The developers of 1Password came up with an easy work around, which must be re-applied with every 1Password update until they officially support Safari 4. I came [...]

[Read more →]

Tags:

Nikon’s public DSLR SDK

January 28th, 2009 · Comments Off · Photography, Programming

Nikon has released development kits for many of their newest cameras, including the D90, as well as a NEF (RAW) file decoding library. The SDK lets you write applications that control the camera directly via USB (like Aperture’s tethered mode).
To get any of their SDKs, fill out this form at Nikon’s site.

[Read more →]

Tags:·

I Can Has swipe action

January 20th, 2009 · Comments Off · Programming, iPhone

I’ve had several reports that swiping no longer works in I Can Has Cheezburger 1.1. A small part of it is that when the image is zoomed, it will not let you swipe to switch images since that same gesture will reposition the enlarged image. Double-tapping to un-zoom will once again let you switch images [...]

[Read more →]

Tags:

Renewing iPhone signing certificates

January 17th, 2009 · Comments Off · Programming, iPhone

My iPhone development signing certificate expired yesterday. Thankfully I found that creating a new certificate is quick and painless. Luckily I still have my Certificate Signing Request (CSR).
All you really have to do is upload the CSR. If you don’t have it, you’ll have to create a new one by following the instructions in the [...]

[Read more →]

Tags:

iPhone Developer Certificates are expiring

January 12th, 2009 · 5 Comments · Programming, iPhone

Thanks to Craig Hockenberry for pointing out that iPhone developer & distribution certificates are beginning to expire. I checked my keychain and found that my developer certificate expires tomorrow and my distribution certificate expires on the 25th. I’m not sure if I still have my original certificate signing request (CSR), so I’ll probably have more [...]

[Read more →]

Tags:

Video of the day

December 14th, 2008 · Comments Off · Programming

D90 Video I captured at last night’s tree trimming party, with music added in iMovie.

Lots more photos here.

[Read more →]

Tags:···

Getting the title of a Web View in Cocoa Touch

December 12th, 2008 · Comments Off · Programming, iPhone

In an application I’m working on, I display a UIWebView with a navigation bar. I wanted to display the title of the web page in the navigation bar when I load a page, but there doesn’t appear to be any obvious way to do it.
There’s actually a very easy way to get the title (or [...]

[Read more →]

Tags:

Adding more books to Coda

November 30th, 2008 · 1 Comment · Macintosh, Programming

Coda is my favorite web development environment on the Mac, combining a syntax-aware editor, a visual CSS editor, and an FTP client that can sync local changes to the web server. Until I read this item at Dra Studio, I had no idea you could add custom books to Coda.
Adding books to Coda is very [...]

[Read more →]

Tags:

Handling multi-touch in an iPhone application

November 22nd, 2008 · Comments Off · Programming, iPhone

One of the changes I’m making in the next version of ICanHasCheezburger is improved multi-touch handling. In the current version, I’m only handling left & right swipes to switch to the previous or next images. For the update, I’d like to handle the same gestures as the photo app:

Pinch to zoom in & out

[...]

[Read more →]

Tags:

A preview of things to come

November 20th, 2008 · Comments Off · Programming, iPhone

Uploaded with plasq’s Skitch!

[Read more →]

Tags:·

The D90 is selling fast

September 28th, 2008 · Comments Off · Programming

I like to check Flickr’s camera finder page every few days to see how popular the D90 is. As I write this, the D90 is ranked 15 of 102 Nikon models. Less than a week ago, it wasn’t even listed. Yesterday it was #19, a jump of 4 places in one day.
Here’s a shot I [...]

[Read more →]

Tags:··

Using a WebKit view for help

September 26th, 2008 · 1 Comment · Programming, iPhone

Since the F**KING NDA makes it difficult to find iPhone programming tips & sample code, I thought I’d share this little tidbit.
Sometimes the easiest way to display a help or information screen is a UIWebView. It’s very easy to display the contents of an HTML file stored in the application’s resource bundle.

[...]

[Read more →]

Tags:

Lights Off!

September 19th, 2008 · Comments Off · Programming, iPhone

Kudos to Craig Hockenberry for defying Apple’s F***ING NDA and releasing the source code for an iPhone game, Lights Out, as inspiration for aspiring iPhone developers.

[Read more →]

Tags: