Wednesday, September 19, 2007

Using UserAgentSwitcher to Access Members Only Sites

Ever gone to a site that you found via google that seems to have the EXACT answer to the problem you are looking for?  Then you click on the link and you are shown a page that basically says "You must be a member to access this article."

I can't stand sites like this.  In addition, they are in clear violation of Google's TOS, and they should get dropped from indexing unless the open up the content. 

Why are they in violation of Google's TOS, you ask?  Well basically they are sniffing for googlebot (or any other web crawler) and serving up real content to them.  The data gets indexed, the site's PageRank goes up and the site starts showing high up in the google search results.  But when you or I access the page, we get a different page, telling us that we should pay them money to see the content.

So if you want to give these sites a big middle finger, go download the user agent switcher Firefox extension.  Then add the googlebot useragent to the list.  You can get a huge list of commun useragents here.

Now, find a site that blocks articles to non-members, such as this one:



Change your user agent like so....



And refresh.  VoilĂ ! you're in!


Tuesday, September 18, 2007

I'm on to you, Microsoft

There's a conspiracy going on here.  We all ignored the first signs of it, but now it's too apparent to ignore.   Microsoft is engaging in some devious master plan that will affect most of us.

We all read with shock and awe, Scott Hanselman's post where he announced he was becoming a blue badge.  People wondered what this would do to his blog content, or his contribution to DasBlog.  This was the first sign.  And we did NOTHING.

Today, I saw the 2nd sign, and I'm going to expose this Microsoft conspiracy for what it is.  Phil Haack just announced that he is joining the ranks as a Microsoft employee.  That's right, you heard me. 

Microsoft has hired the technical and charismatic leaders of the two most popular open source blogging platforms for .NET.  This is all a part of a master plan to squash the multi-billion dollar market so that Microsoft alone can swim in the sea of money that is to be made from .NET open source blogging.  Don't kid yourself, there is buku (TM) money to be made in this area.

Sure, both Phil and Scott claim to stay committed to SubText and DasBlog, respectively.  But we all know better.  Soon they will be hard at work, developing the most incredible blogging platform ever devised.  I even have a name for this stealth-assassin project.  It will likely be called Microsoft Collaborative Team Works For Online Weblogs Framework Foundation System 2008.  I can just hear Microsoft Marketing salivating at that title.

All kidding aside, I think that Microsoft is going to be changing it's image, especially in the ASP.NET arena.  They've snatched up some key individuals in the community and they will definitely be making waves.  You can quote me on that.

Sunday, September 16, 2007

Speaking at AgileHouston Next Week

I am going to be speaking on Adopting Agile to our local Agile Houston user group.  Our last presenter, Robert Martin was excellent, and the speaker following me (who I shall not yet name for fear of jinxing it) is going to be stellar as well.  Maybe if I sandwich myself between great people I can be great by proxy.  We’ll see.

Anyway we’re not yet sure of the venue (might not be at UH this time), so keep an eye out on the agile houston website for details.  The date will either be September 24th or 25th, but I thought I would announce it now to give ample notice to those of you who are in Houston but don’t subscribe to the Agile Houston calendar.

My talk will cover some of the foundational principles that are deemed “agile” and why they are valuable.  We’ll also talk about the best way to go about introducing agile at a solo level, a team level, and a company level.  I’d like it to go off as a sort of dialog to get everyone sharing experiences and opinions.

Come check it out next week!

Thursday, September 13, 2007

Putting your Logic in Stored Procedures OR How to Create a Maze of Unescapable Complexity

My friend Azam just hit a nerve.  One of my pet peeves is the fact that some people clutch to stored procedures and claim it to be the one place to hold the true state and logic of a system.  I have worked with such a DBA, and it was not very fun.

Anyway, he makes the claim that it is easier to make a tiny change to a stored procedure than to make the change in code, recompile, and upload the new version of the application to the servers.  He gives this example:

Let's say that you have some code to display all the users who enrolled within the past 7 days. You implement it using some OR Mapper and the domain contains the logic for pulling out the users enrolled within the past 7 days. Everything worked fine! Now, the client comes and ask you that he needs to view the users enrolled in the past 14 days (Let's assume for the sake of discussion that we don't have the UI to select the number of days). Now, you have to change the code in the domain model and then upload the new version of the application.


I have to disagree.  While the impedance to making a change is usually smaller by updating a stored proc, a change is a change is a change.

Most production enviornments I have worked in are guarded by a machine-gun weilding fairy with a SOX t-shirt on that won't let me run an innocent little script without getting the blood of 14 virgins and my manager's approval.  So sometimes the actual process of making a change overshadows the change itself.

2nd, when the next developer goes to review the code, shouldn't he/she know EXACTLY where the business logic is?  I would argue that the largest cost in this scenario is the maintenance cost of the poor developer who doesn't know where to look for a change.  It could take an entire day of searching to find out exactly where that rule is being defined.

If the value in question (the number of days) was identified to be a possible changing value, then place it in a config file so that the application can change on the fly without having to jump through burning hoops of fire.

Anyway, like I said, this is one of my pet peeves, so if you enjoy working with elegant software, don't put logic in your database.  Keep it in your domain layer where it belongs.

Wednesday, September 12, 2007

GridView Cell.Text Versus Cell.Controls.Add

I'm sure I've come across this before, but I'm writing this down so that I don't forget it later.

I'm working with a pretty hefty custom GridView and it's really trying my patience for this control.  Yeah yeah, it's all great if you want to bind a list of data coming from a SQL Query written in your aspx in plain-text.  The minute you start to customize it all that goodness turns into a mess of weird templating and strange quirks about ASP.NET, but I digress.

Anyway, this post relates to the fact that the TableCell class has a Text property and a controls collection.

If you are creating custom rows of data, you have to choose between doing
cell.Text = "content";
or
cell.Controls.Add( new LiteralControl("content") );
The difference is that the two are mutually exclusive.  If you have controls inside the table cell, then the Text property will be empty.  If you have the Text property set, then there can't be any controls.

So in my case I was setting the Text property, then trying to insert a LinkButton control right before the text.  So I diligently put
row.Cells[index].Controls.AddAt(0, theLinkButton);
Which happily wipes everything that was previously in the Text property.  Ugh.

Anywhere.FM - It's the Bee's Knees!

I don't know how they do it.  Somehow, the most-excellent http://anywhere.fm allows you to upload your entire music catalog onto their servers and play it on the web.  Their bandwidth costs must be outrageous.

On a side note, isn't it weird that these web2.0 startups such as this one or YouTube have the most backwards business model?  Let's spend an outrageous amount of money and give away our applications, ad-free.  I always laugh at the one-liner "Step 2: Profit!" but this is even worse than that!  I think the business model here is, build a gigantoid (that's my word, you can't take it) user-base, then hope that google will buy us out.  If all else fails we can start injecting subliminal messages to our advertisers. 

"How I wish, how I wish you were here (with Tylenol).  Cuz we're just... two lost souls looking for some Lysol.... year after year....Running over the same old ground, but have we found.... the same old beers, Wish you were here (with Viagra)"


The have a pretty usable flash clone of iTunes, and it allows me to listen to my music library wherever I am (which is great for a consultant).  Sometimes my Zune runs out of batteries, or sometimes I forget it at home.  Anywhere.fm rocks.  It's the bee's knees!

Here's a screenshot of the player:



You can also listen to my library as a radio station by navigating to http://anywhere.fm/subdigital.  Just don't make fun of my music :)

Monday, September 10, 2007

Hug Your Dog Today

My heart sank last week.  Our dog, Molly, was hit by a car…

She was chasing after our other dog (a puppy) and crossed a busy road.  We got the call and picked her up from a nice gentleman that kept her cool in his car (the Texas heat is around 100° F outside).

She had a nasty laceration on her head and a bunch of scrapes and cuts.  Molly had been rolled under a car and obviously suffered a large blow to the head.  We rushed her to the Emergency Animal Clinic of Houston and they took her in.  There was blood all over my car and my shorts.  We were in complete shock.

Until this moment I didn’t realize how much Molly really meant to me.  She was always a great dog and I loved her, but I didn’t take the time to pet her everyday and spend some time with her.  My wife and I were pretty shaken up at the thought that she had almost died.

Our children were nearly devastated.  None of us could believe that we almost lost her.

Molly was treated with 6 staples to her head-wound.  We picked her up the next day.

IMG_5838

IMG_5825

Her handkercheif reads “They saved my life at the Animal Emergency Center of Houston.”

She is still a little skiddish, but she has quickly returned to her normal self and we love her.  Take the time to hug your dog today.  Show them that you appreciate them.

IMG_5841

Sunday, September 09, 2007

I'm a todoist

I’m kind of a nut when it comes to nit-pickiness in applications.  I have always wanted to use Office Tasks as my todo list, however it was never effective enought to stick with.

The lifehacker recommended todo.txt is as lo-fi you can get before going completely non-tech, but I really don’t want to manage a text file.  I want the computer to work for me.

I recently discovered todoist.com, a minimalist, but oh-so-flexible todo-list application that really has me using it.  It’s got more umph than the excellent tadalist.com, and this is why it’s more useful to me.

Here’s a screenshot of my current list.  I have top-level projects called Work, Home, and Leisure and I drill down from there.

Todoist

Notice how I have recurring tasks in the @Home project.  (Also, notice that I didn’t mow the lawn or sweep the driveway this weekend.  Oops!  I guess this goes to show you that no matter how fancy your todo list is implemented, you still actually have to DO stuff to accomplish anything)

I also jot down little notes and things, such as what movies to rent or buy next, or what my reading list looks like.

Todoist has a pretty simple API as well.  Everything is token based, so you have a long token that serves as your credentials for making a call.  This is similar to the way that google does it.

Speaking of google, todoist integrates with GMail with a simple bookmarklet or firefox plugin.  Just open an email within GMail and click the bookmarklet and the email shows up as a task in todoist.

Another awesome feature is the Launchy plugin.  Everyone knows I loves me some Launchy, but now I can type todo | add “get some milk” to “Shopping” and todoist will pick it up.  Slick.

Anyway, I’m smitten with this tool.  What do you use to manage your todolist?  If it’s not Outlook, then I’d like to hear about it in the comments.  (If it is Outlook, I suppose you can comment as well, I’ll forgive you)

Friday, August 31, 2007

Tsk, Tsk, Tsk - PNY Should be Ashamed of Themselves

Take a look at one of my co-workers found today.  The screenshot says it all.

Tsk-tsk

No, I didn’t destroy their database.  I was about to send an email to them when I realized it was fixed.

It amazes me that a large company such as PNY would do this.  It was probably written in Taiwan by someone who makes $4/hour, but still.  It makes you think twice before buying PNY memory.

Personal Loan - Loans - Homeowner Loans - Bad Credit Loans