failing like never before


New Site Design

I began a major rehaul of my blog's visual appearance two days ago, and I've been tweaking it up until now. My new theme is based mostly on Designer-daily's "Gone Fishing" theme. I decided that my old theme, which was another stock theme from the wordpress themes database, was too "light-colored."

Old visitors may notice that my blog is now significantly darker in color, though still blue. Also, my old "Pure" theme was built to accomadate monitors that have a maximum horizontal resoultion of 800px, whereas my current theme is slightly wider then 800px. In the past I have always tried to make my webpages render nicely on older computers. Now of course, I doubt that anyone still has a monitor with 800x600 resolution, and if they do they probably aren't reading my blog.

I made some changes to the stock "Gone Fishing" theme.

  • I changed the default font-type to Verdana, which in my opinion is a prettier font (for some reason, on my Linux boot, Helvetica looks like a flock of birds crapped on Times New Roman)
  • Changed some font sizes around in the main CSS stylesheet
  • Shrank the right sidebar significantly, thus making the main column much wider. Who the hell needs that much space for a side-navigation bar?
  • Dumped the default banner which depicted a sketch of a fish's mouth, and replaced it with my own custom banner. I really needed an image in there to spiff things up and I thought the fish was kinda ugly, so I stuck in Tux the Linux penguin.

Keeping the stock theme was out of the question, not because I think its ugly, but because I don't want people looking at my blog and seeing a "canned blog."


Draw Me In

I looked through my stats and log files today (instead of doing my homework), and determined which articles were drawing the most visitors to my site. Mind you, this was not an in-depth study, just a cursory glance at my stats.

  1. Dynamically Create a Multidimensional Array in C/C++ - The most popular article on my site was a new one. It would appear that lots of people were searching for ways to dynamically create a multidimensional array and Google kindly linked them to my site.
  2. more stocksquest - This one surprised the crap out of me (pardon my Klatchian). Back in high school, I had nothing else to put on my blog, so I posted my econ class's stocksquest rankings (notice who's number one). It would appear that lots of people use internet search engines to search for their own name. Since pretty much none of my classmates were vaguely famous on the internet, the ones with fairly unique names ended up at my site. Funny how that works out. I bet none of them ever realized whose site they found themselves looking at.
  3. problems with gallery - So apparently lots of people have problems with an uninitialized constant when using attachment_fu. Back when I was working on my blog CMS, I had a problem with attachment_fu and I posted the error message on my blog. I found a solution eventually, which I still remember today because the error was particularly annoying. Basically what happened was there was a misspelled variable name, and if I remember correctly, I copied that code fragment from another site (which would explain why everyone is having the exact same error). I remember that I spent forever looking and it turned out that one of the variable names was spelled beginning with a lowercase letter, which resulted in the uninitialized error. Sorry that I can't remember the exact name of that variable or where it was, but it was almost a year ago.

And thats it folks...


Way Back When

Way back in the days, almost a year ago, this site was running my custom CMS. It didn't look too bad, but it wasn't very configurable and lacked all the bells and whistles that make a mature blogging platform like WordPress so much cooler.

Here's a quick list of the functions that my custom application offered:

  • Image gallery: Upload a picture that was less then 1mb in size and my application would save it and create a thumbnail, there was also a simple gallery interface
  • Live search: A fairly simple feature to implement under Rails. For those of you that still haven't heard of web 2.0, "live search" is where the user types into a search box, and results are returned instantly, without having to actually hit enter and go to another page (try the live search in my left sidebar!)
  • Anyone can join!: My application allowed anyone to keep a blog on my site. Your blog would be hosted at<blog name>/, because I didn't know how to create subdomains automatically.
  • Comments: A vistor to the site could add comments without having to register, and they could add cool little emoticons by using TinyMCE. The only problem was that I didn't use CAPTCHA, Akismet or any kind of comment moderation, so I had massive spam issues.
  • Easy to use: One of the upsides of having very little features, my application was extremely easy to use. In that respect, it was vaguely like the ipod, except the ipod isn't free.

And thats about it in terms of feature sets, for my old blog application. I believe pictures are in order...

custom application, main page custom application, image gallery custom application, post and comment

But before I moved to WordPress, I was using Typo. See here for reasons why I decided to move to WordPress. And just because I feel like it, here's a really low quality screenshot of my old Typo blog, using the iWTAP theme.


42gems Explained

I looked at my site's URL today and wondered why I chose the domain name “42gems,” and for the life of me I couldn't seem to remember why. Before I go any further, I'd like to describe how and why this site came about.

During the summer of '06, before I started my senior year in high school, I was an intern at Intel Corporation. I worked in Technology Automations and Manageability Services, a subgroup of IT. Essentially, my job was to design web applications. This of course, required that I know some sort of server-side scripting language. My manager gave me two choices, Microsoft .NET or Ruby on Rails. During that time, I knew very little about web programming, my programming experience consisted solely of c/c++, Javascript, and some HTML and CSS (of course, neither HTML or CSS are really programming languages, but I digress). However, even when I was sixteen I still had a dislike for Windows, so I chose Rails over .NET.


Migrated to WordPress

A little more then a week ago, Typo 5.0 was released. Shortly after that, version 5.0.1 was released to fix a bug, and the next day after the 5.0.1 release Typo version 5 was pulled from the mirrors because of a critical bug that would result in the application purging the blog's database. I upgraded to 5.0 almost as soon as it first came out but downgraded back to 4.1.1 as soon as I heard about the new bug.

But even with version 4.1.1 I experienced numerous problems with Typo. In December of 2007, 21.1% of all the HTTP error codes returned by my server, were 500 (Internal Server) errors. In one month alone, the Typo application on my domain experienced 208 internal server errors. I've experienced many of these before. Occasionally, after writing a new post up in the admin section, I would click the “submit” button only to get a 500 error. Or I might be on the home page and click on a category link, again, only to get a 500 error. Most of the times, these errors would disappear once I hit the back button in my browser and tried clicking on the link a second time. But these were aggravating errors and shouldn't have been popping up in a stable application release.


Lightbox in Typo

A quick little explanation and demo on how to get lightbox running in Typo 4.1.1.Typo 4.1.1 uses an older version of lightbox. If you prefer to use the newer version of lightbox, then go here and download lightbox 2.0. Then, in your Typo application's public directory and overwrite the old lightbox javascript, styles, and images.

You'll also have to make sure that the theme you're using for your blog, has the necessary javascript and stylesheets included. To do this, open


and ensure that the following lines of code are in your header.

<%= javascript_include_tag "typo" %>
<%= javascript_include_tag "lightbox" %>
<%= stylesheet_link_tag "/stylesheets/lightbox.css" %>

I would also like to add, that one of the javascript files needed by lightbox is massive 23kb. So if you want to keep your web page as light as possible, you may want to consider not using lightbox effects.

To use lightbox in your blog, just add the following code into the article you are posting:

<typo:lightbox src="image_link" thumbsrc="thumbnail_link" />

Here's a few examples of what lightbox can do.

"The Solid Gold Sound of the UCLA Marching Band!"


The 500 Epidemic

Some of you may have noticed, that about three weeks ago, all but one of the blogs that I was hosting on my server, crashed, and stayed down for about two days. When I tried to access any page, I got a 500 error, and it was traced back to a Typo application error. This was really weird, since prior to the strange epidemic of 500 errors, I hadn't touched my server in quite a few days. However, one of the blogs on my server was working absolutely fine.

The application that was still functioning had been on my server the longest time. I thought that perhaps the newer version of Typo was unstable and that the blog that was still running was using a more stable code base, but no; all my blogs were running the exact same version of typo.

I went through some basic checks to see what was going on. The log files weren't particularly helpful in telling me what had happened, and mostly just showed that the applications had all failed around the same time, for no discernible reason. I use fast CGI, so I tried switching to just regular CGI, but to no avail. I checked the permissions of files, and even set the permissions for the whole applications to 755. I double checked source files and their timestamps, and found that it had been quite some time since any of them had been altered. I also checked to make sure that rails hadn't gone and updated itself to a less stable version, but it seemed as though nothing on my server had changed. My applications had just died, for absolutely no discernible reason.

It seemed that the easiest thing to do, was to just wipe the application out, and put rails back in. So I took one of the blogs that had hardly been used, and wiped it clean out, but left the database intact. I downloaded a fresh copy of the latest stable copy of Typo, tared it, made the necessary configurations, and found to my total surprise that it gave me the exact same 500 error! After much fiddling and triple-checking to make sure I hadn't messed up the simple installation process, I was still getting the same 500 error. I wiped the application out and tried yet again, getting the same results. The only thing that could seem to be wrong, was the database, so I wiped the database clean, and did a completely fresh install. Still the same results. I had never been this confused in my life, and that includes my Chem 20a final.

But remember, I still had one functioning blog left on my server. So I decided to copy the source code from that 500-error-imune application, and put it on a sub-domain and connect to a new database. And it worked. I have no idea why that particular instance of Typo was immune to the "500 epidemic" but it was, and I was too happy to ask questions.

Three weeks later, I still have no idea what the hell happened. If someone could enlighten me, I would be very happy.


Massive Fayle

It would appear that everything is not "fine and dandy" as I would like it to be. Typo is experiencing "massive fayle" right now. Hopefully, I can fix it very soon.

Under the admin pages, when "managing articles," pagination appears to be broken. When I attempt to move to page 2, I get the following.

Application error (Apache)

Change this error message for exceptions thrown outside of an action (like in Dispatcher setups or broken Ruby code) in public/500.html

Tagged as: , , No Comments