Posts Tagged ‘programming’

Weekend project: ShairPort menulet

Sunday, April 17th, 2011

Update: New version built around a native Cocoa port of ShairPort, MacShairport: ShairPort-v0.2.1.zip)

Recently an open source emulator for AirPort Express / AirTunes was released by James Laird. I’ve been waiting for something like this for a long while to enable remote music playback on my media center from my laptop and iPhone. However, I lack the hardware skills to extract the necessary firmware from the AirPort Express ROM chip. Thanks to James for doing the work and putting out his perl script / c utility. It’s pretty simple to build and run, and the source includes a nice OS X launcher script, but I’m looking for a little GUI widget to easily control it lest someone ‘inadvertently’ decides to send audio to my computer.

I’ve been lately transitioning my iPhone-specific Cocoa knowledge to the desktop; this was a nice opportunity to wrap up the ShairPort scripts in an OS X menu bar widget. The source is available on Github, and you can get the bundled app below. This was made for my specific system, so YMMV.

ShairPortMenu: [download]

Hello Fun-A-Day 7!

Tuesday, February 15th, 2011

For this year’s Philadelphia Fun-A-Day project I decided to write “Hello World” programs. “Hello World” is a traditional programming tradition where a programmer encountering a new language writes a trivial program which displays the phrase “Hello World”.

This introduces the programmer to the basic syntax of the language and demonstrates that their development environment is set up properly to work with that language.

Much of our current environment runs on software, which is generally invisible to us, except when a failure impacts our lives. However, software generally starts as human-readable written text, albeit in a highly defined form using specific vocabulary.

This project attempts to make software visible, in at least a trivial way. The words and structure may differ between languages, but each program is a series of instructions to achieve some end – here to issue a friendly “Hello Fun-A-Day 7!”. Hopefully this can serve to demystify software to some degree, and remind us that software, at some point, has been written by a person.

The programs here demonstrate a Fun-A-Day variant on Hello World in several languages. I made an effort to explore historical and modern languages, compiled and interpreted languages, console and graphical programs, but avoided esoteric languages which are often difficult to understand by design.
(more…)

Compiling tesseract v3 for iPhone

Friday, September 24th, 2010

Update 2: Before using the script, ensure that you can build tesseract for your host system normally. Also, I only tested the script with the v3 release of tesseract, not svn HEAD. If you get build errors, please try with rev 498.

Update: The script has been updated, thanks mostly to the prompting of fopen2003 in the comments below. I’ve successfully tested the resulting libs in both Simulator and an iPhone 4 (both at iOS4.x) using the PocketOCR project.

After many requests, I finally got around to looking into updating the build script to cross-compile tesseract ocr v3 for use with iPhone. Here’s the script. It seems to build the static, fat library without error. I haven’t tried to update my app to use it yet, so I really don’t know if it even works. Let me know in the comments if it actually does indeed work.

  1. Check out the svn source of tesseract: http://code.google.com/p/tesseract-ocr/source/checkout
  2. Copy this script into the source directory and run from there
  3. Profit???

(more…)

LEITv: Fly or Pie show

Tuesday, February 23rd, 2010

flypie-votingThis assignment was to develop a concept around a two-screen, live event experience; specifically, using TV and computer via internet. Our group’s concept was a variety-style, Gong Show inspired show with binary voting from viewers to determine via aggregate whether a performance was Fly (a rousing success) or Pie (a miserable failure) which received a whipped cream pie in the face. (We’re a classy outfit here..) (more…)

Parsing foursquare KML files

Tuesday, February 23rd, 2010

We’re using Foursquare as a data logger for one of our assignments in the Telling Stories with Sensors, Data and Humans class at ITP. As an aid to begin understanding the relationships between venues for our tracks, it’s helpful to munge the KML into CSV so it can be plotted and played with in a spreadsheet, Illustrator, R, Processing or whatever…

Below is a short python script to parse a Foursquare KML file into a simple CSV file. It outputs the check-in name, description, timestamp and location (as lat, lon). The Foursquare KML feed is available at the Feeds page on their site. (more…)

Sinatra + Kara == qwerty animals

Saturday, February 20th, 2010

Yesterday I released a small web app; it was my first using the Sinatra microframework for Ruby: http://qwerty.robertcarlsen.net

sinatra

The app arranges illustrations of animals wearing lettered t-shirts to create user-supplied messages. Kara Schlindwein created the illustrations as part of her project for the 6th Annual Fun-a-Day project in Philadelphia, and I wrote the first draft of the app while sitting in a chair at the show a couple of weeks ago, still nursing my broken ankle. (more…)

OCR for iPhone source

Tuesday, January 12th, 2010

ocr_gobbledygookThe source code for the Tesseract OCR for iPhone project has been published. It’s really simple – more of a skeleton, proof-of-concept project than anything else. Still, though, it’s neat to have nearly point-and-shoot text conversion in your pocket.

The project page is: Pocket OCR

The source code is available at github: http://github.com/rcarlsen/Pocket-OCR

There is certainly a lot of improvement to be made. Automatic color correction. Page layout recognition. Perspective correction…the list could go on. The code is there, so…fork away!

(the thumbnail is a bit tongue-in-cheek…but honest. good conversion requires a good source image: well-lit, macro, focused and tightly cropped seems best)

OCR on iPhone demo

Sunday, December 6th, 2009

Update: Source code for demo project released.

TessIcon

i finally got around to building a proof of concept implementation of tesseract-ocr for the iPhone. months ago, i documented the steps which helped to get the library cross-compiled for the iPhone’s ARM processor, and how to build a fat library for use with the simulator as well. several folks have helped immensely in noting how to actually run the engine in obj-c++. thanks to everyone who has commented so far.

anyway, below is a short video of the POC in action. the basic workflow is: select image from photo library or camera, crop tightly on the box of text you’d like to convert, wait while it processes, select / copy or email text. (more…)

PinwheelBeta – adhoc

Thursday, July 23rd, 2009

In preparation of submitting Pinwheel to the App Store I’ve gone and released a beta version via ad hoc distribution. Seems like it should be a straightforward prospect, however the various device provisioning, code signing profiles and entitlements made it a bit of a process for a first-timer.

iTunes also seems to be entirely unhelpful when something goes wrong with the “unknown error” message. What could it be? Code sign error? Unprovisioned device? Incorrect OS target? Mismatch in the app and mobileprovision file? It’s all a mystery in the iTunes universe.

Despite the inconvenience involved with having to generate a new ad hoc mobileprovision profile each time I add a new beta tester device, requiring a recompile of the beta app, it’s nice to finally get an app out to other non-development devices.

The ad hoc distribution process is documented well (enough) on Apple’s dev portal and on several other blogs, but my real stumbling block was navigating the Xcode interface to ensure that the proper code signing profile was being included in the binary (hint, look at the verbose build output for “embedded.mobileprovision” and ensure that the mobileprovision ID matches the correct version.)

I’ve also been getting trouble with Xcode not building using the correct provisioning, despite updating the target info and cleaning out the build folder. A restart of the program usually gets it sorted.

The next step will be to set up a Distribution build for the App Store submission. We’ll see how that goes in the end…

openFrameworks iPhone 3GS / OS 3.0

Tuesday, July 14th, 2009

i’ve been dealing with a performance bug in a particle + accelerometer oF app. the same project which has run very smoothly on a first generation iPhone with OS 2.2.1 has a noticeable stutter on an iPhone 3GS with OS 3.0.

there was no improvement despite several rounds of optimizing the openGL drawing code and plugging several memory leaks.

finally, in frustration i bumped the explicit frame rate declaration from the default 60 fps to 120 fps. i realize that ofSetFrameRate(60) is merely the upper limit of the frame rate, and that the hardware won’t actually go faster than it can handle, however this immediately improved performance on the 3GS and the first gen is about the same as it was. further improvement was had with a declared frame rate of 240 fps.

i haven’t had a chance to look into the underlying issue, but i believe that oF is using NSTimer under the hood to trigger a scheduled update() and draw(). has there been some change in the SDK there?