Archive for category: code

Software-related postings.

NSURLConnection + startImmediately:NO == boom?

17 August, 2008 (17:59) | code | By: nick

Having issues creating NSURLConnections using initWithRequest:delegate:startImmediately?

NSURLConnection *c = [[NSURLConnection alloc] initWithRequest:[NSURLRequest requestWithURL:url]
[...]

Python SubWCRev

26 October, 2007 (23:52) | code | By: nick

Fired out a little Python script for exercise…
pysubwcrev is a Python version of TortoiseSVN’s SubWCRev app. SubWCRev is a windows-only console app, pysubwcrev is a command-line argument compatible replacement that is Python-based, and therefore runs on any platform with an available Python interpreter and pysvn. Currently only Linux is tested.
The code is hosted @ Google Code. Currently no packaged [...]

Conditional Jumping in PIC16 Assembly

27 February, 2003 (20:51) | code, howtos | By: nick

PIC Microcontrollers have a funky way of handling conditionals. I’d like to present a set of macros I’ve made to make this easier to use, as well as explain the basics behind the technique in general.
Most MCU’s I’ve worked with before PICs had nice simple conditional statements… The mnemonic was usually to the effect of [...]

PIC buttons (interrupt-based)

23 August, 2002 (22:08) | code, howtos | By: nick

Previously, in PIC buttons (polling) we saw how to poll for the state of a line connect to a button, that is all fine and good but really that is not the best way to do them. The “real” way to interface with external components like that is through interrupts, a slick feature.
Interrupts provide you [...]

PIC buttons (polling)

22 August, 2002 (22:07) | code, howtos | By: nick

Polling for button input, how useful! This is pretty brief and gives a good idea how to let buttons control your programs execution.
In this tutorial I’ve switched from using an oscillator to using a crystal. This changes the design a bit. Using the 2 OSC pins, OSC1/OSC2 (CLKOUT/CLKIN) they hook to the crystal in parallel. [...]

PIC LED blinker (busy-wait)

21 August, 2002 (21:18) | code, howtos | By: nick

Beyond all doubt, the #1 beginning program in microcontrollers is the LED blinker. It’s super simple, and teaches the concept of pin voltages and busy-waits. Here is a busy-wait LED blinker program, and a walkthrough building it in MPLab.
First, the delay. This is a busy-wait delay program, busy-wait means you just burn instruction cycles [...]