Custom Delegates in Objective-C
By far the most clear and concise example of writing custom delegates:
http://jonsterling.github.com/2009/08/01/using-custom-delegates-in-objective-c.html
By far the most clear and concise example of writing custom delegates:
http://jonsterling.github.com/2009/08/01/using-custom-delegates-in-objective-c.html

First test app on device
I finally got a test app on my iPod Touch! I know it’s been a while since my post about becoming an actual iPhone Developer, but this morning I buckled down and figured out what Provisioning, Certificates, and App IDs meant to get testing on an actual device. It all makes sense it’s just a multi-step process that is unfamiliar to me. Now the real work begins, learning Objective C and the iPhone SDK!
Many times I am presented with a set of files whose names I need to rename to fit a certain pattern, for example:
Old file name pg 1.pdf
Old file name pg 2.pdf
etc.
And you want to change it to:
File_name_1.pdf
File_name_2.pdf
etc.
Well I found a nice little utility to to take a set of files and with a little regular expression you can do just this and more: RenameRegEx from 12noon.

RenameRegEx from 12noon
If you love the power of Regular Expressions but don’t have the syntax memorized, check out AddedBytes’ Regular Expressions Cheat Sheet (formerly ILoveJackDaniels.com). This cheat sheet has a permanent position on my desk.

Regular Expressions Cheat Sheet from AddedBytes.com

Courtesy of Apple
I received my official welcome email into the iPhone Developer Program yesterday. I am excited to get started on some apps.
As an experienced Actionscript developer, I’ve found Keith Peters’ series AS3 to iPhone Tutorial something I could easily relate to. I am eager to soak up as much knowledge as I can regarding Cocoa/Objective C and the iPhone SDK.
When in a Windows server hosting environment there may come a time when you have to make DNS updates for a whole bunch of A records. If you have a few, then the DNS MMC works fine, but if you have say 300 records that you need to change, it gets you thinking there has got to be a better way. There is, with a tool that comes installed on Windows 2003 Server called dnscmd.exe. (You can download dnscmd.exe in the Support Tools package for Windows XP: http://technet.microsoft.com/en-us/library/cc756116.aspx)
dnscmd.exe is a command-line interface for DNS management. With it you can among other things: RecordAdd and RecordDelete. Sounds good, now we just have to write a Batch file to loop over all the zones and make our desired updates.
*** Note: I am not a DNS expert nor a windows scripting expert, but so the following is just one way to solve this above stated problem, there may be other ‘better’ ways, but this one succeeded in accomplishing our goal ***
With dnscmd.exe we EnumZones into a text file we’ll call ‘zones.txt’ using the following command:
dnscmd dns.yourdomain.net /enumzones > zones.txt
This will result in a list of all zones you have setup (edit the file to strip out the top header and bottom footer).
Now to loop over all of these we’ll create a Batch file called ‘updateRecords.bat’ with the following code:
for /F "tokens=1-4 delims= " %%a in (zones.txt) do ( dnscmd dns.yourdomain.net /enumrecords %%a subdomain /type A >temp.txt FINDSTR /L "old.ip.add.ress" temp.txt IF NOT errorlevel 1 ( dnscmd dns.yourdomain.net /recorddelete %%a subdomain A old.ip.add.ress /f dnscmd dns.yourdomain.net /recordadd %%a subdomain A new.ip.add.ress ))
Now, if you’re like me and don’t script windows shell every day (more like once every 5 years for me), I found SS64.com a tremendous help in finding the syntax for the commands available.
But what the preceding script does is loops over every line in the zones.txt, breaking it into four tokens named %%a, %%b, %%c, %%d, using ‘ ‘ (space) as a delimiter. Of which we are only interested in %%a; which will be the zone name. We then Enumerate Records in the zone %%a with the record name ’subdomain’ (change this to whatever you are looking for) with type being ‘A’ into a file we call temp.txt. Next we look to see if there was a result for the ’subdomain’ with our “old.ip.add.ress” (again change this to the IP address you need to change). If FINDSTR does not return an errorlevel of 1, we’ve found an A Record called subdomain with the old.ip.add.ress, so let’s change it. As you can see we run two dnscmd’s to RecordDelete and then RecordAdd. That’s it!
This script worked like a charm for some recent changes we had to make and I just wanted to share it so others may benefit from it. I’d also like to hear feedback if there are more elegant solutions.
I awoke to find our espresso machine flatlining this morning. This machine has dutifully served my family espresso drinks, coffee and hot cocoa for well over a year now. At an average of 4 espresso shots a day it’s probably ground, tamped and brewed 1,500 fine cups of coffee. But this morning it would not respond to any external stimulus (repeated pushing of the power button and jiggling the power cord).

Flatline
First, I ruled out external factors such as a bad electrical outlet or tripped circuit breaker, still no power. So after some quick searching on the internet and finding nothing other than a very generic suggestion stating “take the top off and check the fuse” I decided to do just that — crack open the machine and poke around inside. But before doing that, I unplugged the machine to ensure I wouldn’t electrocute myself.
WARNING: I take no responsibility for what you do with the information provided here. Always have a professional service your appliances. Do not try this at home. Now if you’re still interested, read on…

ALWAYS unplug any electrical appliance BEFORE attempting to service it
Okay, next I removed the reservoir, bottom tray and waste bin. I dumped out the beans from the hopper into a large bowl and started looking all over to see just how I’m gonna access the inside of this thing. Fortunately there aren’t too many choices of what to unscrew, there are 2 screws up under the front panel as seen when you open the front of the machine up.
Next I removed the hopper (there are two screws holding this in place), to access the 1 screw under the hopper. Every screw has been a standard Phillips-head until the this next screw, which is on top, in the back, under where the reservoir goes. This one is a Torx. If you’re short on torx drivers you might be able to get lucky as I did and have an Allen wrench that fits.
I guess Saeco doesn’t really want people to open up their machines and they figured a Torx screw would deter them from doing so. Well that hasn’t stopped me yet, and it didn’t this time either.
Okay, now that the top is unscrewed, you’ve got to removed the control panel face. The brew strength knob (that’s not the technical name for it) is easily removed with a gentle prying action. (NOTE: Remember where the indicator was pointing since it appears that it can be put back on the wrong way.) Once removed, there is a screw to take out.

Control panel
After you remove this screw, the panel pops of with a little prying.

Ready to take the top off
And inside we go! Here is the rat’s nest of wiring and tubing that lies under the hood.

The guts
So I started looking for a fuse or anything that looked out of place. After a few minutes of tracing wires closer to the power source, I found what appeared be the heating element. It is located on the very bottom on the back, right-hand side of the machine. And it looks like an electrical connector has vibrated loose from it’s connection.

The problem
Well this is in quite a tight spot and I cannot reach it to fix the problem, but fortunately I had a really handy tool to help. It’s a 2-foot long flexible claw-like device.

"The Claw"
In we go…

... like a surgeon.
Success! I put the machine back together in reverse order and fire it up.

It appears the patient will live.

I can almost taste it

Espresso

One happy developer

Until next time...
*** Note: This blog will normally deal more directly with internet-related tech, but as we all know caffeine is one of the great driving forces behind the internet, I feel this post is relevant enough. ***
WMBDev.com is LOOONNGG overdue. My name is Bill Blaettler. I have been doing web development professionally for over 8 years and have been using computers for 22 years (yes I estimate I was 5 or 6 when my dad introduced me to the Atari 800XE with BASIC, cartridges and a 5.25″ floppy drive). This blog and site are to be an internet playground for me. I’ve chosen Wordpress for the blog portion for its ease of updating – or I’d probably only update this thing once or twice a year, plus I really just wanted to try out yet another web technology.
Look for posts about all things computer, internet, iphone, web development, Actionscript 3, Coldfusion, PHP, jQuery, AJAX, (oh, I really could keep going with this), and more. Basically whatever I’m ‘into’ at the moment.