Archive for the ‘ Web Dev ’ Category

Ruby on Rails IDE

I’ve been trying to get back into web development as a hobby; there are many reasons for this, but maybe the most relevant at the moment is that it has the potential to make my actual job easier. If I can develop a website as an online tool, maybe best described as a content management system on steroids and tailored to my needs in the lab, I can spend more time planning and performing experiments, and less time actually running the lab by doing it more efficiently.

Recently, I’ve been using puTTY, WinSCP, and a text editor to build this project in Ruby on Rails. The problem is, I need a lot of real estate on my screen to be able to do this effectively, and I wasn’t able to get WinSCP to open all of my script files in the same text editor window. Combine this with the fact that I had to “touch” every file from the command prompt using puTTY after making changes in the text editor, and saving the modified file to the site with WinSCP — it was really just the least efficient process for designing and building a system to make my life more efficient.

Anyway, a couple years ago, I had stumbled upon RadRails, which was then rolled into the Aptana IDE. Looked good. It had syntax highlighting, which was a big plus. However, SFTP support for remotely working on a RoR project was, at the time, only supported in the paid, “Pro” version of the Aptana Studio suite.

Fast forward to this afternoon, when I re-discovered the Aptana Studio and RadRails, and then found out that the “Pro” version had been scrapped, and now SFTP is available for free!

I’m playing around with it now, but I’m happy so far.

http://aptana.org/

web design, and differences in browser rendering

Admittedly, it has been a while since I last really truly developed a website.

Funding at Columbia University page screenshot, 27Aug2009

Funding at Columbia University page screenshot, 27Aug2009

The FaCU site wasn’t so much of a site as it was a page, and really, I feel I could have done a better job if I weren’t so ridiculously busy Senior year, and if I were more up to speed on using CSS to lay out websites.

Every time I’ve done this, beginning seven years ago, I’ve hit this block around how to manage the layout of a site.  The old way, working with browsers that didn’t correctly render CSS styling code, a lot of people dealt with the problem by using <table> hacks, using these tags to generate a website layout composed of “invisible boxes”.  All fine and good, except that it made changing even the smallest design element on the site was a huge undertaking, because every box was made to align and fit together like intricate pieces of a puzzle, and adjusting the thickness of one border or the geometry of one cell within the table, even by one pixel, required tweaking of every element around it, sometimes even going back and re-generating images or other graphics.

Current Garfield Messenger website screenshot

Current Garfield Messenger website screenshot, 27Aug2009

My first effort at using CSS to lay out a website was in high school, when it became my project to design and build a website for the high school newspaper.  I used it to learn not only PHP and how to interact with a MySQL database, but really everything that would be involved in developing a website.  It never became as full-featured as I wanted it to be, and it was eventually wiped out in favor of something less complex, and then again more recently for a WordPress-backed system.

Long story short, I tried to learn CSS in high school, found it supported by the various browsers available at the time in a very inconsistent manner (between browsers), and ditched it because it was too confusing to figure out how do exactly what I wanted with it.

Capstone Industries - iQueue Dispenser System

Capstone Industries - iQueue Dispenser System

I came back to CSS during my Senior year at Columbia while I was working on not only the FaCU website, but also the website for my Senior Design Project.  I tried to adhere to only the most widely available fonts, and the lowest common resolution for both sites.  The result: fairly ugly sites, but they get the job done.

Fast forward to today, when I’m now working on moving all of the lab’s most commonly used inventory books into a user-friendly digital form.  CSS has better support across every browser, and everything just makes more sense now.  No idea why.

Still, CSS is still rendered with quite a few annoying quirks.  Take, for instance, the following page layout:

Lab inventory site

Lab inventory site

Renders just fine in Chrome, Firefox, and IE8.  The left navigation panel and the main content to the left are spaced and positioned properly.  In IE7, the main content title renders where it should, but the table appears at the bottom, under the navigation block.  In Opera, the positioning offset I used to place the content area to the right of the navigation pane doesn’t appear to be necessary, so there’s a giant gap where there shouln’t be one.

A better situation than I was working with seven years ago, but still irritating.

Alternate WordPress posting options

As part of an effort to actually update this blog regularly instead o letting it slowly die like my old blogspot blog, I’ve been looking at a numer of different way of submitting new posts to this blog.

E-mail is nice, but typically I’m only at a computer either at home or at work… The problem is, only one of those places is an appropriate environment to be writing blog post, at least for me.

I do, however, spend a lot of time commuting, even after having moved closer to work. This presents a pretty good environment for writing blog posts, provided I don’t get motion sickness too quickly. The only issue is, I would need to find some way of efficiently writing blog posts and saving them to be uploaded once I regained acces to an Internet connection.

Surprise, surprise, there’s an iPhone/iPod Touch app that does exactly this, and it’s free! I’m using it now just to test it out, an it’s actually not too bad, though this might be more of a critique of extended typing on the iPod Touch than it is of the WordPress application.

Postie!

The built-in WordPress PHP script to grab e-mails and generate blog posts from them wasn’t particularly good, so I’m now using Postie (http://wordpress.org/extend/plugins/postie/), which seems to at least offer more features, though this post is really an experiment to see how well it works.

I keep having issues with the built-in WordPress installer, so I think I’m just going to use the command line and grab everything via wget.

Edit: This worked perfectly, and I definitely like Postie more than the built-in wp-mail.php method. Definite plus: being able to add tags to the post by e-mail, among other things. I’m going to have fun with this. Also, Postie supports POP3 with SSL without my ssl://server hack. I think it ends up working the same way, but the additional layer of abstraction makes it dead simple for a first-time user.

Posting to WordPress via GMail

Posting by e-mail to WordPress works using the POP3 protocol, but it’s not over a secure connection by default.  In order to make this work with GMail, enter the POP3 server address as ssl://pop.gmail.com over port 995.  With the appropraite account settings, and provided that your server has the PHP SSL library compiled and installed, this should work.

Upgrading to WordPress 2.8.2

I just installed WordPress 2.8 on this host using Fantastico via cPanel X, and WordPress was telling me to upgrade to 2.8.2. I noticed that there was an automatic upgrade option; all I had to do was enter the FTP/SFTP for my site, and the WordPress script would handle the rest.

The first time I ran the upgrade, however, it threw an error back at me:

Downloading update from http://wordpress.org/wordpress-2.8.2.zip

Unpacking the core update

Could not copy file: /public_html/wp-content/upgrade/core/wordpress/wp-comments-post.php

Installation Failed

Annoying, to say the least. A little bit of searching turned up a possible solution: checking and repairing the MySQL database tables. There’s no reason I can think of that this should work, but it’s a nondestructive method, so I figured I’d give it a shot. I had phpMySQL check and repair the tables in the WordPress database that had been created, and even though nothing appeared wrong, at least according to the status messages, doing this fixed the automatic update problem that I was having with WordPress!

This is where I first found this fix suggestion:
http://wordpress.org/support/topic/277858?replies=10

But a little more digging turned up this blog entry:
http://www.kmcgraphics.com/2009/06/11/installation-failed-fix-for-wordpress-2-8-upgrade/

I’m also sending in this post my e-mail just to see if it will work.

Edit: turns out it does, but not as well as I would like.