Seriously?

 

MetalXmas.com


My friend Dave and I embarked on a project a few weeks ago, initially just meant to be an audio CD for our family, that included some rockin' versions of everyone's christmas favorites.  As we started to record it, we got more and more excited about how it might turn out.  Being the uber code master that I am, I opted to make a website... then in a blink, a friend who is incredible at Flash offered to help. This turned out to be a great experience for all of us, and the feedback has been tremendous. 

I'm very proud to share with you (make sure your speakers are on) www.metalxmas.com 

The code-behind
I wanted to have a spot for friends, family, and haters to post their honest ramblings, so I decided to go with the much-loved JQuery/ASP.NET MVC combo; what a joy as always.  One bug I ran into, that seems to have been noticed before me, is the ability to cache the root page of your ASP.NET MVC site using the OutputCache attribute.  According to this thread, the mvc team will have a fix soon.  For the time-being, I ended up caching at the repository level by just sticking the data response from disk into the HttpContext cache to ensure I only read and parse my xml file every 10 seconds.

Nothing else too interesting came up. I added some spam protection, input validation (client and server-side), and HtmlEncoding to protect any hijacks.  All in all, another great experience.  I would share the code, but I have a certain Oxitephobia.

Scalability
In the hopes (and delusions of grandeur) of this thing being picked up as even a semi-viral hit.  I wanted to make sure the site wouldn't go down.  I placed the flash file, the four mp3 files, the images, and the css file on a CDN.  I initially started with Amazon S3... but at 15cents/gig compared to SimpleCDN's 6cents/gig I had to switch.  I've been very happy with my experience, and they even include $15 worth of free credit when you first sign-up.  A friend of mine suggested I use the YSlow plugin to analyze my site; this ended up with the following configuration:

  • HTTP Compression enabled on CDN (via url configuration) and IIS (c'mon, if you haven't done this yourself already, DO IT NOW)
  • Set content expiration on all files on CDN to have 10 year expiration headers (I named the files themselves with version numbers to allow for forcefully expiring if needed)
  • JQuery and SWFObject scripts hosted via google
  • All scripts at the bottom
  • XHTML 1.0 Strict validated by W3

This ended me with an A score with YSlow.  I felt accomplished.

Parting thoughts
I hope you enjoy it, it's definitely meant to be funny - so don't take it too seriously.  Feel free to pass it along to your friends and family!

Are you a highly motivated .NET code monkey developer in the Tampa Bay area with a passion for software and the ability to learn quickly?

 

if(not){return;}

Come join our top-notch team of developers who utilize the latest technologies (JQuery, NHibernate, CruiseControl, Nant, Resharper, etc.) to build the essential tools for the nation's largest and fastest-growing audiovisual firm.


The ideal candidate will have:

  • Minimum 2 years experience developing applications.
  • Minimum 1 year experience with C# in ASP.NET and/or Windows Forms.
  • Strong experience with MS SQL Server.
  • Solid skills and knowledge of HTML/DHTML, JavaScript and XML.
  • Excellent written and verbal communication skills.
  • Ability to learn quickly, as well as think and work independently.
  • Passion for learning new technology and implementation techniques
Apply now and come play with us

In my neverending quest to keep my domain minimal, I ran into a query that I wanted to perform with NHibernate that seems to be impossible without adding an additional property and hbm mapping definition.

Note: I still consider myself rather new to NHibernate, so this might have an obvious answer.

Let's say I have following two classes:
public class School : EntityBase
{
     public string Name { get; set; }
     public IList<Student> Students { get; set; }
}

public
class Student : EntityBase
{

    
public string Name { get; set; }
}

The School.hbm.xml file contains this in the body:
<bag name="Students">
    <
key column="SchoolId"/>
    <
one-to-many class="Student"/>
</
bag>

The database representation of the above looks something like this:
Db representation

Without making any changes to my classes/mappings, I can perform this SQL query to retrieve all Students who's name contains 'Powers' that belong to a school who's name contains 'Middle':
SELECT * FROM Students
WHERE
     Students
.Name LIKE '%Powers%'
    
AND
    
Students.SchoolId IN (SELECT School.Id FROM Schools WHERE Schools.Name LIKE '%Middle%')

So - Here is the question, how can I do this in an HQL query without making any changes to my domain (which would be specifically adding a School property to the Student class and defining the relationship in the Student.hbm.xml file)?

Josh: I am excited to be furthering the development of your tremendously popular website.  How may I gain access to the source control repository?
Customer: Give me a second... *You've got mail! - sourcecode.zip*

Wow, this isn't my ideal way of getting my hands dirty in a project.  But, this will be easy to fix.

Opening this .NET 1.1 ASP.NET app, I find three projects and no solution file.  Confused, I open the projects individually and realize there is a huge circular reference issue that was circumvented by compiling the projects seperately and then referencing their output assemblies. Yuck. There are also heaps of bugs in the code causing all sorts of unneeded memory usage that's causing the application to freeze and recycle several times a day.  Finally, I'm told that all of the latest features created for the site have been causing problems everywhere else.  I think it's time for a change.

After several weeks of unit tests, refactoring, SVN, and CC.NET configuration.

  • The site no longer crashes.
  • Features can be implemented faster and more effectively.
  • Source control provides a source history with much safer storage.
  • A new version of the site can be deployed with the click of a button.
 There is still a lot of work to be done.  But, I think this goes to show the power and reason for being agile. 
It appears that the new Windows Live services portal that Microsoft has been pushing has finally caught my eye.  A new service that will allow me to communicate with Windows Media Center over the Internet. The interactions allow users to remotely record television shows, find programming information, and discover viewing preferences from buddies in their MSN Messenger social network.

Now they aren't saying yet if this service will allow for remote viewing, but lets hope we hear more about that soon. Kris Barton at Microsoft provided this screenshot of this sexy service in action.
Google has posted a very interesting analysis of the code/authoring techniques of over one billion documents here
It seems much of the data they collected was pretty obvious (ex: the abundance of  the "a" and "img" element).   But, it's still an interesting read.
I'm liking the new vista website design.

http://www.microsoft.com/windowsvista/default.mspx

Wow this thing really is small.  But, where is the headphone jack?

CNet has a list of 10 PC Games available for free download.
  • America's Army: Special Forces
  • Battlecruiser 3000 A.D.
  • Grand Theft Auto & Grand Theft Auto 2
  • Hidden & Dangerous Deluxe
  • The Marathon Trilogy
  • Return to Castle Wolfenstein: Enemy Territory
  • Starsiege: Tribes
  • Wild Metal Country
  • The Zork Trilogy

More Posts Next page »