Moving Day…

Friday, March 2nd, 2007

This is my second major move, and this one was WAY less painful. I decided to change my web hosting company from Textdrive to DreamHost. Textdrive has been good to me, but in the recent past the server that I was on required entirely too many reboots from the administrators at Textdrive. As a result of this, my websites were going down for anywhere from a few minutes to as long as a number of hours. While I don’t run any Fortune 500 companies on Textdrive, I do think the server crashes are unacceptable. I think Textdrive may do a better job of handling large websites that aren’t sitting on “shared” servers, but the nature of the openess of their servers meant that any one of the people doing development on the server could bring it down. I don’t require that sort of configurability, so DreamHost should work beautifully for me.

That being said, I will be working to customize the look and fell of this WordPress powered weblog of mine. Now with commenting! My previous “roll your own” approach to weblogging left me wanting for a few features, and while I could have programmed those features, I really never could find/make the time. Hopefully this new weblog engine will reinvigorate my enthusiasm for writing.

New website

Monday, October 9th, 2006

I have created a new website for information on my upcoming wedding:

http://www.melissa-shane.com

On a more technical note, getting this up and running was a pain! I followed all of the instructions, just like I have a few time before but to no avail. I created the website locally, placed it into a subversion repository, configured the appropriate files according to the instructions for the “Shovel” recipe for Textdrive, ran the proper commands and viola’… NOTHING!!! So very frustrating. The one error I was receiving was that the lighttpd webserver could not restart, which I ignored because it hasn’t been ablet to restart in a while and everything was running fine. After many frustrating hours of re-running the steps, double checking for errors, creating new problems, etc… I finally had an epiphany. The webserver has to restart to grab the new config file! Duh! So, I manually killed the process, then restarted it and everything was fine.

Ruby On Rails Development with M$ Windows

Thursday, August 3rd, 2006

I have been playing with Ruby On Rails for a while now. While it is super easy to use and brilliantly designed, the development tools on a M$ Windows machine are lacking (to say the least). That being said, through many hours of frustration and heartache, I have finally come to the following solution:

Development Machine

  1. Windows Explorer - Navigating directory structures
  2. Powertoy to “Open CMD window here” - simple right-click addition to open a command window from any directory (saves a lot of typing trying to navigate from within the command window
  3. Notepad++ - Nice and simple text editor, fairly intuitive. Don’t use Windows Notepad, the line line breaks are in the incorrect format for a *nix server (which you will most likely be using at some point).
  4. Tortoise SVN - Very easy to use Subversion client that integrates directly into the shell of Windows Explorer like it was meant to be there (how sweet would that be?).
  5. MySQL AB - I use the included command line client, it takes some getting used to, but in the RoR world, command line is the de-facto standard for getting things done.

Server

  1. Subversion! - An absolute must for development! I don’t know how I ever accomplished anything without it. For those not in the know, subversion is a version control system for anything. It is super powerful and I use maybe 10% of it’s feature set.
  2. Shovel - this isn’t so much a program as a tool. Shovel is a recipe for Capistrano that makes deploying you subversioned RoR application dead simple.

That’s it! I tried using RadRails, and it works, but it is overly complicated. I tried a number of text editors, but Notepad++ seems to work the best (at least for me it does). I like tools that don’t get in my way. You will notice that there isn’t a big Integrated Development Enviroment (IDE) listed here. I don’t like them for the small projects that I am working on.

P.S. These are all open-source and FREE!!!!

Microformats

Thursday, July 6th, 2006

There is an interesting article at SimpleBits about their use of Microformats for a new site they have created called Cork’d. I am thinking that this would be a good thing to try for this weblog’s soon to be released commenting system. I think that I may like the use of semantically rich markup. It provides the possibilty for greater functionality (like searching and organizing) without really doing any more work. There is already a Firefox extension, Tails, for organizing Microformated data.

Semantically Rich Markup simply means that the markup is meaningful, not just the data, but the markup itself! Here is an example of non-semantic markup

<span>Some Data</span>
<abbr>Some other data</abbr>

An example of semantically rich markup would be:

<span class=”name”>Some Data</span>
<abbr class=”Address”>Some other data</abbr>

The differences are minor, but it adds meaning to the scheme without needing to populate any of the data. Where microformats come in to play is that they provide a standardized way to add meaning to your data.

Comments!

Thursday, July 6th, 2006

I have come to the realization that my blogging satisfaction relies heavily on comments. I have posted a number of entries since getting this weblog back up, but since I haven’t turned the comments on (actually, I haven’t programmed it yet!) I don’t get the same satisfaction out of writing that I used to. To that end, I will be devoting some time in the near future to getting a commenting system up and running. There are a few other things I would like to work on as well:

  • CSS fixes for Safari
  • More statistics (number of page hits, current viewers, etc…
  • Tag Cloud
  • Image gallery (requires Flickr integration)
  • Fix some errors

Google Sitemap

Thursday, July 6th, 2006

Google has a service that I just found out about, Google Sitemaps. I haven’t used this service so I can’t attest to it’s effectiveness, but it can’t be a bad thing to help Google find your website!

Weblog Development

Thursday, July 6th, 2006

A couple of minor bug fixes:

  1. If you clicked on the word “tags:” at the bottom of each post you were taken to a page listing all of the tags used in this weblog. If you clicked on any of the tags, you were then taken to a page for editing the tags! So now, when you click on a tag from the list of all tags, you will be taken to a page listing all of the entries that have that tag. Still no “tag cloud” but getting closer!
  2. The “updated” problem! When I was making new posts, they were all being listed as “updated”, until I went in to the database and physically changed the “updated_on” date to equal the “created_on” date. This was an error in my original logic, I was under the impression that “updated_on” would stay null until the post was actually updated. It turns out that “updated_on” is set whenever a change is made to the database, even when a new post is created. The fix for this problem was the addition of a column (field) in the posts table that would allow me to flag a post as being updated or not. This is actually more functional than my original approach. Before, if I were to make a minor edit to a post, the post would have considered itself to have been updated. While this wasn’t wholly inaccurate, it was misleading in that most people assume that an updated post has a moe substantive update than the correction of a grammatical error or a simple HTML tweak that doesn’t add anything new to the post. Now, when I edit a post I have to implicity set the “updated” column to display to the user that the post has been updated.

In case anyone is wondering, the second of the two fixes was accomplished easily using Ruby On Rails migration feature. The steps are outlined below

  1. At the command line, enter: (I probably should have called it something like AddUpdatedColumnToPosts!)
    ruby script/generate migration AddUpdatedFieldToPosts
  2. Edit the new migration as follows: (Note that MySQL does not support Boolean columns, but Ruby On Rails know this and handles it for you!)
    class AddUpdatedFieldToPosts < ActiveRecord::Migration
      def self.up
        add_column :posts, :updated, :boolean, :default => false
      end
      def self.down
        remove_column :posts, :updated
      end
    end
  3. At the command line enter:
    rake migrate
  4. Make the neccesary changes in the post controller, in my case I had to change to the logic that determined if the post had been edited or not.:
    <% if updated_on > created_on %>

    to:

    <% if params[:updated] == true %>
  5. Once everything is good on the development side, commit the changes to the Subversion repository:
    svn add * --forcesvn commit -m "fix updated_on problem"
  6. Now it is time to migrate the “Production” database! Log in to the server via the Secure Shell client of your choosing, navigate to your application’s directory and enter:
    rake migrate RAILS_ENV=production -t
  7. If this all goes off without a hitch (it won’t, trust me!), then your final step is to “deploy” your updated application code:
    rake deploy

The beauty of all of this is that I am doing completely disconnected development on my computer at home, once everything works the way I want it to I simply upload my changes to the server, make the neccesary database changes and deploy. If it fails at any point, I can very easily revert to the previous state! I love Ruby On Rails!

This post has been updated to show what an updated post looks like.

Weblog (update)

Thursday, July 6th, 2006

I have recently been re-energized concerning the ongoing development of my new weblog. I have been discussing web development with an old friend and it has really stirred up some ambition, which I am in dire need of! Perhaps I will be able to get a few features completed. Here is what I have left to do:

  1. Create admin for the Gallery (add, edit, delete images)
  2. Create multiple galleries (My trip to the moon, My night out with friends, etc…)
  3. Tie images into weblog entry creation better (needs a pop-up window to add or select images)
  4. Add archive pages (ex. “http://weblog.celerity-designs.com/archive/somearticle.aspx”), this will require some redirecting.
  5. I want to add a section for essays, I find that I want to write too much for a simple weblog post. The weblog post would be, check out my new essay and have a link to it.
  6. Make minor adjustments to style (e.g. color, borders, font-sizes)

RubyOnRails

Thursday, July 6th, 2006

tag cloud

I finally figured out how to create a tag cloud. Yay for me! It was rather difficult, not because the actual implementation was difficult, rather, because I don’t really understand the Ruby programming language yet. I am learning more every day though. I was able to take an example of a tag cloud from craz8’s weblog and work my own solution. I think my solution is a little more elegant because I was able to remove a recursion, hopefully making it faster, but definitely making it look prettier (the code that is).

Here is some code from the helper that builds hash for the tag cloud:

def tag_cloud(tagged_items)

separation = 2
min = tagged_items.values.min.to_f
max = tagged_items.values.max.to_f - min
mult = (seperation / max)

tagged_items.each do |tag, count, fsize|
yield tag, count, ((count - min) * mult) + 1
end

end

Here is the call from the view that displays the tag cloud:

<% @page_title = "tag cloud"%>
<% @page_sub_header = "tag cloud" %>
<% tag_cloud(@tagged_items) do |tag, count, fsize| %>
<%= link_to(h(tag), {:action=> ’show’, :id => tag.id}, {:style => “font-size: #{fsize}em”}) %>
<% end %>

Easy wasn’t it?

Google Analytics

Thursday, July 6th, 2006

Google AnalyticsI set everyday up to be tracked by Google Analytics. This is a very detailed and robust tracking system that shows, basically, all of the information from anyone viewing everyday. This information includes geographic location (approximated by IP Address), browser type, operating system, language, and probably some other less important (to me) details. Apart from just being plain interesting, I think this data will actually be useful as well.