RssJam.com - My Foray Into Feeds

A month or two ago, I started looking for an RSS client again. I had tried some a year or two ago but never really liked them. I now have greater reason to keep track of a few blogs and other RSS sources. There seem to be quite few now.

All the Readers a Local Client
Okay. Not all, but nearly all of the RSS readers are local clients which means installing another piece of software on a machine already full of it. What I wanted was a daily or thrice daily email with updates on all my favorite feeds. Simple. But none of the online sites I browsed provided what I wanted.

Rolling My Own
So I had a free weekend on my hands. I could have spent it fishing but I don't fish. I could have spent it golfing but I don't golf anymore. So I registered RSSJAM.COM and wrote a little file based ASP.NET app that would do what I wanted.

Daily Emails
Now I get three emails a day with a nice HTML formatted message that shows me my feeds with the stories that have been posted in the last 24 hours listed at the top.

Explosive Growth
After a month or two of telling a few people about it, only 16 people have signed up to use RssJam for free, so I don't expect it to be a huge hit or make me a ton of money. But it's a fun and useful tool. And for those of you who spent the time to read this post, if you want, just shoot me an email and ask for the code. I'll be happy to zip it up and send it to you. Who knows, you might set up your own site inside your team to keep track of all your teams blogs. Or whatever.

The link to email me is at the bottom of the left column here.

.NET Regex Fixed on x64

The Bug - Submitted June 5, 2006
On June 5, 2006, I submitted a bug to Microsoft their Connect site and expected that it was an exercise in futility. Who would listen to me? Here's what I submitted to them.

Title: Long pattern string results in race condition on x64 system but not x86 system
A long pattern string in a Regex constructor works fine on my x86 Windows XP development machine but results in a race condition that eats RAM very fast until an "out of memory" condition occurs an the process is killed on the x64 Windows Server 2003 machine. In steps below, I will cut and paste the code which resulted in the condition--the input exceeds 2000 characters so I will remove some of the lines that concatenate the pattern string but one can easily add additional lines to achieve the result that I experienced. To resolve it or work around it, I simply split the Regex into 19 Regex objects and that resolved the problem.

This happened after developing a pattern to remove unwanted words from text before I run the keyword extraction algorithm I wrote based on this whitepaper by a brilliant young researcher named Yutaka Matsuo and the honorable professor Mitsuru Ishizuka at the University of Tokyo.

Fixed - July 7, 2006
I received an email from the Connect system to let me know the bug had been fixed. Of course, it was a nice, poorly formatted plain text email spit out by the system. Where's the love? Still, I was impressed that the system (hence somebody who programmed the system) bothered to send a note to let me know that the bug was confirmed and fixed.

I'm sure a million or more of my readers have already enjoyed this experience, but for those small few that have not, I thought I'd share. So don't hold back. When you find a bug in the framework or just want to complain, visit the Connect site and see what happens.

 

HttpWebRequest, ServicePoint and BindIPEndPointDelegate

I've spent months fighting with 3rd party components and my own hand rolled code that would allow me to achieve essentially the same thing you can with the HttpWebRequest class with one additional feature: binding a specific end point (IP address) to the object so that a remote server would recognize the call as coming from that specific IP address.

I looked through the description of each of the HttpWebRequest's members in the MSDN documentation. I searched the internet high and low. I banged my head against buggy third party components. And in desperation attempted to roll my own. All efforts resulted in a thorougly disappointing result.

Bring on the Delegates

Two days ago, I was chatting with a friend and I expressed my desperation. I told him I'd drive to his house and give him a fifty dollar bill if he could tell me how to use the HttpWebRequest object and assign or "bind" the local IP. He started digging. And I tried one last Google search using HttpWebRequest and IPEndPoint, I think it was, in the search. And I found this little gem about 5 seconds before my friend suggested taking a look at the HttpWebRequest's ServicePoint member and the ServicePoint's BindIPEndPointDelegate member.

Glory Hallelujah!

One of my new best friends is someone I don't know: Malar Chinnusamy. Thanks a million, Malar.

So to the point of the title of this little rant. It is the delegate stupid. The lesson learned is when you can't figure out how to do something with the .NET Framework, check out the delegates. And the delegates of the object's members. And so on...

public delegate IPEndPoint BindIPEndPoint(ServicePoint servicePoint,
  IPEndPoint remoteEndPoint, int retryCount);

That little gem is a beautiful thing. It lead to this:

private IPEndPoint BindIPEndPointCallback(ServicePoint servicePoint,
  IPEndPoint remoteEndPoint, int retryCount)
{
    if(retryCount < 3)
        return new IPEndPoint(IPAddress.Parse("192.168.10.60"), 0);
    else
        return new IPEndPoint(IPAddress.Any, 0);
}

and...

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.ServicePoint.BindIPEndPointDelegate =
  new BindIPEndPoint(BindIPEndPointCallback);

I told my friend that I wish I knew and understood everything in the framework. He said that he wished I knew it all too. So, when there's a shortage of helps and great blog posts out there, don't give up. Follow the delegates and you won't look as stupid as I felt once I found my new friend's post.

Code Fonts and ClearType

I ran across the Consolas font from Microsoft today. I love it. I'd been using Courier New in 9pt and have now switched to Consolas 10pt. Much easier on the eyes. But not at first. It displayed quite poorly until I enabled ClearType in my display settings.

I've been using LCD monitors for a long time and why I've not switched to ClearType, I'll never know. It's like my glasses suddenly became more effective.

How many other cool things have I missed? One can never really know.

Geek Dinner and Superman

Last Thursday I attended my first Geek Dinner. Great food. Good conversation. And then we went to the Wynnsong and watched Superman Returns in our own reserved theater thanks to their great management. And many thanks to Phil Burns and DevUtah for hosting it.

Dinner was at Tucanos in Provo. Great food. Fun atmosphere.

The movie was vintage Superman. I expected more but my kids will love it.

And if you live in Utah, come join us for the next Geek dinner. If you don't, then start your own. Way fun!

Does Pay Per Click Work?

I"m not a marketing guru. Never have been. Never will be. You too? So how do we maximize traffic to our blog, our side project, or our main gig? Well, we tell our clients to hire us, the expert, when they need some coding done.

So hire an expert.

I know just the expert. I've watched these guys in action. They know what they're doing. Check them out at http://www.webevident.com/ppc-management.php.

They can handle all your pay per click campaigns. And you would be surprised how much traffic they can drive to your site on a very tight budget. They do a free analysis for you, so you have nothing to lose by at least checking them out.  

A Requirements Management Allegory

My wife won the lottery. Two hundred thousand dollars. Uncle Sam took half. She said, "I want a new car. Go buy me a new car."

So I took the checkbook and bought a brand new Honda Accord for $30,000. When I arrived home my wife said, "I didn't want an Accord. I want an SUV."

On the way back to the dealership, an accident occurred. I escaped with my life but the car was a total loss.

I still had the checkbook so I wrote a check for $40,000 and took home a nice, new Dodge Durango. I was so pleased with myself.

But my wife was not. She said, "The Durango is too small and I don't like the color red."

So I turned around and took it back to the dealer. I asked for my money back but he whipped out the magnifying glass and pointed out the small print: "absolutely, under no circumstances can you get a refund."

"Besides," said the salesmanager, "we've already spent the money and we can't take a new car in trade. It's just policy."

So I drove the Durango to the Ford dealership and on the way was rearended by a large truck. The Ford dealership gave me $10,000 in trade and I wrote a check for $40,000 more for the last of the new Ford Excursions.

I drove the Excursion home. Finally my wife was happy. "Now let's go buy the boat," she said.

"Sorry, honey," I said. "We're out of money."

So we have this giant SUV and we can't afford to put gas in it, and we have nothing to pull behind it.

But, we do have an SUV that cost $100,000 and in three years will be worth less than $20,000. And as a compensating note, I can haul a ton of groceries with it which helps save the cost of gasoline to get to the grocery store in the first place.

Now if only we could find another lottery to win.

Automate Your Customer Service Complaints

I recently ordered something online. Let's hypothetically say it was a pair of glasses. I won't say which company because your experience will in all likelihood be better than mine. In point of fact, I have a crazy prescription that is hard to make and throws every optical lab for a loop the first time they see it.

Actually, I ordered two pairs. One pair was produced and arrived in a reasonable timeframe. The other has yet to arrive, hence my hesitance to name names. It's been weeks and weeks now. I would call and receive placating assurances that the matter would be looked into and that all would be resolved. I sent email nearly every other day inquirying. No answer. No status update. No way to look at the order status online--okay, yes that's partly my fault. Know before you press "confirm order."

So how did I solve this great quandry. Just a few lines of code which I will share below produced an emailed response within the hour. Have fun with it. Use it at your own risk. I take no responsibility for how you make yourself heard. And I've removed the identifying strings to avoid embarrassing the vendor and further endangering my order. BTW, their response was:

"We apologize for the inconvenience you experienced with us. We are remaking the glasses you ordered in our lab. You will receive them in about 10 days."

Here's the simple code:

using System;
using System.Collections.Generic;
using System.Text;

namespace
CrazyEmail
{
  class Program
  {
    static void Main(string[] args)
    {
       string n = Environment.NewLine;
       string nn = n + n;
       string body = "Hello," + nn
         + "I can think of no other way..." + nn
         + "Can you please respond..." + nn
         + "You can either..." + nn
         + "Thanks," + nn
         + "-Tyler";

       System.Net.Mail.MailMessage msg = 
         new System.Net.Mail.MailMessage("myemail@address.com", customer@service.com
         "order #xyz status inquiry"
, body);

       System.Net.Mail.SmtpClient client = 
         new System.Net.Mail.SmtpClient("mail.myserver.com"
);

       for (int i = 0; i < 100; i++)
       {
         client.Send(msg);
         Console.WriteLine(i.ToString());
       }

       Console.WriteLine("Done.");
       Console.ReadLine();
     }
  }
}