<CharlieDigital/> Programming, Politics, and uhh…pineapples

29Mar/06Off

Talk About a Culture of Irresponsibility

Posted by Charles Chen

Wow.  Just wow.

Bush Blames Iraq's Instability on Hussein

WASHINGTON (AP) -- President Bush said Wednesday that Saddam Hussein, not continued U.S. involvement in Iraq, is responsible for ongoing sectarian violence that is threatening the formation of a democratic government.

What?!?  Is he for real?

Filed under: News No Comments
28Mar/06Off

NHibernate Back on My Radar

Posted by Charles Chen

A little more than a year ago, I did my first sample project with NHibernate during some extended down time at Immedient.

At the time, the project was still in the .x releases (I believe I started with .8).  The one thing that really turned me off was the lack of good samples and starting points to learn from (although I did eventually dig up enough info to get my sample project up and running) and, in particular, the lack of strongly typed lists and collections. 

This is a legacy of the Java implementation of Hibernate, which was addressed some time last year with the release of .Net 2.0 and Generics, actually, but I never got a chance to look into it more as the end of the year was a busy quarter for me.

Over the last few days, I've been doing a little bit of studying regarding DLINQ for object persistence (incidentally, I also learned how to do duplex printing with my printer, which was far too confusing).  I recall being quite excited about ObjectSpaces when I was working at Factiva, but I was never able to get my hands on the preview bits.  From what I understand, it was actually very similar to NHibernate in that it required the use of intermediate XML mapping files (although DLINQ also needs those, but only for generating class files since it relies on the use of attributes).

DLINQ is the heir apparent to ObjectSpaces and is superior in every way...it's just that it's still in very early alpha stages and won't be ready for primetime until the release of C# 3.0.  While I love the technology, I'm just not ready to put time into something that's so open to change at the moment.

So, while I would love to implement DLINQ, it just seemed safer to take a second look at NHibernate, at least for the time being.  The last time that I took a look at it was probably around summer of last year, when I implemented a "toy" site for my sister using Cuyahoga CMS (which uses NHibernate).

With that in mind, I came across a very good CodeProject article on best practices for using NHibernate in a web environment.  As soon as I saw the bit about Generics, my interest was piqued again.  I downloaded the source and followed along and, to my surprise, it seems that my earlier frustration with good examples and usage has slowly been counterbalanced by increased usage of NHibernate.

As a bonus, I came across a great set of links and finally took some time to read about Martin Fowler's article on Inversion of Control.  This lead me to two frameworks for implementing IoC in .Net: Spring.Net and Castle/Windsor.  To be honest, I didn't quite "get" IoC and Castle the first time I looked at it (again, when I first started playing with NHibernate).  But I think I'm finally starting to understand it (I won't say I do fully until I use the framework and really "get" it).  I implemented something similar in a small project that I worked on last year at INS/Immedient (probably would have been much easier to use this instead).

The thing is, I've begun to become more and more obsessed with building loosely coupled systems.  So this is just the fix that my brain needed to start thinking about better designs.  Both Spring and Castle seek to address the same issue by utilizing IoC to remove dependencies (see here and here for a comparison of the two, although note that these were written over a year ago and were written by the project leader of Castle).

BONUS: I also came across a blog posting on how to simulate an HttpContext for testing written by the guy that's leading the Subtext project.  This is actually something I had been curious about (but too lazy to do anything about :-D) for quite a while.

Filed under: .Net No Comments
24Mar/06Off

Of Crack and World of Warcraft

Posted by Charles Chen

No, this post probably isn't what you think it's about.  Yes, World of Warcraft is like crack in its addictiveness and its ability to ruin your life.  One of my college roomates, Joe, has a townhouse around the corner from me (he used to rent from me).  Since WoW came out, he's been hooked on it.  Whenever I go over there, someone in that house is always playing WoW.  It's gotten to the point where the kitchen is a disgusting, festering mess of putrid food and garbage (yuck, the whole first floor smells like nasty).

But anyways, I digress.

I came across an article on Wired, You Play World of Warcraft? You're Hired!, which recounts the experience of Stephen Gillett an all around successful guy who also happened to be a guild master in WoW.

The article's premise is that playing games like WoW educates players in a way that's more powerful than tradtitional education.  In particular, it provides a sort of deep social education (how to live, work, lead, and interact within a group) that many of the players often cannot experience in real life.

Unlike education acquired through textbooks, lectures, and classroom instruction, what takes place in massively multiplayer online games is what we call accidental learning. It's learning to be - a natural byproduct of adjusting to a new culture - as opposed to learning about.

While Gillett is probably a bad case to use, since he was already pretty successful to begin with, it certainly does raise the question of how learning through immersive gaming can help build skills that translate into real world success.  What's significant is what is being learned, especially at the highest level of the guild.  At the level of a guild master, an incredible amount of things that translate into real world success are mastered and exercised on a daily basis.

In this way, the process of becoming an effective World of Warcraft guild master amounts to a total-immersion course in leadership. A guild is a collection of players who come together to share knowledge, resources, and manpower. To run a large one, a guild master must be adept at many skills: attracting, evaluating, and recruiting new members; creating apprenticeship programs; orchestrating group strategy; and adjudicating disputes.

Indeed, it can take hours to organize and execute a coordinated raid of 20+ players all over the world.  Regardless of the venue, it takes a great amount of leadership to get any number of people to focus on a common goal and execute it in a timely manner.  Even more impressive is that in most guilds, leadership naturally evolves in the sense that most of these people come together without knowing each other and those with the ability and desire to lead tend to bubble up the chain of control.

The article further brings up a good point in stating that virtual worlds are great platforms for teaching these lessons because the cost of failure is low:

Where traditional learning is based on the execution of carefully graded challenges, accidental learning relies on failure. Virtual environments are safe platforms for trial and error. The chance of failure is high, but the cost is low and the lessons learned are immediate.

Cost of failure is a very real metric.  I think people are often afraid of trying new things or undertaking the journey to learn something worthwhile because of the high cost of "failure" in the real world (I'm certainly no exception; it's why I hate to read books because "what if it sucks?").  At the least, it costs you a lot of time to, for example, learn a new language, that you may never get to use frequently.  At the worst, it may cost you a significant amount of money if we're talking about running a business or making an investment.

When the cost of failure is low, it becomes trivial for anyone to adhere to the old adage, "If at first you don't succeed, try, try again."

As for WoW, my personal impression that the skills to be a successful guild master in WoW (or a clan leader in any other multi-player game) are no different than the same skills that it takes to be a successful project manager or business leader in the real world.  You have to be able to evaluate resources and place them in a position to succeed.  You have to find the right mix of resources (build a well balanced team).  You have to be a skilled people person (well, at least in your online persona) and be able to resolve member disputes.  You have to be able to motivate people by controlling incentives (distributing loot).  You have to have great communication skills and overall great organization skills.

In actuality, this isn't too different from what it takes to be successful at many things in life, including dealing crack.  In Freakonomics, Steven D. Levitt recounts the experience of Sudhir Venkatesh in 1989, then a young PhD candidate in the field of sociology, and "J.T.", the leader of a gang that he stumbled upon.

So how did the gang work?  An awful lot like most American businesses, actually, though perhaps none more so than McDonald's

J.T., the college-educated leader of his franchise, reported to a central leadership of about twenty men that was called, without irony, the board of directors. (At the same time that white suburbanites were studiously mimicking black rappers' ghetto culture, black ghetto criminals were studiously mimicking the suburbanites' dads' corp-think).

Levitt goes into further detail about the incredibly well organized structure of the gang and the immaculate sales ledger that J.T. kept regarding all of the income and expenses of the gang, mostly from selling crack.

In the end, J.T. prevailed.  He oversaw the gang's expansion and ushered in a new era of prosperity and relative peace.  J.T. was a winner.  He was paid well because so few people could do what he did.

"We try to tell these shorties that they belong to a serious organization," he once told Venkatesh.

As is obvious, leadership is a valuable skill, whether it's natural, learned through a proper institution, or acquired through accidental learning.  The interesting question is how well these skills translate into the "real" world of business.  My feeling is that very few gamers will actually make that virtual-real world connection.

It's simply amazing that Joe probably puts in hours of research each week regarding items, weapons, skills, map routes, raids, and so on.  I often wonder what could be accomplished if Joe put the same effort into his personal life as he did into WoW say doing research on SharePoint or .Net.  But then, the learning wouldn't be experiential in nature, so it's hard to say.  I also wonder whether any of these skills can actually be translated into real world success since the whole idea of the online persona is to be someone that you can't be in the real world.

I should also mention that I think that MMO gaming instills a more general type of positive social training that helps even the most rebellious and anti-social of people since, typically, you cannot reach high levels of success in MMO's without the help of a group and you are forced to fall into a social order.  In that sense, it's not much different (and perhaps even more effective since anyone can join) from traditional, contrived, school activities that serve the same purpose like cheering, team sports, debate club, etc.

I don't think Joe believed me when I first proposed to him that MMO's were ultimately about a social experience.  You see, he had started playing the game "solo" and didn't want to be a part of any guild since very few of the group of us that played games together were planning on buying WoW.  This kind of reflects his real life nature in that he has a very close circle of old friends that he sticks with and isn't the most outgoing person (and neither am I, actually).  But now, oddly enough, as I understand, he's one of the higher level leaders of the guild that he's in.

Well, I'm just kind of stammering on now.  So there you have it.  Next time someone makes the obvious comment that WoW is like crack, you can bring up a totally different angle and be a (bigger) nerd.

FYI: I do not play WoW; I tried Guild Wars for a month or two, but I just can't really get into MMOs, possibly due to my INTP personality profile; more likely it's just because I'm even anti-social in my online personas :-D

EDIT: There's some great commentary over at a related thread on Fark, I'll include some choice bits:

AdessoL:

I've been a guild leader in WoW. I've also held assorted real life positions of responsibility. The article has a good point. You need to bring 50 people of all ages and personalities together to perform complex tasks, without any of the typical forms of reimbursement. You can't force people to be there, and you can't really pay them in any way that has an impact in their real lives.

In general, I've noticed that the guild leaders in WoW have to be much more saavy than your 'real life' management. Most of the latter tend to exploit the power they hold over their employees...they know that they can get you fired, affect your pay, make sure you get all the shiat jobs.

In the videogame, you have to be more persuasive. Start bossing around a 15 year old whose never had a real job, and he'll just up and quit. Patronize a 40 year old who makes $100k/yr, and he'll quit. It's a much more individual-based form of management.

Xaneidolon:

Two candidates - all other things exactly equal - apply for a job. One tells me in the interview that he/she can keep a herd of 100 or so online gamers on task and organized for 4-5 hour chunks of time. That's gotta mean something.

ranak:

But irregardless, to do such a thing would take management. And that's what the article is really about. Proper management and people skills. Get the right people with the right mix of talents and you're set.

And if you can do that in the virtual world with jackass 13-year olds that nerf you and then question your sexuality, you can do it in real life.

22Mar/06Off

Random DevTools Entry: #006

Posted by Charles Chen

While browsing the Dojo Toolkit site today, I noticed their bug tracker.

Hey now, this looks sharp!

Turns out it's this product called Trac by Edgewall Software.  Best of all, it's open source!  Looks good.  I'll have to see if I can convince anyone to use it.

I have to say, I've taken a long look at Bugzilla and the thing that turned me off (I know, it's rather shallow of me) is the sub-par interface.  I guess it was designed to be highly portable across browsers and platforms.  But damn, it looks like they didn't even bother making it a bit more attractive.

The TracBrowser feature is great too!  Code browser, HTML diff viewer, and all hooked into Subversion.  Incredibly awesome.

Maybe it's a good time and incentive to learn some Python

Random link: some Python IDEs reviewed.

(Random) Update: I spent some time whipping together a nifty little Subversion _svn directory cleanup script :-D It's great.  Simply download the file or copy the contents into a new .vbs file.

I've been meaning to do this for quite a while.  It's written in VBScript and based off of another script (which, for the life of me, I cannot remember where the original source is from).  You will need to have Windows Script Host installed (I believe) to be able to run this script.  Simply place it in the root directory of your project and it will remove all "_svn" directories in the context directory (directory you placed it in) and recursively into the sub-directories as well.

There is one confirmation dialog that allows you to change your mind and cancel the deletion if you double click it by accident.

svn_script_confirmation_t.gif svn_script_result_t.gif

Just the thing you need when zipping up and sending a project to someone without a Subversion client installed.

Enjoy!

Filed under: DevTools 2 Comments
22Mar/06Off

I Confess…

Posted by Charles Chen

I'm a code perfectionist.  I like nice code.  Nicely formatted.  Nicely structured.  Nicely designed code.  Of course, first and foremost, the code must do what it is designed to do; it must fulfill its functional spec.  But any programmer worth hiring can make code work.  It's not terribly difficult to hack code together.  But it takes a true craftsman with an emphasis on extraordinary craftsmanship to write good code.

Man, I am looking at some baaaaaad code today.  Ugly.  Let me run down the list:

  • Untyped DataSets?  Check.
  • Poorly named functions?  Check.
  • Poorly named variables?  Check.
  • Cramming all code into one file?  Check.
  • Did I mention poorly named functions?  Double Check.
  • Inline SQL?  Check.
  • Using concatenation instead of StringBuilder?  Check.
  • Useless catch{} statements?  Check.
  • Seemingly random spacing of operators?  Check.
  • Using DataSets where a DataReader would be more performant?  Check.

GaaAAAAaaaAAAAAaaaaaahhhh!  It's seriously killing me to have to mix this code together with mine...I feel the urge to go in there and rewrite every line of it.  Damn, I'm a serious code perfectionist.

I look at this code and I'm reminded of the multi-threaded web server
that I wrote when I was in college.  The whole thing was implemented in
like, 2 files!  But heck, this isn't college.  I expect good code and
good coding practices from the developers I work with.  Or am I wrong
to impose my perfectionist attitude on the work of others?  As long as
it works, right?

I touched upon my madness in "Letter to a Colleague" (an actual email that I sent to a co-worker) and "On Enterprise Library".  It's disheartening to see code like this; it's actually somewhat painful for me because of "The Perfectionist Plague".  I mean, Enterprise Library isn't the most interesting solution when it comes to object persistence, but it's a "standard" in the Microsoft .Net space and comes with a nifty configuration UI that makes it super easy to use...why do people still resist?

I dunno...I was hoping that I'd get away from these types of bad practices that are common in consulting and large companies.  I had hoped that going to a smaller shop would buy me more influence and a tighter developer community where we could develop to best practices and standards.  I had hoped that it would be an opportunity to not only make cool stuff, but do it "the right way" and write clean, extensible, well partitioned codebases.  I was hoping that I could get the company onto the Subversion bandwagon (it's free, it's fast, and it's more stable than VSS by far).  I was hoping that the developers would be open to object persistence alternatives like NHibernate or maybe EntitySpaces (or, dare I suggest, DLINQ?!? Only in my wildest dreams).  I was hoping that I would meet up with developers interested in design patterns and forming a common design language.

But it's not to be...yet.  Maybe my expectations are just too high.  I know I'm not the best developer in the world (I'm not that egotistical) and I'm certain that many would look upon my work as untidy, but there must be places out there where I'm expected to live up to expectations, not the other way around.

Actually, the worst part of it is that I just don't know how to approach other developers in a way that doesn't make me out to be a total ass (as I no doubt seem like now :-D).  I dunno...I'm not good at making slight hints; I'm just too straightforward and brutally honest.

Sigh :-S

20Mar/06Off

.Net Blogging Engines?

Posted by Charles Chen

So far as I can tell, there are only three free, "lightweight", open source .Net blogging engines out there:

  • dasBlog.  This is what my blog is using.  It's okay, but definitely lacking in some respects like proper XHTML markup, database post storage, and available plug-ins.  But it's completely free!
  • Vine Type.  Looks good.  XHTML compliant (very much so that the source is almost not recognizable as ASP.Net source).  Unlike dasBlog, however, Vine Type isn't completely free; it's free for non-commercial use only (which is a very loose term nowadays in the blogging world with the explosion of AdSense supported blogs).
  • SubtextLooks to be the least "feature rich" of the three (but I say this without having actually tried it).  Oddly, it's the only blogging engine whose site is not running off of the engine itself, which is somewhat disheartening.  Also lacking screenshots and examples, which makes it tough to get a feel for the features.

So are there other options available out there in the .Net space?  I dunno...looks incredibly lacking in all directions.

Random link (just because I feel like it, k?): A good discussion on Ruby on Rails and  .Net with some inspired commentary (don't skip the comments!).

Filed under: .Net 8 Comments
20Mar/06Off

Suddenly, the Entire Universe Makes Sense!!!

Posted by Charles Chen

Generally speaking, I like to keep my political leanings out of my postings, but I'll make a special exception today :-D

Via TheStar.com:

Remember the whiny, insecure kid in nursery school, the one who always thought everyone was out to get him, and was always running to the teacher with complaints? Chances are he grew up to be a conservative.

At least, he did if he was one of 95 kids from the Berkeley area that social scientists have been tracking for the last 20 years. The confident, resilient, self-reliant kids mostly grew up to be liberals.

The study from the Journal of Research Into Personality isn't going to make the UC Berkeley professor who published it any friends on the right. Similar conclusions a few years ago from another academic saw him excoriated on right-wing blogs, and even led to a Congressional investigation into his research funding.

So, which were you and what affiliation are you today?

I'd say that I wasn't very whiny; mostly quiet and introverted all along.  Today, I'm left of middle, not by choice, mind you (I don't go out to label myself).  It's more that my beliefs fall in line with more moderate "liberals".

17Mar/06Off

Subversion, Apache, Windows, and VS

Posted by Charles Chen

I've been meaning to try to see if Subversion is a viable version control tool within a group of developers.  I've been using it myself as an alternative to Visual Source Safe about a year ago after stumbling on it while trying to figure out why VSS was killing my projects.

This morning, I finally upgraded my SVN version to the latest release, 1.3, and tried to set up the HTTP access as well.  I had never set up that piece before as no one actually wanted to dip their toes in with me, so there was no need to share access.  After a lot of struggling with Apache 2.2, the latest release, I decided to give up on it.  The current build of the Windows distribution of Subversion 1.3 is incompatible with Apache 2.2 due to the a change in the APR versions (Apache Portable Runtime) from .9 to 1.2.  I was just too damned lazy to figure out how to rebuild the projects :-D Maybe next time.  So I had to settle for Apache 2.0...but all is well now (thanks Nader)!

I plan on putting together a simple workshop for this in the near future as it was terribly difficult to find anything up to date and end-to-end.  Anyways, here are a few good reading points to get started with:

Filed under: Technology 2 Comments
14Mar/06Off

Custom POP3/SMTP Mail Client

Posted by Charles Chen

Think you can write a better web mail interface?  I know I do :-D.  I'll have to take a look at it a bit more when I get a chance.

If you're interested, here are a few good starting points for ya:

  • A small introduction for a C# client implementation.  Looks like a good starting point to get your code going.
  • RFC1939 and subsequent extension, RFC2449.   The official specification for the POP3 protocol; a good reference to clear up any ambiguities when writing your implementation.
  • RFC2821.  The official specification for SMTP (used for sending email messages).  I dealt quite heavily with this RFC when I was at Factiva.  Quite an interesting spec, but probably better to use CDOSYS instead if you have that available and you don't need full control over the SMTP implementation.
  • An article by Duncan Mackenzie on writing a custom client.  Duncan also has a neat little ballon popup implemented.
  • A .Net 2.0 library for POP3 communication.  Looks full featured and documented...good starting point if you're not interested in the intricacies of POP3.
  • A good sample POP3 session "conversation" example.  It helps to understand how the messages are typically used in a session.

Will be interesting, I'm looking forward to getting some free time to work on this.

I'm debating whether it makes sense, from a performance perspective, to use a sort of POP3-SQL Server synchronizer to move messages from one or multiple accounts into one repository for fast indexing and lookup.

Filed under: .Net No Comments
11Mar/06Off

Back from Utah

Posted by Charles Chen

So I just returned from Utah and a trip out to visit my new cohorts at Zorch Software.

Man, I hate flying.  Planes are just terribly cramped and my legs feel like Jello after even 2 hours.  Not to mention that fat people that always seem to end up next to me and take up 1.5 seats, seemingly.  And what's up with the cell phones?  I swear, people in and around airplanes talk extra loud when they're on their cell phones.  I visualize myself punching some of these stupid people in the face and yelling "STFU!"  I just didn't have the patience.  When the screener at the airport asked me to take my fleece off, I blurted out: "So what if I have a weapon strapped to my chest?"  Seriously though, what's the point of making me take my fleece off if you don't make me take my shirt and pants off?  What if I have a gun strapped to my leg?  Oh that's right, the metal detector would catch it.  So why the fuck do I have to take my fleece off?!?!  And seriously, you think a terrorist would be stupid enough to even try?  They'd surely come up with much more creative solutions than the obvious.  Our airport security is a joke.

Okay, enough ranting.

But anyways, Utah--around Salt Lake City, in particular--is a beautiful place.  The area where I spent my week is surrounded on both sides by huge, snow-capped mountains.  It was awesome waking up in the morning and seeing the mist move past the mountains as the sun was breaking just behind the mountains.  Simply beautiful.

Some tips for anyone going to the  Salt Lake City (SLC) area:

  • Utah weather is weird.  Very weird.  When I woke up Thursday morning, my rental car was covered in 3 inches of snow.  Later that day, a huge blizzard whipped through.  Honestly, I've neve seen such a violent snowstorm (I've seen more snow, but the winds were wicked).  But then by afternoon, it was 60F and all the snow had melted.  WTF?  It was like it never snowed at all.
  • Google maps is all wrong.  The exit numbers in Utah in the SLC area are all wrong.  I spent a good portion of Monday night trying to figure out where the hell I was because the directions I had were just terrible.  Brad told me that they actually made an error during construction for the Winter Olympics in 2002 with regards to the mile markers. Doh!
  • Lots of places to eat.  So much variety and so many different choices.  Downtown SLC is just jam packed with restaurants.
  • Impossible to get a hotel room during the middle of March.  So Brad only booked me for the first two days since he couldn't find anywhere to book the full week.  The hope was that people would cancel, but I wasn't so lucky.  So I spent Tuesday night calling around trying to find another place to stay.  Called like 8 hotels.  Nothing.  Which leads to...
  • As I was told by Blake, Utah is the skiing Mecca.  So many people there skiing.  Wish I wasn't such a pussy :-D

All in all, it was a fun and productive trip (and a bit frustrating at times (did I mention I hate flying?)).  Brad's house was beautiful, although incredibly hard to find.   Some genius decided to name all of the roads in the development the same name with a different suffix (i.e. Draper Woods Dr., Draper Heights St., Draper Way, etc).  Also curious is the fact that those Utes like to keep all of their street signs the same size.  So even long ass street names like "Everglade Mountain Way" got squeezed onto these fairly small signs.

Okay, I'm ranting again.

Well, anyways, I liked Utah.  I'd even consider moving out there.  If you have a chance, do visit and enjoy the sights.

Filed under: Life No Comments