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.

Thursday, August 30, 2007

Professional XNA Game Programming - Review

Xna-bookI just finished reading Professional XNA Game Development by Benjamin Nitchske.  It was my first attempt at using the XNA Framework.  I have some experience with DirectX, as I have been tinkering with it since version 5. Most of my work has been with the Managed DirectX bits for .NET 1.1. I found it to be much easier and readable than C++, just because of the language differences.

XNA takes that next productivity leap and really allows you to hit the ground running.  You start out with a game loop (complete with elapsed time already calculated for you), a graphics device already setup, and a managed content pipeline for imported models, sounds, and textures.  Things like graphics memory getting lost when you alt-tab are already handled for you.

But enough about XNA, this post is a review for Benjamin's book.  If you haven't heard of him before, he was the author of the first Managed DirectX game called Arena Wars, and later wrote RocketCommander. Both games are very well done and he ported RocketCommander to XNA so that you can play it on the XBOX 360. XNA Racer was also done completely by himself, which is very impressive.  Needless to say, with all that background and expertise... I had high hopes for this book.

The first few chapters introduced how Benjamin approaches game development.  He calls them "Unit Tests" but that term often implies that the tests are automated.  His tests are basically slices of game functionality that he calls manually.  For example he might have a unit test to verify that shadows work properly, or that a specific collision detection algorithm works.  He is able to setup the update and render loops using anonymous methods and execute them using batch files or manually calling the unit test instead of the main game.  I found this to be very interesting, however the code that he used to write it was somewhat ugly and unintuitive.  I coded the Pong game following his coding style and was disappointed the whole way through it.  While he does say that we will utilize better code for the next game, the code he wrote here was inexcusably bad. I got the game working, however new features and modifications would prove to be difficult because it is just spaghetti code.  I swallowed my pride and told myself, ".. it will get better."

So then I started to follow his next example: Breakout.  I have built breakout before using Managed DirectX, and it was quite fun.  I was disappointed to find out that he didn't really buid the game through the book, he rather took the reader on an exploration of code already written. And he was true to his word, the code pulled a lot of functionality into "helper" classes which made them reusable.  And yes, the code was still horrid.

I mentioned reusable code.  It wasn't reusable like you're thinking.  He actually tells you to copy the code from the previous game and paste it into the new game.  I'm not kidding.  I'm a professional developer.  This book is called Professional XNA.  Professionals don't write code like that. He begins to talk about 3D programming in a way that is -- while full of information -- poorly organized and generally boring.  I learned a lot in this section, but nothing I can really refer to later.  It was more like a stream of conciousness than organized writing.

Let me give you a hard example of how bad the code is.  At one point he is talking about how he handles car physics, which was very interesting.  Then I saw the class diagram where he implemented it.  It looked something like this:

CarPhysics-crap

What!?!? So ChaseCamera inherits from CarPhysics which in turn inherits from Player?  Sounds like an object model from the Twilight Zone. This is pure junk as an object model, and is really only there because the CarPhysics object needs to know details about what the player is doing, and indeed so does the camera. But that doesn't mean you should break all rules of OO just to achieve a hack that works.  I was so appalled by this I almost didn't finish the book.

Benjamin knows his stuff, no doubt.  I think it’s amazing that someone can build something as beautiful as RocketCommander or XNA Racer in less than a month by yourself.  But I just can’t recommend this book because of the code quality.

I will wrap this up by saying that I *did* enjoy the book because it got me into game programming again, but I find this type of writing almost intolerable.  I enjoyed to learn about some nuances around XBOX 360 vs. PC versions of XNA Games, and I especially liked his Unit Testing technique. The information on Shaders was mildly useful, albeit boring. But if you're going to be reading this book, be fore-warned that the code sucks.

I give it 2.5 / 5 stars.

Mortgage Calculator - Loans - Money - Arizona Pools