Copyright 2005 Randy Charles Morin
Part of the KBCafe Blog Network.
Cool Programming
Cool Programming Tips with C#
Thu, 11 Jun 2009 14:18:12 GMT
Word Count Javascript

Minimal Javascript code to preform a simple word count.

This free script provided by JavaScript Kit

Thu, 04 Jun 2009 16:19:16 GMT
Mobile Redirect
The stupidest mobile device algorithm is when the redirect all mobile hits to their non-mobile site to the mobile site homepage. Like I'm gonna search your site for the link I was expecting. That's simple laziness. If you are stupid enough to have a separate mobile site in the first place, at least try to redirect me to the proper page or provide me some option of going to the non-mobile page.
Thu, 23 Apr 2009 20:22:04 GMT
Stats Lie

Ninety percents of stats are simply used to justify untruths. Especially when you don't have a verifiable source for them. For example, my own first sentence. Where does that come from? I made it up. But even stats that do have a source are likely to be misused or miscommunicated.

On one project, we were using the Clearspring widget platform. Not only was our widget horrible, but the Clearspring wrapper was mostly broken as well. I knew this widget wasn't gonna fly, but the powers that be insisted otherwise. We had a deadline and we went live with the bad widget. We agreed to revisit the widget post launch. A few months after the launch, we reviewed the adoption of the widget. The manager in charge of the Clearspring integration said we had millions of placements and we should keep the widget as-is. Millions? Where? I could only find one or two. I told him I didn't believe him. He gave me the password to the Clearspring dashboard so that I could double check the data. I reviewed the data and noticed that almost every single placement had occured on our own website or internal development servers. Clearspring was counting our previews of the widget as placements. In actual fact, we only had a few placements. I explained this to the manager and he didn't believe me. He said he would review the stats himself and get back to me. I never heard from again. The project was basically dead because the manager had stats indicating we were getting adoption, when we weren't.

The lesson. Doubt everything involving stats. It's probably untrue. At least 50% of the time.

Tue, 21 Apr 2009 03:50:53 GMT
Behavioral Algorithms

Honestly, I'm fed up with behavioral algorithms. It's stupid. It's in every game you video or online game play. Lately, I'm playing NASCAR Cart for Wii. If I lose twice in a row, the third race is a cake and they actually slow down at the end of the race to let you feel good about yourself. What is the point of putting the game on the most difficult setting, if they are gonna flub the 3rd race and let you win.

It's the same in my NASCAR 2009 for PS/2. If you are losing, the lead cars slow down to let you catch up. Even on the hardest settings. It's also true of online (free) Texas Holdem Poker. When I try a new poker room, I get 4 of a kind, straights and flushes every few hands. But after playing for awhile, I can't get any of them. I worked for a gaming company and I couldn't believe it when they told me to implement this feature.

Honestly, I hate this shit. I know why they do it. They want you do feel good about yourself. If you lost every game, then you'd likely think the game sucked. I personally cannot stand winning every 2nd or 3rd NASCAR race on these stupid games. Give me something challenging. This is stupid.

Sun, 05 Apr 2009 15:58:49 GMT
mailto Link Handlers
On Talk-Sports.com, the users quite often report that their mailto links handlers are not working. This is most comon with Mac users, but it also happens to Windows users. This article will summarize the solutions that I've provided to users who complain that mailto links are not working on their Mac or Windows computer.

Gmail on Macs and Windows

Download the Gmail notifier to enable mailto link with Gmail on both Macs and Windows.

We haven't tested which Web browsers these work for, but we assume they work for the three major browsers; Internet Explorer, Safari and Firefox.

Yahoo! Mail on Firefox

This works on Firefox 3 and later.

Credit to http://www.mydigitallife.info/2008/07/02/how-to-set-yahoo-mail-as-default-mailto-client-in-firefox-3/ 

Yahoo! Mail on Safari

We recomend installing Firefox and following the instructions for Yahoo! Mail on Firefox above.

Hotmail on Windows

Download and run the Register Hotmail with Default Programs utility.

Gmail on Greasemonkey and Firefox

Download the mailto to Gmail handler Greasemonkey script.

You will also need to installed Greasemonkey for Firefox.

Help us!

Please send us any further solutions that you discover (randy@kbcafe.com).

Tue, 24 Mar 2009 19:48:08 GMT
Browser Stats

Latest stats for my most popular website talk-sports.net.

 

Wed, 18 Feb 2009 01:52:58 GMT
Blaming the Previous Guy
Let me define irresponsibility. Not taken taking responsibility for something. We are all responsible for our current situation. Blaiming it on the economy is irresponsible. Blaming it on the guy that quit three months ago is irresponsible as well. You had months to fix it. Fix it!

Most often when someone blames the previous guy, you can assume that the current guy is simply irresponsible. I can't remember how many times a programmer tried this on me. It's not my fault, the previous guy's code is horrible! That's a phrase said as often as the national anthem.

Blaming the previous guy is a sign of irresponsibility. It's sometimes justified, but rarely. Even if justified, then you should have fixed it. Period.

Tue, 03 Feb 2009 03:07:37 GMT
NHL.com Mobile

Possibly one of the worst mobile website implementations is that of NHL.com. I've always avoided NHL.com on my mobile device because it didn't work at all. It looked like they were serving me a full HTML website with lots of graphics, CSS and Javascript that don't work on my mobile Internet Explorer.

All of a sudden today I'm being served a mobile version of NHL.com on my desktop computer (not a mobile device) and I don't know how to get back to the full website. 101 in mobile design, give the user the ability to escape back to the non-mobile version of the site. Morons!

http://www.nhl.com/

Tue, 13 Jan 2009 17:37:02 GMT
Username is Case Insentive
I've always been told that usernames should be case sensitive for security reasons. After running my own sites for years, I can tell you that this is a user support nightmare. Users don't understand that case matters. You are best to make usernames case insensitive. Otherwise, the support cost will kill you.
Tue, 13 Jan 2009 17:33:09 GMT
Google Maps for Mobile goes Useless
Today I noticed that Google Maps no longer works on my Windows Mobile device. WTF? Not even Google can program for mobile devices. Does anybody test this stuff? When I do a search I get a blank white result page. I'm going to bet that doesn't even know and when they find out they won't even fire anybody. Pathetic!
Thu, 18 Dec 2008 22:34:40 GMT
Over-Validation
Over-validation is a real problem on the Internet. Some programmers assume that all addresses fall within their knowledge of what an address is. They design website to meet their limited knowledge and it works for 90% of the cases. You just lost 10% of your customers. I was applying for a credit card at PC Financial and I couldn't enter my mailing address as their validation did not accept the address. More oddly, the validation on cell-phone numbers was also constrictive. Somebody needs to fire a development.
Sat, 15 Nov 2008 03:53:24 GMT
HowTo C# Mobile

I've been struggling with just how to write a mobile website. What I've noticed is a bunch of really crappy mobile websites and I sure didn't want to do one of them. My approach was to simply tweak my existing HTML websites for mobile devices. Here's what I wrote. When mobile is true, I simply remove the clutter normally in my HTML websites. Sorry for the lack of formatting. My code was partially based on code written by Richard Jones.

bool mobile = false;
try
{
  System.Web.Mobile.
MobileCapabilities cur = (System.Web.Mobile.MobileCapabilities)Request.Browser;
  if (cur.IsMobileDevice
    || (Request.UserAgent.IndexOf(
"Windows CE") != -1)
    || (Request.UserAgent.IndexOf(
"iPhone;") != -1)
    || (Request.UserAgent.IndexOf(
"iPod;") != -1))
  {
    mobile =
true;
    Context.Items.Add(
"mobile", true);
  }
}
catch
{
}

Fri, 14 Nov 2008 18:52:39 GMT
Facebook Mobile Sucks
Today, I was trying to use Facebook mobile. Wow! That realy sucks. Most everything in Facebook is unavailable in their mobile offering. You can barely do anything. This is perfect example of what I've complained about; mobile specific version of sites. Stupid! Website designers, especially mobile website designers continue to be some of the dumbest people on this planet.
Mon, 10 Nov 2008 04:34:33 GMT
Online GUID Generator

Nice idea!

http://www.guidgenerator.com/

Thu, 06 Nov 2008 04:30:23 GMT
Eat Your Own Dog Food

Eating your own dog food means using your own product. It's very common in software development. The advantage of doing this is that you quickly recognize bugs, deficiencies and potential new features.

Recently Google announced that they are moving their AdSense Help Forum away from Google Groups to a new platform. They describe a few new features that weren't available in Google Groups. I quickly asked myself why they didn't simply add those new features to Google Groups? That's part of eating your own dog food. Recognizing potential features and implementing them. I wonder if their was a conversation at Google where the AdSense team asked for the features and were refused by the Groups team? Or is the Groups product in maintenance mode (no new features)?

Tue, 28 Oct 2008 17:53:47 GMT
QA QA QA
The most important part of any development process is quality assurance. It's also the least most important part of comedy.

Today, while working on a paid review for a website, I discovered the following sentence on their homepage.

"Sites that ... have a reputation for treating players fairly will not be listed on ..."

QA. QA. QA. Pay your best tester more than your best developer.

Tue, 28 Oct 2008 01:35:34 GMT
Broken Olive

More and more, I'm amazed just how broken most websites are.  Today, I was looking for an Olive Garden in Indiana and stumbled upon an Olive Garden Canada website. I started looking for location in Canada. It asked for city or province in the search textbox for locating an Olive Garden restaurant. I typed each province in Canada and it returned "We're Sorry. No results were found near your location. Please search again." for all. I knew their was an Olive Garden in Edmonton, Alberta, so I typed the name of the city "Edmonton" and got a match. Searching on the province "Alberta" and you get no results. It's no wonder their are few Olive Gardens left in Canada. You can't find them. The same functionality worked fine from the US website.

http://www.olivegarden.ca/

Fri, 17 Oct 2008 16:13:45 GMT
EAMobile is Stupid
More Mobility stupidity. Today I type NASCAR 09 AT google, my favorite video game. I click through to EASports webpage for their game. They redirect to eamobile.com, a stupid Morons version of their website. If you don't know how to create a good mobile version of your website then leave good enough alone, please don't f-it up. Creating a mobile version of your website is dumb, unless you know what you are doing. Try tweaking for mobile rather than making a completely useless mobile version like the EA idiot developers.
Thu, 16 Oct 2008 16:48:44 GMT
How to Screw Up a Mobile Website
I work about one hour per day now on a mobile device. There are three types of mobile websites.
  • those that present the same website to both desktop and mobile users.
  • those that tweak their site for mobile devices.
  • those that offer a unique mobile experience.
  • Tweaks tend to work very well. Mostly these sites hide some ads and sidebar content for mobile devices. On the other hand, those that offer a unique mobile experience are almost always broken. The biggest example is Facebook, which is completely b0rked on my device. I think the problem is that unique means twice as much testing, which means several fold more missed bugs. This is amplified on mobile device since their are more target mobile platforms than on desktops.

    Don't develop unique presentations for mobile devices. Rather, just tweak your desktop presentation.

    Fri, 12 Sep 2008 14:13:45 GMT
    Hug a developer today...

    Too funny! Hat tip to Robin. Been there, done that.

    Sat, 06 Sep 2008 17:32:09 GMT
    Don't Over Validate

    One problem I encounter a lot on the Web is crazy developers who try to over validate everything. In this case, I was updating my address information for a service I use. The website is quite nice on one hand, in that, it was able to determine most of my address when I entered my postal code. On the other hand, it got the street address slightly wrong. I decided the address was 295 Queen St E, when it's actually 6-295 Queen St E. The developer was so sure of his amazing algorithm that he wouldn't let me edit the address.

    I often experience the same problem with phone numbers. My Motorola Q doesn't understand phone number extensions, so when I enter the extension in the address book, the phone dials the wrong number.

    Mon, 30 Jun 2008 15:18:24 GMT
    Macs Suck

    I keep getting the same "Well I have a mac and can't send a report this comment message 2 u..." When I ask Mac enthousiast, they deny there's a problem with mailto links in Safari.  What's up? Can anybody give me the story here? It's my most common user problem these days.

    More specifically, it has to do with mailto links that have the subject URI request parameter. For some reason the subject request parameter doesn't work in Safari or so most all my users claim. I don't have a Mac to test this with.

    Sun, 29 Jun 2008 03:24:02 GMT
    $20,000 Software

    When you are IBM, it's not hard to sell software. But when you are Joe, then you should read this. This blogger explains how he's selling software at $20,000 a pop to big companies. I might read it 10 times myself.

    http://nukemanbill.blogspot.com/2008/06/how-to-sell-your-software-for-20000.html

    Fri, 06 Jun 2008 01:37:22 GMT
    Permanent Redirect Entire IIS Website

    Today, my project was to redirect the entire http://reblinks.therssweblog.com site to http://www.reblinks.com. A quick Google and the solution is built into IIS. Read the source for a detailed explanation.

    1. Go into the IIS site properties for the domain you're moving from. In the "Home Directory" tab, click the option "A redirection to a URL".
    2. In the Redirect to box, enter the domain you wish to move to (no trailing slash), plus $S$Q - for example, http://www.developerfusion.com$S$Q
    3. Next, check the options that state the client will be sent to "The exact URL entered above", and "A permanent redirection for this resource"

    http://www.developerfusion.co.uk/show/4678/