Software Development
One of the (many) things that has frazzled me about Xcode is the fact that you cannot change the 'company name' that appears in your classes directly through the Xcode UI. So, here's a way that you can do it, though it takes a simple Terminal hacking to accomplish. Like I just mentioned, pull up a Terminal window (Applications --> Utilities --> Terminal). If I wanted the company name to be waynehartman.com, I would type the following command in the Terminal window:
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{"ORGANIZATIONNAME" = "waynehartman.com";}'
Go ahead and fire up Xcode, create a new class, and kapow! there...
I was writing some code that required that all text be hex encoded and was appalled that the .NET Framework didn't have a Convert method for doing hex, so I had to write my own. Converting text to hex is quite simple using the method below:
public static String ConvertToHex(String asciiString) { StringBuilder sb = new StringBuilder(asciiString.Length); foreach (char c in asciiString) ...
One of the first things that I wanted to do when I got my brand new iPod Touch was create a webclip icon. It really annoys my that a lot of mainstream sites like Digg.com, Weather.com, etc. haven't bothered to create one. So, here we go.
First, start off with a 128x128 image. One of the things to keep in mind is that your iPhone is going to automatically apply some 'glossiness' to your image, so a nice flat image is ok. The other thing to keep in mind is that because it does that, you should make sure that your...
One of the biggest things that I've had a problem with C# is its complete, utter lack of string value enumerations. Enums provide strongly typed domain values that make programming easier to manage. However, since you can't include characters like wildcards, spaces, etc., this means that making a human readable enum a nearly impossible task. Until now. This takes a little more heavy lifting than I come to expect with the .Net framework, but is a relatively easy fix for what you get in return. This is broken into two parts:
Create the String value for the...
Many times, dynamic documents, images, zip files etc are created in memory. Rather than save them to the server's disk and provide a link, that dynamic file can be directly saved to the user's computer. By using MIME encoding and a little C# magic, downloading dynamic files is a snap!
If you're like me, debugging Regular Expressions can be a pain. There are an infinite amount of resources on the 'Net, but testing a home brew RegEx can be a pain. A little while ago I found this site that will not only guide you in making them, but help make sure that it does what you want it to validate.
There have been a few times that it has been necessary to return an auto-generated primary key after an insert into a database. This is a tidbit of MS SQL Server code that will do just that.
A lot of times after doing extensive testing with a website and its corresponding database, I find it annoying that the identity fields (those commonly called the auto-increment or autonumber fields) have run up their increment to a pretty high number, even though I have deleted all the rows out of them. So, after some research, I stumbled upon a way to reset it back to zero without dropping the table. As a side note, this method is valid for both SQL Server 2000 and 2005.