Inherently Bad or Lost in the Dark?

In a recent blogpost with a sensationalist headline "Why Programmers Suck at CSS", Stefano Mazzocchi starts off abrasively by stating:

I think that programmers tend to avoid doing certain things not because they are inherently bad at it, but because they don’t know how to proceed. They find themselves in an uncharted and foggy territory, without a map, no sense of direction, and with a limited ability to know if they’re getting any closer to where they want to be.

Are we talking about some deep philosophical subject here or are we talking about HTML and CSS? What's this? Seven paragraphs (before any talk of actual CSS) of "I have studied the programmer. I know his faults and understand his learning methods"? Really?

If a programmer wants to learn CSS, he buys a book and starts coding. If he doesn't want to learn it, he is not asking to be berated by some self-proclaimed CSS guru.

Stehano's article is filled with CSS that does not work in Internet Explorer, aka does not work in the real world. His proposed fix? Include some magic JavaScript files that supposedly make everything better in Internet Explorer 6 and 7. Why does he do that? Shouldn't we understand why these things don't work and what we can change in our CSS to not require some magic JavaScript file? It's almost like Stefano is in the dark, with no sense of direction. Or maybe he's just inherently bad at IE bugs.

Written in / October 27th, 2008 / 0 Comments

TextMate Halloween Style All Over Again

For Halloween in 2006, TextMate pushed down a little update on everyone that added a new Halloween-styled theme, a new dock icon and a new splash image. It was awesome, but they took a lot of shit for it because apparently the world is filled with a one or two uptight developers. Go figure.

Well I doubt TextMate will ever make the mistake again of "having a bit of fun" with their fanbase, but I still love that theme and am rejoicing at the opportunity to bring it out from the cobwebs.

Here is how I brought it back:

  1. Download this large PNG (cobweb splash image)
  2. Download this Mac OS X icon
  3. Quit TextMate
  4. Copy the splash.png image to ~/Library/Application Support/TextMate/Spash.png
  5. Replace your TextMate.app icon with the one from step 2.
  6. Start TextMate and smile.

Update: For those who want to go all the way, you need the Halloween theme as well. Download the All Hallow's Eve TextMate theme here and then unpack it to your ~/Library/Application Support/TextMate/Themes directory, then go into TextMate (you might have to restart it to pick up the theme) preferences and choose this theme.

Written in / October 13th, 2008 / 0 Comments

Rails Shared Hosting Gotcha #3,942

Running Rails in a shared hosting environment is a prickly one. This fact has been well documented for years now. But I like to torture myself sometimes. I read a quote recently that I am reminded of: "if it hurts, do it more often".

Well, I'm running, or attempting to run, three Rails sites on a few different shared hosting servers at Dreamhost. Generally they run OK but sometimes they die and I cannot bring them back to life without a few hours of frantic keyboard strokes. Usually these times coincide with Dreamhost updating one of the following: rails, ruby or rubygems. Updating ruby and rubygems does not happen regularly enough to cause much pain, but I swear to fucking god it seems like they are updating rails every 3 months and every time my apps crash. Yes I have frozen my rails. Yes I am specifying a RAILS_GEM_VERSION in my environment.rb. The problem persists.

The latest failure occurred when rails was updated to 2.1.1. I watched it happen first only on one of the sites, then, when Dreamhost came around to updating the other server that I have apps on, those apps crashed as well. This was the interesting error I received:

RubyGem version error: actionpack(2.0.2 not = 1.13.6)

The code was still running through my frozen rails, but on one of the requirements it was falling out of my frozen rails and trying to require a more recent version of actionpack. You bastard!

/home/user-name/domain.com/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb 495 in `require'

Turns out the fix was easy enough though, but it required manually freezing my rails instead of using the rake task (rake rails:freeze:gems) since the version of rails I was freezing to (1.2.6) was no longer installed on my server.

Step one was to download the version I wanted from github. Then upload it to my app's vendor directory, unpack it, rename it to 'rails' and then touch tmp/restart.txt to tell passenger to reload my app.

Hey, it worked. Really weird because I froze rails back in June of this year to Rails 1.2.6, and everything was fine then.

Dreamhost's support was surprisingly silent on helping me with this. First they let me support request sit in their queue for over 3 days, then they replied with a "hey not our fault, your scripts are borked" reply. Great. Well it's over 5 days later now and I can fix it my own damn self, thank you very much.

Currently looking for VPS plans. Word on the street is slicehost which starts at a mere $20/month for 256 MB of VPS goodness. Hmmm....... there will be more on this topic I am sure.

Update: I was talking with a coworker about this and he reminded me that the older frozen Rails would not include the actionwebservice directory whereas if you freeze Rails now, it does. Also, the Rails 1.6 that I downloaded from github also included the actionwebservice directory. That seems to be the major difference between the frozen rails that was failing for me vs. the frozen rails that's running fine now.

Written in / October 6th, 2008 / 8 Comments

My First Webpage Rocks

As a professional web developer, it's pretty funny to come across one of the first web pages you ever wrote. And embarrassing. Recently, Google just had their 10th anniversary and as part of the celebration they dug up a really old web index they had lying around from 2001 and put it back online.

So as any self respecting web junkie would do, I immediately searched for my name. Not too many results for me, but Google did have my university home page already archived at least. It's a funny, simple HTML page that included a snippet of text telling people to check out my "real site" (I'll save that discussion for another time). The rest of this little page consisted of a link/image to my favorite search engine at that time, Google, including an inline search form that posted to Google (wow how cool is that, you can post form data from one site to another??!!!! amazing!!!!!). Then I closed that page out with a link/image to my favorite band, Phish, and then a naive mailto to my primary email address.

Granted this wasn't my main site but I just found it really funny to go back that far in time into my "internet history" and find something like this. Equally funny was my advocacy of Google, especially given the circumstances of how I rediscovered this page.

See Justin K. Perkins Old page from 2000/01 time period. Btw, the name of that page (sac10559) is my old university unique ID, and I swear I don't think I will ever forget it for the rest of my life. I must've typed/written/said that string of characters a million times while in college. For the curious, my old web address was: http://webpages.csus.edu/~sac10559/.

From an ever loyal fan, thanks to Google for a pretty alright search engine and thanks to web archive for keeping tabs on all our content.

Oh, one other thing, go check out that page and click the search button without entering anything in the search box. Oh DAAMMNNN!!! Look at those scripting skills!!!!!!

Written in / September 30th, 2008 / 1 Comment

Putting Chyrp Blog in a Subdirectory

Today I decided that I wanted my blog in a subdirectory so that I could just have a super simple (and slightly silly) home page. So I just made the index.html file for the new home page, made a subdirectory in my main website directory and then moved all the chryp files in there. Whoops I broke the blog.

This is what you do to fix your chyrp blog if you do what I did:

  1. Go to your admin settings page (your-domain/admin/?action=settings), you will have to manually enter the URL because the paths are all screwed up, but that's what we're about to fix. See the field "Website URL"? Fix that to include the subdirectory but don't include a trailing slash.
  2. Now it should sort of work, at least the home page will but if you click to read a blog post it will break. That's because we forgot to move the .htaccess file over. Or at least I did. So move that from your webroot to the subdirectory.
  3. Last step, edit the .htaccess file so that instead of it saying "RewriteBase /" at the top make it say "RewriteBase /sub-dir-name".
  4. That's it.
  5. Silly easy, but the chyrp community is really small and I couldn't find any info about this little chore. But it's here now! Hooray!

    Oh yeah, I am running a pretty old version of chyrp, 1.1.3.2 to be exact. The steps described may no longer be applicable to more recent versions.

    9/14/08 Update: If you've moved an existing blog, then there's one step I left out if you want to preserve any existing links to your blog. You need to setup a rewrite rule in your webroot's .htaccess file to transfer any old content to the new blog location. I used the following:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* blog%{REQUEST_URI} [R]
    

    Written in / September 10th, 2008 / 0 Comments