Go to home page mail me! RSS Feed
FoxMetrics Web Analytics

January 2009 Entries

Did Wikipedia get hacked?

A co-worker sent over a link to Wikipedia and I thought it was just another link, well it is until you start reading. I created a screen shot of the first two paragraphs just in case it get fixed or you can pay a visit http://en.wikipedia.org/wiki/QWERTY directly if the guys at Wikipedia haven't replaced it.  

posted @ Thursday, January 29, 2009 1:38 PM | Feedback (1)

JQuery to the rescue, again!

The title of this post should really read - "JavaScript framework to the rescue", because it really doesn't matter if you use JQuery, Prototype, etc.. I interchange the use of my JavaScript frameworks with JQuery and Prototype being my favorites and I really don't know why I select one over the other, I guess it depends on the day. Anyway, while working on a freelance project, I was tasked to implement a  PayPal subscription button and I went "ah ha!" - that's going to be easy and indeed it was, but, the problem was/is that PayPal quick add on...

posted @ Tuesday, January 27, 2009 1:29 AM | Feedback (0)

Submitting disabled controls with server-side validation

If you've ever tried to manipulate the ASP.NET validation controls via JavaScript, you should by now know how painful it is. Ok, so how did I come to the "painful" conclusion, at my job I was tasked with partial validation, meaning if certain criteria is met, only a partial part of the page should be validated without post back. To be exact, it comes down to a very common concept that you see around if you've ever placed an order online using a credit card, who hasn't? At the point were you are asking for billing and shipping information,...

posted @ Wednesday, January 21, 2009 7:58 AM | Feedback (2)

Converting a negative number to a positive number

The .Net Framework is swamped with a ton of code and at any given time I'm only using a few and one of the namespaces that I don't usually visit often is the System.Math namespace. If you are a game developer, you probably saying, what??? Well, that's because most of the time I'm simply pulling and putting numbers in a database, I really spend most of my time doing web development. Anyway, here is a quick and easy function to convert a negative number such as -5 to a positive number 5. I saw someone cast it to string, remove...

posted @ Friday, January 16, 2009 8:53 PM | Feedback (1)

SQL Server return random rows

Here is a cool little script to return random rows from SQL Server but before you go running off, I must warn you, this will bring your response time to a crawl if you run it against a large table, say over 6 figure rows, therefore, you might want to come with a different way of doing random rows if you have a huge data set.  select top 100 * from [TableName] order by newid()

posted @ Wednesday, January 14, 2009 4:31 PM | Feedback (0)

Validate a U.S Phone number

Here is a simple function that validates a U.S phone number using regular expressions. Note the use of the static method, which prevents unnecessary object instantiation. Its all about optimize code. public static bool IsValidPhoneNumber(string phoneNumber) { string pattern = @"^[01]?[- .]?(\([2-9]\d{2}\)|[2-9]\d{2})[- .]?\d{3}[- .]?\d{4}$"; return Regex.IsMatch(phoneNumber, pattern); }

posted @ Wednesday, January 14, 2009 1:44 PM | Feedback (0)

Why I hate system updates!

There are basically two fundamental reasons why I hate performing system updates, although hate may sound like a strong word but I seriously dislike updating my systems. Updates that are obvious end up causing more harm than good Features that are removed without any notice I recently updated my vista machine which went smoothly if I must add and that is a few days ago, everything has been fine so far until today when I tried to RDP using console mode into one of my servers at my co-location facility and...

posted @ Sunday, January 11, 2009 9:23 PM | Feedback (0)

Next entries »