Things To Do At TechDays Halifax 2009

If you’re heading to Halifax, Nova Scotia for the only sold out TechDays show in Canada (November 2-3, 2009), you might be wondering what to do when you’re not at the conference.  Here are some suggestions:

rogues Rogue’s Roost Brew Pub

This is my favourite place to eat in downtown Halifax.  The floors are sticky, the service isn’t great, but the chicken fingers and ale are wonderful.  Make sure you get the honey dill dipping sauce with your fingers.

Surfing

OK, you’d have to be nuts to go surfing in Nova Scotia in November.  Of course the SurfDonkey boys are clearly nuts: http://surfdonkey.ca/.

Bad Dad Location Hunt

Step 1: Watch http://baddad.tv/

Step 2: Wander around Halifax trying to recognize locations from the show.  Good luck.

Stalking Craig Moore…

…and asking him repeatedly when the heck we’ll get another episode of Bad Dad. ;)  [he looks like this: http://vimeo.com/2117659]

Visit Freak Lunchbox

freaklunchbox“Freak Lunchbox searches the world to find the weirdest, newest and hippest candy and pop culture items on the market.”

How can you NOT visit this place!?

[Nearby Sweet Janes is also worth visiting.]

Take the Ferry

OK, I’m not sure exactly why you’d want to do this, but you could take the ferry over to Dartmouth just for fun (I guess).

This was someone else’s idea.  I’m not officially endorsing it…

There is a Tim Horton’s in the ferry terminal.  I suppose that’s something.

1175700925_e77f8ad05fClimb Citadel Hill (National Historic Site)

Worth the uphill climb, the Citadel’s stone fortress offers amazing views of the city and the harbor to its visitors. The view from the Citadel will show you the amazing architecture of downtown between the hilltop and harbor; the harbor’s mouth of wooded islands; and the naval dockyard under the Angus L. Macdonald Bridge, which connects Halifax and Dartmouth. Just 9 blocks from the waterfront, the Citadel has been restored to look much as the fort did in 1856.

http://www.halifaxkiosk.com/halifax-tour/Citadel-National-Historic-Park.php

Note: November 1 to May 6, the grounds are open but no services are available.  Here some photos of the Citadel if you’re unfamiliar with it: http://www.flickr.com/search/?q=halifax+citadel.

Attend the Bonus Session on the Interoperable Web Platform

I’m giving a bonus session on the Interoperable Web Platform on Monday afternoon (4:20pm in the Servers, Security, and Management track room according to my info).

I’ll be covering some uber goodness like running PHP on IIS (I run 6 WordPress sites on IIS7 as well as http://tyny.ca), SuperPreview, the SEO Toolkit for IIS.

And my slides are gorgeous!  Very few bullet points.  You’ll definitely want to be there.

Follow Me on Twitter

If there are other things happening, I will announce them via Twitter.  Follow @derekhat or just watch http://twitter.com/derekhat and http://search.twitter.com/search?q=techdays_ca.

 

(photo credit: citadel)

Leave a Comment

Computer Science vs. The Real World

As usual, Joel Spolsky hits the nail square on the head in his Oct 26, 2009 piece on the discrepancy between what Computer Science programs teach and what software developers need to know in the real world:

It is amazing how easy it is to sail through a Computer Science degree from a top university without ever learning the basic tools of software developers, without ever working on a team, and without ever taking a course for which you don’t get an automatic F for collaborating. Many CS departments are trapped in the 1980s, teaching the same old curriculum that has by now become completely divorced from the reality of modern software development.

Where are students supposed to learn about version control, bug tracking, working on teams, scheduling, estimating, debugging, usability testing, and documentation? Where do they learn to write a program longer than 20 lines?

http://www.joelonsoftware.com/items/2009/10/26.html

4 Comments

Forms Not Submitting With Watir?

Watir, pronounced water, is an open-source (BSD) library for automating web browsers. It allows you to write tests that are easy to read and maintain. It is simple and flexible.

Watir drives browsers the same way people do. It clicks links, fills in forms, presses buttons. Watir also checks results, such as whether expected text appears on the page.

http://watir.com/

A great use for Watir is to automate tedious form filling during development / developer testing.  Let’s say you have a simple form like the following to submit a search query to Google:

<html>
<body>
<form id="search_form" action="http://google.com/search">
  <input name="q" value="derekhat" />
  <input type="submit" name="submit" />
</form>
</body>
</html>

The Ruby code to submit a form is pretty simply:

Browser.goto "file:///C:/Users/derek/Desktop/submit.html";
Browser.form(:id, "search_form").submit;

The only problem is that this won’t work in this case.  The reason:  there’s an input field called submit that hides the form’s submit method.  The workaround is easy:

Browser.goto "file:///C:/Users/derek/Desktop/submit.html";
Browser.button(:name, "submit").click;

Happy testing!

1 Comment

Visual Studio 2008 Freezing After Office 2010 Install

After some very frustrating experiences with Visual Studio 2008 hanging inexplicably, I discovered that the problem was the technical preview of Microsoft Office 2010 I had installed.  The fix was easy:

http://blog.hinshelwood.com/archive/2009/07/19/office-2010-gotcha-2-visual-studio-2008-locks.aspx

Leave a Comment

Fix for WordPress XMLRPC 500 Internal Server Error

One of my WordPress-based sites (http://crowdspace.net) was not working when I tried to publish posts containing images from Windows Live Writer.  I was getting a 500 Internal Server Error.

I was able to fix the problem by making a small change to the database.

The Error Message

I enabled Failed Request Tracing in IIS7 to find out what was happening server-side to cause the HTTP 500 error.  I discovered that the PHP script was trying to insert a row into the wp_posts table with a value of -1 in the post_parent column:

WordPress database error Out of range value for column ‘post_parent’ at row 1 for query INSERT INTO `wp_posts` (`post_author`,`post_date`,`post_date_gmt`, `post_content`, `post_content_filtered`, `post_title`, `post_excerpt`, `post_status`, `post_type`, `comment_status`,`ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_parent`,`menu_order`,`post_mime_type`,`guid`) VALUES (’1′,’2009-07-15 14:37:14′,’2009-07-15 17:37:14′,”,”,’2827426439_7b744abd30_m.jpg’, ”, ‘inherit’, ‘attachment’,'open’,'open’, ”, ‘2827426439_7b744abd30_m-jpg’,”,”,’2009-07-15 14:37:14′,’2009-07-15 17:37:14′,’-1′, ‘0′, ‘image/jpeg’, ‘http://crowdspace.net/files/2827426439_7b744abd30_m5.jpg’) made by wp_xmlrpc_server->wp_xmlrpc_server, IXR_Server->IXR_Server, IXR_Server->serve, IXR_Server->call, wp_xmlrpc_server->mw_newMediaObject, wp_insert_attachment
ErrorCode 5
ErrorCode
 

Apparently the database didn’t like that…  I investigated further and discovered that the post_parent column in my database was set to BIGINT UNSIGNED.  In other words, that database column could not hold the value -1 (unsigned integers are zero or higher).

Some Sanity Checking

I checked several other WordPress databases that I control and found that post_parent column is not UNSIGNED in any of my other WP databases.

So why the difference?  All my other databases were created with earlier versions of WordPress and upgraded.  The database in question, however, had been created with the latest WordPress release (2.8 at the time).  So I popped open the PHP file that defines the database (schema.php) and discovered:

post_parent bigint(20) unsigned NOT NULL default ‘0′,

What’s Going On Here?

When the XMLRPC script uploads an image (called an attachment in WordPress), it uploads it with a post_parent of -1.  Then after the post is created, the script updates attachments with post_parent=-1 with the actual ID of the freshly created post.

My guess is that a developer on the project decided to update the schema to UNSIGNED because posts do not have negative values for IDs and the post_parent column references a post ID.  Obviously that developer did not realize the special use case in xmlrpc.php.

How Do I Fix This?

Fortunately the workaround is easy.  Just run the following database query to change the data type on the post_parent column:

ALTER TABLE wp_posts CHANGE post_parent post_parent BIGINT;

If you don’t know how to run queries against your MySQL database, well, this is a good time to learn.  I did it at the command line on my 64-bit Windows server:

cd "C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin\"

mysql.exe –u root -p
Enter password: ***********************

Welcome to the MySQL monitor.  Commands end with ; or \g.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use crowdspace
Database changed
mysql> ALTER TABLE wp_posts CHANGE post_parent post_parent BIGINT;

The process is similar on a Linux box.  I’m going to go out on a limb here and assume that you can figure out how to run mysql on Linux if you’re running your own Linux server.

If you’re using a shared web hosting service, you should be able to use a web interface such as phpMyAdmin to run this command.

That’s all it took to fix the problem for me.  Happy blogging!

16 Comments