Posts

Update

October 8, 2010 · 2 min read

I promise I haven't been intentionally neglecting you, Mr. Blog.

A lot has changed since the last time I posted here. I basically got laid off from a position in IT working for my dad's company at Omega HR Solutions, Inc. I transitioned into a career path I chosen in college: software development. It was rather fortunate that I had been doing a lot of work in .NET throughout the 10+ years of working for them to produce relatively usable code.

My current position is with Swerdlin & Company officially as "Software Developer" until a cooler title can be coined. Normally, I usually keep a low profile regarding my employment primarily due to negativity I tend to generate regarding some of the work I've done in the past. I think that behavior is going to change dramatically. Why? Well even the worst most annoying task I can be assigned is an exciting challenge and it isn't every day I can say that.

Even though my dataset is limited, Swerdlin is the greatest company I've ever worked for. We have an annual Dog Day in June, "Giant cupcake day" (STARS) roughly every 1-2 months, and I'm given a great deal of professional and creative freedom. I'm typing this on my laptop that I'm allowed to bring in every so often to work on personal projects. My boss' reaction to asking was "If you're working on a personal project, what you learn is directly transferable" to paraphrase a bit. Amazingly cool.

I'm hoping that with this post I'll start a renewed desire to post more but I might be starting more music related posts. Part of me doesn't want to considering "music blogs" are a considerate portion of the online community map but perhaps I can find something to make it unique. Initially I hope to post reviews of some of my favorite bands latest works or critiques of the more recent concerts I've been to.

Here's a partial list of what's coming:

  1. My friend Andrew's band V. Caldera played a "badass" show (their terms) at The Vinyl on September 25th.
  2. Avenged Sevenfold's latest album Nightmare is insanely awesome.
  3. Ditto for Atreyu's Congregation of the Damned despite it being out for nearly a year before I heard of it.

I also plan on actually writing music so my hope is to also use this blog to flesh out ideas and various universes characters can play in. My intention is to create moods using (hopefully) complete backstories in some ways like how Coheed & Cambria work but not directly. I suppose only time will tell if the idea is useful or useless.

ASP.NET MVC hosting lesson: Elmah and SQL Server 2000

April 3, 2010 · 2 min read

Background

Technically this isn't specific to ASP.NET MVC at all, that just happens to be how I use Elmah. I started work on an ASP.NET MVC project with certain erroneous preconceived notions. I originally started the database with SQL 2008 in mind because I run Windows 7. An easily accessible staging server used SQL 2005 and it was here that I ran into my first compatibility snag. A database project may be set for an earlier revision but you can't transplant those .bak files and expect them to restore. This is generally 101 level stuff but something I tend to keep in the back of my mind at the worst times.

This staging issue foreshadowed production: the shared hosting company I use is running SQL 2000. Argh! Luckily this process was less painful: I used SQL Publishing Wizard and SQL 2000 in a virtual machine to get the database on the lowest common demoninator. Once in SQL 2000, the backup files will easily restore in any future version of SQL. Because the push to production is so infrequent and changes can be diff'd easier than rebuilt I've settled on a structure of Development: 2005, Staging: 2005, and Production: 2000.

Elmah and SQL 2000

I chose an Elmah version (1.1.11517.2009) that dealt specifically with SQL 2005 but was hopefully new enough to be relative to ASP.NET MVC. Switching to SQL 2000 produced a very minor snag: the database script needed to be downgraded.

Fortunately, and with the help of Google code, I could go back to other revisions of the same file in the Elmah codebase and find a version suited for SQL 2000 dated earlier this year. Here's the diff link to show what changes were made: http://code.google.com/p/elmah/source/diff?spec=svn705&r=643&format=side&path=/trunk/src/Elmah/SQLServer.sql&old_path=/trunk/src/Elmah/SQLServer.sql&old=568. When downgrading to SQL 2000, use the left hand side or you could just download the file.

Update (2019): Since Google Code has long been out of service, Elmah can now be found at https://elmah.github.io/. To get an appropriate SQL 2000 file, you may have to look at v1.0 and v1.1 sources. I would think in 2019 you would likely choose a more recent SQL Server version.

While you are there, you might as well follow the examples given by Scott Mitchell Keeping ELMAH's Error Log Size In Check and Deleting All Records In a Table EXCEPT For the N Most Recently Added Records. Why both? The first prunes any records beyond a date range to keep errors relevant. The second makes sure your database stays small in case of anything that can trigger a large number of records within your date window.

Using jQuery to Simulate the <Blink> tag

March 15, 2010 · 2 min read

While this post actually has nothing to do with ASP.NET MVC directly, the only common denominator is that I came up with this technique while working on the platform.

To be a true 1:1 copy of the previous website I would be converting to ASP.NET MVC, I had to come up with a way to reintroduce the <blink> tag to XHTML. While you are perfectly able to use <blink> it doesn't actually do any blinking in IE8 or Firefox. To show that properly, jQuery comes to the rescue.

The technique is really pretty simple:

  1. Define your element with an arbitrary id or class (i.e.: <div id="#alertheader">)
  2. Style the content accordingly
  3. Use jQuery/javascript to show and hide content on an interval
setInterval(function() {
    jQuery.each(jQuery.browser, function(i) {
        if ($.browser.msie) {
            $('#alertheader').css({ opacity: '0' }).stop().animate({ opacity: '1' }, "fast", "swing");
        }
        if ($.browser.mozilla) {
            $('#alertheader').stop().animate({ opacity: '1' }, "fast", "swing");
        }
    });
}, 600);

You should hopefully notice the caveat I ran into immediately. IE and Firefox animate their opacity changes differently so it required special handling. An easy exercise for the reader would be to optimize this code to remove the IE/Mozilla check during the setInterval call.

You can achieve similar results by using a series of .fadeOut(x).fadeIn(x) calls but I had to make sure the sum of all calls didn't become less than the setInterval "loop" or it would blink wildly. The other problem it introduces is when text "fades" it can often look weird in either browser if you use a relatively fast interval. This became a headache very early on.

While I can't take whole credit for the technique, the primary Stack Overflow problem that got me started can be found here: https://stackoverflow.com/questions/1375646/jquery-animate-opacity-doesnt-work-properly-on-ie. In the post the user Eric states that jQuery should handle the opacity support for you. It does. For some reason to produce output I felt was adequate, no one definition would work across both browsers.

Moving...

February 1, 2010 · 1 min read

I'm still in the process of moving but managed to move the computer + desk. I've moved to a much smaller room but the group of friends is a little more in sync compared to the other living arrangement. I still need to share living with other people which tends to suck in certain directions.

I'll reiterate the obvious: moving sucks. I'm sore. I haven't slept much but I'm thankfully about 80% done. Cleanup is going to suck and thankfully I can take trash to where I am now then dump it at work periodically where they have a bigger trash collector.

The only costs so far have been time and gas money, with a large help from my fiancee Miranda.

I was living with someone who has easily gotten by without the internet for a week. Myself? Not so much. I enjoyed "time off" but as a visual learner that needs to see things in front of him, it became incredibly difficult to walk anyone through anything internet related. I made it a point to be very much a part of a plugged-in culture and that showed how dependent others were on my involvement.

I think most of all at the moment I miss my bed and the ability to just do something on the computer then pass out. I should take the opportunity to break the habit as much as possible though.

Going "dark"

January 23, 2010 · 1 min read

I'm currently in the process of moving so from the weekend of January 23rd through as fast as I can move, I'll have limited internet access.

I'll use the free time to create a proper sample project to include all the ideas stirred in the outline I made here: Upcoming ASP.NET MVC posts. I'll try to write up as much as I can from various wifi spots with the intention of getting the bulk of it out within the next week. I'm tired of this being on my To-Do list but moving does have the higher priority at the moment.

Let the withdrawal begin.