Sanitizing Phone Numbers With C#

An extension method to remove all but digits from a phone number. This should be useful for sanitizing input to put into your database.

using System.Text.RegularExpressions;

namespace CustomStringMethods
{
	public static class PhoneNumber
	{
		#region Class Methods

		public static string StripAllButDigits(this string s)
		{
			return (s == null) ? string.Empty : Regex.Replace(s, @"\D", string.Empty);
		}

		#endregion
	}
}

Obviously this can be used for more than just phone numbers.

Startup Themes

Brad, Bill, Joy, and I were in Appleton, Wisconsin over the weekend, and stopped by Guitar Center to see what was going down (I haven’t been to any music shops since we were in Michigan; it’s been killing me!). Brad and Bill ended up over by the keyboard section (Bill was making some excellent jams), so I wandered over to see what was up. There was a keyboard next to them, and it was set up with this exact sound. Video after the jump.

Continue reading…

Make Google Notifier More “Push”-Like

I recently installed Prowl on my iPhone to receive push notification from, well, just about everything. One of the things that was excited was that I could setup a faux-Gmail Push System. After setting everything up, I noticed that the Google Notifier was only checking every 15 minutes (sometimes longer it seemed). After doing a little digging, I came across a forum post over at macosxhints. Luckily, it was quite easy to fix:

  1. While holding Command and Option down on the keyboard, select the Google Notifier Gmail icon and select preferences. This will generate a pop-up dialog.
  2. In the dialog box, enter AutocheckInterval as the key, and for the value enter 1 (for number of minutes to check).
  3. Hit set and you’re done!

After applying this fix, it’s just like having push Gmail (as long as my computer is on)! Thank you jonnygozy!

C# Interfaces: Under (No) Construction?

Why can’t C# allow for a constructor definition in an Interface? For example, say you have this interface:

namespace ValidationServices.Customers
{
  public interface ICustomer
  {
    // Properties
    ValidationRequest Request{ get; set;}

    // Methods
    ValidationResponse ValidateOrder();
    //....
    // and so on
    //....
  }
}

Continue reading…

XMLUrlResolver: Using Embedded XSLT Resources in C#

Over the last week or so, I have been searching for a method to properly include XSL files via xsl:include within a .NET embedded resource. Apparently, using GetManifestResourceStream() (via an Assembly) wasn’t good enough (it wouldn’t follow the xsl:includes, simply ignoring them). Luckily, I came across a (semi-)working solution over at Signs on the Sand. Now, the concepts behind this were right, it just wasn’t working for my particular situation. Here’s the scoop:

Continue reading…

What I’ve Learned So Far

So far, my internship has been going great! I’ve had many opportunities to work in a new environment, and I’ve been able to tap into one of my more underused skills: programming. Since I’ve been working for Independent, I’ve been able to learn a lot of new concepts; not only in programming, but in some of the operations of a business. Here is a brief overview of some of the things I have learned, or am learning.

Continue reading…

WordPress for iPhone

The WordPress for iPhone app is great! So far I’ve enjoyed using it with a couple of new blogs that I have setup (including my own). Having the ability to blog while on the to will help a lot with me actualy trying to get content on the web.

A few of the features I really like:

  • landscape mode: it’s a lot easier to type long lengths of text with the iPhone landscape keyboard
  • support for drafts (local and server based), this makes it very easy to start writing a post on my iPhone, then finishing it up on my desktop/laptop (I did that with this post)
  • photo uploading; it’s very easy to select photos and upload them along with a post. This will be very beneficial come next school year – I’ll be able to take pics at GAA events and post them instantly with a write-up of the event

Using this in combination with my desktop should make me quite the productive writer.

iPhone 3GS and OS 3.0 (and the Palm Pre, Too)

The new iPhone looks pretty cool, but it really is a minor upgrade. Besides the few hardware improvements, such as the increased processor and ram, as well as the new digital compass, not much has changed. If there is one feature that I would want from the 3GS, it’d be the digital compass, if not only for the new tomtom app that will be coming out later this summer (although, it should still work with the 3G).

I am very excited for the 3.0 release, though. Spotlight, the iCal updates, and copy-and-paste are my most anticipated features. Just over a week to go before I can update my iPhone!

Speaking of all of this cellphone stuff, I had the opportunity to play with a co-worker’s new Palm pre, and I’ve got to say that it is a pretty slick phone. Palm really is giving Apple some competiton, and I hope Apple brings a good plate back to the table. Favorite feature of the pre: unified contacts/calendar/mail.

Page 21 of 22« First...10...1819202122