.::output >> /dev/null::.

where otherwise good ideas go to waste

Some problems with GUID

Posted by Nicholas Chen Thu, 22 Dec 2005 04:19:00 GMT

There were some problems with the guid for articles. Somehow, typo (or rather the validates_uniqueness_of API was telling me that the guid for my new article is NOT unique!). This seemed pretty impossible to me since it is really really hard to get a similar guid since it depends on the time the article was submitted.

In fact the code that determines the guid is found in the app/models/article.rb file which is generated by the following line
self.guid = Digest::MD5.new(self.body.to_s
+self.extended.to_s+self.title.to_s
+self.permalink.to_s+self.author.to_s
+Time.now.to_f.to_s).to_s if self.guid.blank?

And the line that validates it uniqueness is right at the end of the file:
validates_uniqueness_of :guid

Really weird. And there was nothing in the log/production.log file as well. Database also seems to be fine and after posting the article I can even verify that the article guid is indeed unique. Also there was nothing on the Typo mailing list.

Anyway, I got rid of the validates_uniqueness_of line and I was able to post new articles. We shall see how it goes for the next few days.

So far, I suspect that I must have messed up something somewhere else such that each new article is being posted twice, just before the first one gets into the database. However, I did install Typo over from scratch and still nothing.

Posted in | no comments |

Updated to Typo 2.6.0

Posted by Nicholas Chen Thu, 01 Dec 2005 08:47:36 GMT

Finally updated to Typo 2.6.0 and hopefully I have fixed the .fcgi problem where the page refuses to load. Everything looks fine so far, except the format of the new database.yml file was rather interesting when I first glanced at it. Nonetheless, rake migrate went well and there does not seem to be any problems.

Anyway, I feel more assured if this test post gets through.

Posted in |

Theme update(s)

Posted by Nicholas Chen Wed, 26 Oct 2005 04:00:50 GMT

There is a new theme competition going on at Typo Garden for Typo. One particular theme caught my fancy: Concomitant by Mars Hall. Before the themes (there are set of 4, which can be accessed using the colored buttons on the top left corner) can be used, I had to add a black border around the images because most of my images have a white background; a white background on gray really looks very out of place.

Right now I am very satisfied with the theme. The only drawback is that live search is no longer "live" but causes the search page to be returned. Well, that is not that bad. After all, one seldom need to search, right?

Posted in | no comments |

Finally back!

Posted by Nicholas Chen Sat, 22 Oct 2005 04:37:59 GMT

After such a long hiatus, this web blog is finally back on the web. First some explanation for the absence. I was waiting for the excellent RailsAppHosting to come up with some plan to replace their beta version. First it was going to be ready in September. Then they suddenly announced that they would be partnering with TextDrive - (everyone's favorite web host?) and that we can expect a release in early October. Then they said that it should be available before RubyConf:

"... and, when will we launch? We're (seriously) aiming for just before you need to catch your flight to RubyConf and, looking at our progress right now, we shouldn't have any trouble meeting that deadline."

Hmmm... that reply was dated September 29 and today is already October 21. Seems like a long time to wait. I am sure that they are doing all they can to hurry it up. I do wish that they would not make false predictions and then fail to meet them. And to placate myself, I keep telling myself that the end product will definitely justify the means they are doing it. But another part of me tells me that, it is time for them to do some early release to see how much their users would actually want those new features. I will be sure to check those features out once they become available.

So, in the end, I forgo the one-click installation of Typo and jumped ahead to set it up on railsplayground.com with a sandbox account. While they do not offer one-click Typo installation, they do offer q rather nifty control panel that enabled me to set this blog up within 5 minutes and then restore the backup I had took least than a minute. All this for $12 a year which is really decent. I have not had the need to contact their support staff for anything serious yet so I am not sure on their customer service. Though I did e-mail them once to delete my trial account so that I can upgrade to the sandbox account.

Anyway, I am glad that I have a web blog to write things on again. Expect some posts to come.

Posted in | no comments |

RailsAppHosting deal

Posted by Nicholas Chen Tue, 16 Aug 2005 16:17:13 GMT

RailsAppHosting Forum - Message to all beta testers:

"Upon launching we will be offering a once-off 'lifetime hosting' deal for US$100. We will also be accepting two payments of US$50 over two months to make it even more affordable (yes, TextDrive gets the credit for this idea originally). This will allow us to raise some capital for infrastructure and it's a bit of a reward for our beta testers."
500MB disk space per application, 3GB bandwidth per app (the sum of all traffic in plus all traffic out) per month. So between the three apps a lifetime account will receive 1.5GB space, 9GB bandwidth per month.

Sounds like a good deal to me so I am going to continue hosting this web blog on railsappshosting.com.

Posted in | no comments |

Pictures are now served from flickr.com

Posted by Nicholas Chen Sat, 13 Aug 2005 05:58:47 GMT

The missing pictures have now been restored. For those that I am not able to recreate, I have tried my best to procure some alternative sources and credit them for the pictures.

I think that outsourcing my images to flickr is a good idea. That way I would not have to worry about editing the links everytime I move to different web hosts or a different web blog system. Also, it seems more organized. Anyone who wishes to just have a preview of my images can use flickr's photostream function. If only I had thought of this before I erased all my pictures!

For convenience, here are the articles that changed:

While regenerating some of the pictures for my Java projects, I notice some problems:

  • The Java file chooser does not detect files on external hdds.
  • The windows do not position themselves relative to an external monitor.

There are bound to be other broken links especially for articles that cross reference one another. When that happens, the easiest way is to search for that article using the search function at the top right hand corner. Since it is live searching, you do not even need to wait for the page to refresh. All thanks to Ajax!

Posted in , | no comments |

Moved the blog to railsapphosting.com

Posted by Nicholas Chen Thu, 11 Aug 2005 18:29:39 GMT

Finally, the toll of trying to get Apache and FastCGI to work nicely on Windows has worn me down. So, the best move was to head over to Typo's list of recommended web hosts. Dreamhost and SteelPixel caught my eye but then I decided to opt for RailsAppHosting because they focus entirely on Ruby on Rails which is basically what I need. Also, they are having some beta testing session now so there is no fee. Well, so far I like what I see. Setting up Typo was not too bad. I did run into some problems though (discussed below).

First was that it was a bit inconvenient to not know the host to connect to for mysql. It was not spelled out explicitly under the Manage MySQL Databases... menu on the left of the control panel page. Anyway, the forums and the video provided part of the answer. What they did not mention was that the password for the MySQL database is randomly generated! Fortunately, I inspected /config/database.yml and found that out. Then it was a simple matter of click, click in CocoaMySQL to import my existing database.

But wait! It was not that simple. Somehow, by sheer change I detected this almost imperceptible change. The schema_info table has the field version and in the one-click typo set up, it defaults to 7. However, my older .sql file had the value 9! How the 9 got in there beats me since everything else seems the same. But if you leave the 9 there, Typo balks when you visit the admin interface and chokes on updating the database. So, I did the easy thing, switch the value back to 7. And delete /public/index.html. Also, restart the application.

I cannot wait for the DNS name to resolve itself so that I can just use vazexqi.railsapphosting.com. Anyway, railsapphosting is pretty reliable so far. There may not be many members, but the support team does respond promptly. And they made it easy to set up many Ruby on Rails application. This gives me an opportunity to play with these web applications without trying to figure out how to set them up nicely on Windows. I wonder how much the fee would be. So far, this post on the forum has hinted on a lifetime membership. The proposed $20 a month for a two application account seems to be a bit pricey especially since Dreamhost and SteelPixel are offering monthly accounts for much less. I will have to wait and see whether the ease and convenience of RailsAppHosting outweights their price. The most I would pay is $10 a month. Period. Unless there is a new offer which I cannot resist :)

Posted in , | no comments |

Site updates!

Posted by Nicholas Chen Wed, 10 Aug 2005 07:21:41 GMT

Typo 2.5.3 was released and it has a much more comprehensive .htaccess file compared to the one that I was using previously. Actually, the one I was using was copied over from Typo 2.0.6

Anyway, the problem with my web server is now because of the static pages that Typo uses. Apache does not like serving those. Goodness knows why though, it would just report the infamous

posix error: connection reset by peer
that I have been seeing the past couple of days. The easiest solution would be to have Typo not create any static pages; that is not to have it cache anything. However, I have not figured how to do that yet.

Also, I added new Ruby category for this web blog.

Update: Actually after constructing this entry, I tweaked the .htaccess file and commented out the following line:

# RewriteRule ^$ index.html [QSA]
That prevents it from caching the index.html file so that it will always serve it. At least in this case, most users will not get a half loaded page since it is always regenerated. Of course, you lose some speed on this. But that is always more welcomed than a half loaded page. It seems that I could turn of caching for all files by tweaking with the .htaccess file but I will leave things as they are now. Future Typo releases might have a setting to toggle caching.

Posted in | no comments |

Bumped up from Typo-2.0.6 to Typo-2.5.2

Posted by Nicholas Chen Mon, 08 Aug 2005 22:17:00 GMT

There is something a bit peculiar about this implementation of Typo. For instance, the bug about having NULL values in the text-filter column in the article tables i in the typo database has not been resolved. Thus, I had to actually go in and fix that. Fortunately with MySQL-front I was able to identify the culprit and followed the instructions here to fix it.

The default theme is now Azure, again. I wished they stick with the Kubrick theme. But the good new is that the way themes are set up now, switching between themes is simple enough.

I really like the new static web page cache generation thing. This saves a lot of time from having to dynamically generate files that have been requested before.

Anyway, I am going to try to fix the corruption and posix error for files stored in the typo/public/files folder. This has been something that has been bugging me for some time. It seems that I must have screwed something up somewhere because now all my images that I uploaded will not work! This is really really weird.

This seems to be pretty serious. I have not been able to fix it yet. Right now, as long as I try to serve any image larger than 40kb in size, it gets truncated. Apache's error logs do not report anything other than a 200 request (which means that the request was good; also the bytes it transmitted corresponds to the actual file size). However, in Safari and other browsers, you get the error of Posix Error: Connection reset by peer! What gives? Some people on the web are having this problem too but theirs seems to be connected to php somewhat.

For a simple test, try loading this and see if there are any errors.

Posted in | 1 comment |

Added a new category: manga

Posted by Nicholas Chen Fri, 05 Aug 2005 06:59:05 GMT

Nowadays my greatest source of entertainment comes from reading manga. My first post on manga was about some patterns in the typical way of producing those that sell well. You can read about it here. I decided to dedicate a section to it because I have consumed about 1000+ pages of various titles through scanlations (short form for translated scans of the original manga) by various groups. For something that I spend nearly an hour a day on, there must surely be something worth writing about.

Although the general rule of thumb is to go buy the manga and not download the scanlations once some company licenses it in your country, I cannot really abide by it. Why? Well, those companies take so long just to get one tokuban out! Sometimes the scanlations are already way ahead on volume 20 while the official tokuban has only reached volume 2! A better compromise would be to continue reading the scanlations until the official versions catch up with them. Another problem actually arises from collecting the official tokubans: physical space! You actually have to find space to store all those graphics novels whereas I can easily fit the entire series into my external usb2 harddisk. Again, I am not advocating privacy, but I would really appreciate it if the Japanese companies released the manga in some electronic form for easy portability.

What I will probably include in future posts in this category would the titles of the latest manga that I can get my hands on. By doing so, I get to adorn my web site with some pretty pictures without having to take them myself. Oh yeah, almost forgot about copyright issues. But if I give the proper credits I guess it is all right, isn't it?

Anyway, here is my tribute to one of the greatest manga artist of all time: Rumiko Takahashi. She created well-loved series such as Inuyasha, Ranma 1/2, and Urusei Yatsura. She has many other titles under her belt as well. And each new series that I pick up never fails to inspire fits of laughter and hours of enjoyment. For a great website that features a summary of all her works, please visit Rumic World.

Right now, Cartoon Network is showing the older Inuyasha anime series over the weekdays. And they have the latest season airing every night on Saturdays. This would be a good time to actually watch the series. I am happy that the translation of the anime went pretty well and that the characters do not sound like silly little children with cotton balls stuff down their throats.

Posted in , | no comments |