WDMA members can upload pictures

Members can post pictures throughout the website.  Photos link to a harvest or just a note.  Members can include pictures in their profile also.

The Yahoo weather widget shows the local conditions and forecast.  Here is some of the code to make it work.  This is the Ruby components used to query Yahoo for the current local weather.  The first part, yweather.rb, goes in the Ruby on Rails web app folder ‘/lib’.  The part that manages the view goes in /app/views/layouts/

# /lib/yweather.rb
module Yweather

require 'rubygems'
require 'yahoo-weather'

def Yweather.get_weather
@client = YahooWeather::Client.new
@response = @client.lookup_location('19343')
return @response
end
end

<% @yweather = Yweather::get_weather %>
<div style="padding: 2px; font-family: arial; font-size: 7pt; background-color: #fff; color: #030; text-align: center;"><%= @yweather.title %>
<div><img src="%3C%=%20@yweather.image_url%20%%3E" alt="" />

<%= @yweather.condition.temp %> degrees <%= @yweather.units.temperature %>

<%= @yweather.condition.text %>
Forecast:

<%= @yweather.forecasts[0].day %> - <%= @yweather.forecasts[0].text %>.  High: <%= @yweather.forecasts[0].high %> Low: <%= @yweather.forecasts[0].low %>

<%= @yweather.forecasts[1].day %> - <%= @yweather.forecasts[1].text %>.  High: <%= @yweather.forecasts[1].high %> Low: <%= @yweather.forecasts[1].low %>

More information <a href="%3C%=%20@yweather.page_url%20%%3E">click here</a>.

</div>
</div>

Yahoo’s developer resources are great. And don’t forget to install the Ruby gem.

gem install yahoo-weather

Wallace Deer Management Association web site performance

During work on the WDMA website there were points when web pages and features were just slow. It could take a long time to update a page with a lot of dynamic content. I am to blame for a lot of this. When implementing a new feature my main focus was making sure it was what we wanted. I tried to quickly code the feature to get feedback. Sometimes it takes a couple of times back and forth to get it. Once done and working right we often found the feature was too slow. We had the desired behavior so I went to work on coding it more efficiently. That solved the performance problems. This became a cycle during the fall. Choose a feature…code the behavior correctly…tune it.

I started to notice that some pages should have loaded faster but they didn’t. The static content wasn’t very responsive and there was no database calls to blame.

A few quick searches turned up a lot of help for tuning the websites. My problem was that I’d gotten into the routine of fixing the problems in the code. There was still a lot of coding left to do and I didn’t want to get too distracted with what I was seeing of website performance tuning.

  • Firebug is an essential tool for developing or designing websites. Firebug is always open for debugging. I spend as much time in Firebug as in Vim writing code. It can show you what is really happening in the webpage! I just noticed two plugins for Firebug geared towards solving the performance problems. The plugins apply a standard set of rules to the webpage and provides scores in different categories that affect performance.

  • Google’s Page Speed gives the web page an overall X out of 100 score. Page Speed creates a helpful list of areas and shows which ones need help. I think the first score for WDMA was like 30/100. I went down the list. For every problem area there were links for help. When done WDMA scored 86/100. Not too bad I suppose.

  • Yahoo’s YSlow is like Page Speed. I like the way they score. YSlow grades a web page from A to F. Just like school. There is a drop down to select different Rulesets for scoring. Small Site or Blog is best for the WDMA site. The score went from a ‘D’ to an ‘A’ after a few days of tuning.

There is some overlap between Page Speed and YSlow. I found it helpful to use them both.

Moving a self-hosted WordPress blog to Dreamhost

WordPress was previously installed on Emperor, a six-year-old Linux system.  It was on the DSL line with https using a self signed certificate.  It worked but…

When I went to configure the subdomain ‘blog.netsnbytes.org’ Dreamhost complained that it was already in use by One-Click.  I don’t remember setting it up but maybe I did.  Oh well.  I blew it away and recreated it.

Each time I tried to use the One-Click install for WordPress this is the error I got visiting the page:

  • It doesn’t seem like I set up blog.netsnbytes.org correctly to run WordPress?
  • If it should, and the install was more than an hour ago, you may want to try deleting and re-installing the app
  • If you are a DreamHost Apps user, you can check the Discussion Forum or the wiki for further help
  • Paid DreamHost customers can submit a support ticket through the DreamHost Panel

sshing into the account it looked the directory was there, the WordPress files were there and the config file was correct.  I could ping the database and login to the database with the config file parameters.  I tried Firefox, Chrome and IE with the same result.

Frustrated I created a trouble ticket at DreamHost.  Within a few minutes a response came from Christopher.  He said he could access the site fine.  Now that didn’t make sense…or did it.

Running ‘ipconfig /flushdns‘ fixed the problem!  Stale DNS on my computer I suppose.

WordPress makes it so easy.  I went into Emperor (my Linux box) and did Manage > Export from Site Admin to save everything to an XML file.  On Dreamhost it was Tools > Import from the Dashboard.

Teal — the new computer with Windows 7

Over the last year I ran the beta versions of Windows 7 in virtual machines, PCs and Mac.  Windows 7 is the better product of the drawn out Longhorn beta than Vista.

Listening to the various Mac podcasts I’m hearing good things.  Mac podcasts…huh?  Some of the compliments from the Mac folks are pretty slight but I’ve also heard some glowing praise.  Of course the regular PC sources love it…that’s to be expected.

Jacob built a new computer for me…Teal.  It’s a new AMD processor, 4Gb RAM (for now) in a Lian Li case.  The ATI 4800 screams a bit when I work it in Call of Duty.

I am being careful now not to load programs that do not get used much.  Just keeping it lean.

New goodies from Dropbox

New goodies from Dropbox…

iPhone app released!
Yep, it’s finally here! The Dropbox iPhone app can now be yours (for free) from the App Store. It’s now 3.0 compatible too! Also in the works is an update to the app that includes optional passcode locking, better handling of images and more. For all you non-iPhone users, fear not! We’ve got some more mobile magic on the way.

Forget the “Get”
We just moved into our new home at www.dropbox.com — update your bookmarks!