failing like never before

3Feb/084

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...

11Jan/080

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 www.42gems.com/blog/<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.

10Jan/080

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.

8Jan/080

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.

27Dec/070

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

/railsapp/themes/<whatever_your_current_theme_is>/layouts/default.rhtml

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!"

27Dec/071

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.

27Nov/070

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
27Nov/070

Porting Pains

A few quick note about a few problems that occurred when I ported my blog to Typo.

Firstly, I didn't move all my images over, so any posts that included images from my site, I didn't port. Fortuently, there weren't very many of these. As soon as I get a good elegent solution to uploading images (probably after finals are over), I'll re-post those articles.

Also, I didn't port comments, since it would have taken more time to write a script that could do that properly and I was too lazy to do it. But of course, I never reccieved very many comments in the first place. Hopefully, my site hits will increase now that I am using a blog engine that has trackbacks, RSS and all that fun stuff.

Tagged as: , No Comments