March 2009 Archives

Boise Code Camp 2009

Boise Code Camp & Tech Fest was this last weekend, and while I didn’t present this year (they had claimed to be full before I put together a presentation), I really enjoyed the presentations, and feel like I was able to contribute, even though I was not a presenter. I attended quite a few sessions, many of which I’ll be talking about in greater detail in the coming weeks here, but I figured I’d give my impression of the event here, before I dive into the technical details.

I’ve only been able to attend three Code Camps in the last few years. Two in Boise, and one is Seattle. Of the two cities, I’ve found that Boise consistently puts on the better events. This isn’t a put-down to Seattle per se. Boise’s event is simply a larger one, and despite it’s size, it’s very well run. However, this year was definitely a shadow of last years event, the economic downturn having (unsurprisingly) significantly reduced the corporate sponsorship of the event.

I attended a variety of sessions on subjects ranging from WPF, to ASP.NET MVC, to Mono, to Map-Reduce, to Android, to Unit Testing. This particular Code Camp is incredibly Microsoft-centric, which is another reason I wish I’d put together a presentation on YUI, git or something similar. Still, I picked up som pretty cool information, which I intend to share here.

We have once again raised the issue of trying to do a Code Camp in Pullman, trying to pull in the Moscow/Pullman crowd, as well as Spokane (which lacks a code-camp of it’s own). It’s an exciting proposition, but we’re unsure how easily we can simply pull the event together. I bring this up here, merely to gauge interest, particularly of those in the Moscow/Pullman/Lewiston/Clarkston/Spokane/Coeur D’Alene areas who would be our primary targets.

Lastly, I just want to congratulate the Boise Code Camp team on an excellent event, and I’m definitely looking forward to next year.

Semantic HTML

The last couple of weeks have featured some really excellent videos from Yahoo!’s Nate Koechley on Semantic HTML and Unobtrusive JavaScript. One was at MIX in Vegas, a Microsoft conference, but the other was at Yahoo!, and has been put on YUI Theater. I’ve gone ahead and embedded the video below.

Utlimately, I’ve always been a fan of semantic HTML. Was I not simply using default templates for this blog, I’d have strived to do them in a semantic fashion. I am working on this upgrade, but other things have taken their priority. However, in the code that I design, I strive for a meaningful layout and semantic accuracy. It probably helps that with my recent return to MUDding, and therefore to hanging out online with Blind-folks, the ability of the Semantic Web to aid Screen Readers is more apparent to me.

This video was nothing I’d never seen from Yahoo!, but it underscores part of why I’m so in love with Yahoo!’s attitude toward the web. The feeling that you always need to offer some experience, even if it’s not the prettiest experience, is a powerful one particular when paired with the principle of Progressive Enhancement. Now, admittedly, there are other companies that also follow this tenet, but I know of plenty of websites, including those I use regularly, that simply won’t function without JavaScript (and fairly modern JavaScript at that), and I’m unsure how they function for the blind.

It’s an interesting choice, to choose not to support a given demographic for whatever reason, and while I fully support people’s ability to do so, I also believe it’s not terribly difficult to simply do things in a standards compliant and semantic fashion, which can certainly ease the process of offering more universal support.

There is one place where my benevolence doesn’t extend however. Recently, Washington State University re-did their homepage, which I think is a major improvement. The flash-object in the center of the screen is dynamically loaded at runtime using the swfobject library to detect flash, and provide good content even if Flash isn’t available. I’ve been working on a JavaScript widget that would support my video embeds more cleanly on this blog using swfobject, but again, other things…

This did raise the ire of a web developer or two on campus who had installed flash-blocking add-ons into Firefox. The issue is that SwfObject detected that Flash was available, but the Extension stepped in and prevented the flash from loading, replacing the nice noscript/noflash version of the page with ugly ‘click here to play flash’ mechanisms. My argument, and the opinion held by the head of the team that designed the site, is that people who’ve chosen to handicap their web browsers in this sort of way (which isn’t to say there aren’t reasons you’d want to), can deal with the consequences of such decisions. Ideally, these extensions would provide some mechanism to detect their presence, and if they’d object to Flash being loaded (given that most of these extensions allow whitelisting), but until such a time as that happens, I believe the implementation we have is the best we can. However, I am open to suggestions.

Budget Hosting Woes

As I no doubt suspect a few people other than myself noted last week, my site was basically completely down for the last week. This was, to say the least, incredibly inconvenient, since I was without e-mail, unable to post to this blog, among other things.

My hosting is currently through MJZ Hosting, a very small company with pretty amazingly low rates. I’m paying less than a dollar a week for 1 GiB of storage and 30 GiB of traffic every month. An extra five dollars a year, grants me SSH access. I have as many Databases as I want. As many subdomains as I want. And as many e-mail addresses I want. It’s an amazing deal. And it works.

Most of the time.

Apparently, the story is that Matthew, the owner of MJZ Hosting, has been in the hospital for a few weeks (I share this, because he did). While he had people who should have been able to reboot the server, they were apparently completely incommunicado all last week, costing Matt several customers. Now, I’ve not left MJZ Hosting yet. But, I did have a potential client that had tried to contact me last week. While I don’t expect that bridge to have been burnt, it was still a bit of a wake-up call.

My website has been up somewhere around 99.9% of the time since I started hosting it with MJZ back around 2004. This is more than acceptable to me, when the downtime is spread out, but this last week has left me questioning whether I’m going to be continuing with MJZ when my contract is up in a few months. On the one hand, reliability is important, particularly when I’m beholden to someone else (even if they have been really good to me over the years), so I’m going to at least be considering other options.

In the meantime, I’m going to pick up where I left off. With roughly four posts a week, of things that I hope my readership finds useful and interesting. With any luck, we won’t see any more substantial downtime.

Quality Shoes

For years, I was the kind of person who would only own one or two pairs of shoes, and more than that, I’d very rarely spend more than maybe $40 on a pair. Even ten years ago, this didn’t seem like such a bad deal. Shoes used to consistently last at least a year for me, and that was with them being worn nearly every day. These days, a normal pair of shoes is lucky to last six months, and after that they’re pretty much relegated to spending the rest of their days in some landfill somewhere. These days, when I’ve begun to focus more on long-term use and reuse, it was time to begin looking for better options.

When we rewind the clock, even a century, we find a world where people treated shoes differently. They were necessary, but unlike most clothing, the tools (and skills) to make quality shoes were not commonplace. Enter the cordwainer and the cobbler. While these days, the only true cordwainers make extremely high quality, one off, pairs of shoes, in the not-so-distant past even the relatively industialized process of shoe-making still put out a product that a cobbler could repair as the shoes got damaged over time.

However, there are still shoe companies that put out shoes that can be repaired, generally at a fraction of the cost of a new pair. My wife recently let a pair of her Birkenstocks wear down to the point where both the footbed and the sole needed replacing. Total cost: about $60. Far better than the $120+ those sandals would have cost new. But there are other manufacturers that put out these sorts of quality shoes as well. Just search you local listings for ‘Shoe Repair’, and you’ll find a place like our Moscow, ID local Pecks Shoe Clinic. Look at the brands they sell, and that should give you an idea of the longevity of your shoes.

Currently, I’m just about in the market for some new Dress Shoes, and I’ve been really eyeing the Birkenstock Alabama line. Yeah, they’re almost $200, but they shoud be really comfortable, and most importantly, I can make them like new using a skilled cobbler and less than half of a new pair of shoes. Unlike a lot of clothing items, I think it’s a lot easier to tell the difference between good- and poor-quality shoes. Even if the shoes were easily repaired, thus saving money and resources over the long term. Plus, it creates jobs, since quality shoe repair is a skilled trade, and there are more people involved in making quality shoes than mass market shoes. Sure, more hands leads to more cost, but over the long term, quality shoes have a lot more value.

Breaking Humanities Sweet Tooth

We, as humans, love sweet food. Really, all animals do. Sweetness is a sign of simple sugars, which our bodies can easily break down for either quick energy, or long term storage for leaner times. Given our desire towards sweetness, and the cheap availability of artificial sweeteners like High Fructose Corn Syrup, it’s no wonder that the comment visitors to the United States (or Great Britain for that matter) most have regarding the supermarket fare available to us is about it’s sweetness.

We put sweetener in everything. At our local supermarket, all but one brand of Applesauce contains High Fructose Corn Syrup. You can find bags of frozen vegetables that contain HFCS. And there are very few national brands of soda which are still made with real cane sugar. Medical professionals talk a lot about the increasing waistlines of American’s, and how we’re killing ourselves. I myself am larger than I really ought to be, currently tipping the scales at just over 330 pounds. While my frame is larger, and therefore I can stand to be heavier than my 6’ height suggests, I know that I am still larger than I ought to be, and I feel that daily.

However, while I do come from a family of large people, the reasons behind my weight are simple. I ate too much, and I moved too little. My chosen career is even fairly sedentary. In short, my current health is my own fault, and I acknowledge that. However, when you look at the national trends in obesity and size, there has been a fascinating shift over the last century. Poor people are now, on the whole, fatter than wealthy people.

There is a reason that Gluttony is considered one of the Seven Deadly Sins. For the majority of human history, the only way a person could be gluttonous, and could reach the rotund proportions of obesity was through forcing others (and often many others) to go without. It required wealth and power. However, wealthy people could afford to eat, and eat more, and they did, feeding a biological imperative to eat. It is only in modern times, that we’ve had enough for everyone (at least, everyone in developed nations) to consume in this fashion, but that we’ve also realized the great comedy in our biology: That our desire to eat, and to consume, is not only killing us, but the very ecosystems we depend on for our food.

There is a difference, however, between the wealthy and the poor. While throughout history it was only the very wealthy who could afford immensely calorie rich foods, these foods are now widely available through the availability of inexpensive (or rather, seemingly inexpensive) sweeteners. And worse, these calorie-rich, but nutrient-poor foods are often the cheapest on the shelves. Therefore, the least financially sound are most able to afford those foods which bring little to the table buy high quantities of calories, but little else. It’s not just an issue of money, however. Those who become wealthy, particularly in the modern world, are not those who are born into it (necessarily), but rather those who desire it most. Even our current president was raised in a middle class family, only to gain great wealth and the highest office in this nation through his own ambition.

Sure, there are obese rich people. For my age, I’m doing fairly well financially (though I am far from wealthy), but after watching a few shows yesterday on the super-morbidly obese (like 900 pounds at 19 years old), I can tell you that these people generally appear to be, at best, lower middle class. And the foods that they tend to strive towards are foods which, for what they are, are far sweeter than we might traditionally think.

This is, in short, what Michael Pollan was talking about in The Omnivore’s Dillema when he mentions our National Eating Disorder. We live in a food culture where our own biological imperatives are skillfully marketed at, with many people either being unaware of the problem, or being unable to afford to get out of the vicious cycle our food system puts us in.

A lot of people like to blame High Fructose Corn Syrup for a lot of dietary woes. Some of these people claim that HFCS is simply worse for your than sugar. While there is evidence that suggests that real sugar makes us feel full while HFCS doesn’t, the real problem isn’t HFCS over Real Sugar, it’s the amount of sweetness we’ve come to expect from our food. I mean, when applesauce requires additional sugars, something is clearly wrong with our sense of taste.

Sweetness is a good thing, those sugars are certainly capable of bringing that quick energy we sometimes need, but if we’re going to improve our national health, we need to reboot our taste. We need to learn to appreciate our food for what it really it. And we need to force the food establishment in this country to stop making everything so damn sweet.

A Note for ASP.NET MVC Users

I’ve been trying all week (while interspersing this work with other work, obviously) to publish an ASP.NET MVC site that I’ve developed to serve a simple purpose, to take a form application for students applying for VA benefits over the Internet. Essentially, the page worked perfectly when I published it to our test site, but bombed when I published it to production. This was really confusing, since both sites are on the same server (which is, I know, less than ideal).

For a while, I wasn’t even getting any error messages from IIS, aside from a generic 500 error. I was finally able to get something more useful out of IIS, but even then, the problem was not immediately apparent. Let’s first step into what was going on on test, which worked fine. For this particular application I had requirement to run it on Test alongside Classic ASP code, which would not be present in Production. I was glad not to have the classic ASP code in production, as setting up an MVC app to run in this environment does take a performance hit.

First, to run an ASP.NET MVC site alongside classic ASP code, you’ll need to ensure that the App Pool is configured to run in Classic mode, and add the following to your web.config file:

<system.webServer>   
    <handlers>
        <add name="MVC" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
    </handlers>
</system.webServer>

This will cause every request to go through the ASP.NET routing system, allowing the MVC framework to work it’s magic, but not precluding the classic ASP code from running.

Now, the default web.config file for a new ASP.NET MVC project includes the following system.webServer configuration section:

<!-- 
      The system.webServer section is required for running ASP.NET AJAX under Internet
      Information Services 7.0.  It is not necessary for previous version of IIS.
-->
<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true">
        <remove name="ScriptModule"/>
        <remove name="UrlRoutingModule"/>
        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <remove name="ScriptHandlerFactory"/>
        <remove name="ScriptHandlerFactoryAppServices"/>
        <remove name="ScriptResource"/>
        <remove name="MvcHttpHandler"/>
        <remove name="UrlRoutingHandler"/>
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </handlers>
</system.webServer>

For me, the most important part was that comment at the beginning, which pretty clearly states that you should only need the following block of configuration if you’re using ASP.NET AJAX in IIS7.

This information is false.

You need this block to run ASP.NET MVC in IIS7 under an Integrated Pipeline as well. If you don’t have it, you get obscure, almost meaningless errors about your configuration file. I hope that by the time ASP.NET MVC 1.0 Final is released that comment is updated, because I certainly felt safe removing that block of configuration because I simply am not using ASP.NET AJAX. All my JavaScript is being done using YUI, which is just the way I like it.

Now, I just need to update my Build Scripts to properly work for both Testing and Production Deployments now that I’m armed with this new information.

Seeds Arrived

We finally got our seeds for our garden in the mail last week. Not knowing any really local seed suppliers, and not having a large selection of catalogs to select from, we went with one that randomly showed up in my mailbox at work, since their catalog made us feel comfortable with the company.

Horizon Herbs, located in Williams, Oregon, does purport to be primarily a medicinal herb seed company, but they do have a large supply of crop seeds. Part of what made the catalog more attractive was the fact that they included the latin names of every plant in their catalog, which for my wife as a boilogist who dabbles in botany was a win. But more than that, their prices were very reasonable, they grow as much of their own seeds as possible, and having ordered from them once, we were really pleased with the speed at which they got us our order.

Yes, their “11 Reasons to Choose Horizon Herbs” list includes an entry for ‘Magical, Religious, and Entheogenic Herbs’, but you know what? This company is just clearly really into seeds, and while the jury is still out on how we’ll feel about them at the end of this gardening season, so far the experience has been fantastic.

We choose to go with their pre-packaged garden kit, the Hoedown Collection which arrived nicely vacuum packaged. Further, the company makes some key promises with regard to the collection that made us feel good about buying it. They claim that the seeds are germ-tested and viable, so we should have good success. Plus, they are all open-pollinators, so we should be able to save seeds if we wish.

Admittedly, we’re still going to be buying some more plants from the market this year. Some of our favorite tomatoes were F1 hybrids, and our the pepper selection in this package is non-existent, though we did augment our order with a package of pepper seeds. Pretty soon we’ll be starting seeds inside, and then tilling our plot.

We only have a 20’x20’ plot, so I’m not sure we’ll be able to go through all the seeds we’ve got this year, but at least we know we’ll have plenty. As we get more of our plans laid for this years garden, I’ll be posting more information about what we’re doing, and I’ll try to include some pictures this year.