Tag Archives: Google

Android baby names Facebook Flickr Google Docs Google Webmaster Tools how-to internet iphone maps Photography poll scam social networking spam web-development webspam WordPress

Use OpenId in your WordPress blog for comments and your identity

Worn old welcome mat The web has evolved into this amazing place filled with user-created content, blogs, wikis, photo sharing sites, and users can enter comments on just about all of them. But there’s a problem – commenting in Blogger, Flickr, and some random self-hosted WordPress blog requires you to create user accounts or type in tedious contact information separately in each one.

As a user, you probably want to spend your time commenting rather than remembering usernames and passwords.  As a blogger, you no doubt want to make it as easy as possible for your readers to comment on your posts.  What we need is some really powerful identity management system to make this all possible.

OpenID is an attempt at creating such a system that seems to be growing quickly.  Instead of hundreds of usernames and passwords you have a simple URL that you control.  I just added it to my WordPress blog to see if it’s helpful, and I’ll walk you through the steps you need to take to use it and allow your commenters to use it too.

How to use your blog as your OpenID

First off, you need to get an OpenID.  Luckily, you probably already have one.  Major sites like Blogger, LiveJournal, Flickr, and Yahoo are supporting OpenID so you can just go with what you have.  You can also go with a specific provider.  Which one should you use?  It doesn’t really matter, since you can use your site’s URL as your OpenID and switch providers whenever you want.

Now that you have a URL, you need to use delegation to allow your site’s URL to stand in.  In WordPress, this means opening up the header.php and adding a few lines to your <head> section.  If you’re using Google’s Blogger (like me), the links would look something like this:

<link rel=”openid.server” href=”http://draft.blogger.com/openid-server.g” />
<link rel=”openid.delegate” href=”http://blogname.blogspot.com/” />

One side note – if you view the source of this page, you won’t see these lines.  I’m using my root domain instead.

For more information, see this post by Sam Ruby.

How to use OpenID for comments in WordPress

This part is simple – like everything else you want to do with WordPress, there’s a plugin.  Just download and install the WP-OpenID plugin and activate it.

You should notice a little OpenID icon in the fields for the comments below this post.  Go a head and test it out.

Create a survey or poll for your blog with Google Docs and Spreadsheets

You may have noticed the snazzy poll I posted on my blog the other day.  There’s a number of different survey and poll plugins for WordPress but all the ones I’ve looked at have caveats and limitations.  You can also use a service like SurveyMonkey but it has some data limitations for free accounts.  Instead, I used Google Docs and Spreadsheets to create a survey quickly and easily.  Here’s how to do it.

1. Getting to Google Docs and starting your form

We’re going to assume you have a Gmail account or have signed up for some other Google service already.  Go to http://docs.google.com.  Click on New -> Form

2.  Creating your form

This is actually pretty easy, and the online help does a pretty good job explaining what to do.  You have a number of options when creating a question – you can make it multiple choice, full text, or even a numerical scale, and you can mark some questions as required.  If you’re looking for the “Add question” button, it’s up at the top of the page rather than below the last question.

3.  Publishing the survey on your site

After you’ve created your form, use the More Actions button to find the Embed option.  Just copy this iframe into your blog post – it’s that simple. You’ll get code that looks something like this:

<iframe src=”http://spreadsheets.google.com/embeddedform?key=ppevxmL24UqnRb77Xy3AOWg” width=”310″ height=”1044″ frameborder=”0″ marginheight=”0″ marginwidth=”0″>Loading…</iframe>

You can change the height and weight to better fit your blog template.  Keep in mind that some blogging software will not let you post HTML code and others, like WordPress, require you to use the HTML view.

If you can edit your template or sidebar you can even include the poll on every page, instead of just putting it in a post.

4.  Getting data

Here’s where it gets really cool – the data is automatically collected into a spreadsheet that you can share, edit online, or export to Microsoft Excel.  It’s pretty easy to export CSV for a statistical package like SPSS too.

There’s an optional fifth step, creating a chart or graph to let your users see the results, that I’ll cover later.  If you can’t wait just jump back to my post about urban usability and read about how I created the time-series chart there.

The most difficult problems you will ever face as a programmer

Niagara Falls and city lights at night I was given a problem to solve at work earlier this week and I pretty much totally choked.  To be honest it wasn’t that hard of a problem – I obviously can’t share it with you here, but I will say that (among other things) I completely, totally blanked on how to find if two lines on a plain intersect and didn’t have a laptop handy to look it up.

This bothered me all week and got me thinking about my career as a programmer and the kinds of problems I’ve been asked to solve.  Everything we do as programmers, developers, or software engineers boils down to solving problems–so what have I been doing all these years?  Finally I realized that of all the difficult problems I’ve worked on in my professional career, most of them were difficult because of:

  • Imposed constraints;
  • Convoluted business rules and vague requirements;
  • Political or organizational issues; or
  • Human factors.

That last type of problem I actually really enjoy working on, but let’s put that aside for the moment.  Notice anything missing from that list?  Only rarely have I encountered problems that required really complex logic, difficult algorithms, or lateral thinking.

Why is this?  Have I shied away from those sorts of problems, or been unable to hack it?  I don’t think this is the case.  I did well enough on the SAT and GRE, and I can usually get myself back up to speed for solving logic puzzles in a week or two.  My guess is that my career is pretty typical, and that most of the problems that most companies face are due to constraints, vague business rules, organizational issues, and human factors.

This flies in the face of the kind of education most of us get as programmers.  At OWU the computer science department always erred on the side of math – we spent more time on concepts than practical applications.  I really, really value the kind of coursework I had in college but when it comes down to it, I learned just two things that I use on a regular basis:

  • Basic concepts and common programming paradigms; and
  • How to learn new languages, programming paradigms, etc.

I really enjoyed discrete math, but have rarely needed all the combinatorics.  Hacking scheme in my AI class was very cool but that’s the last time I’ve done any alpha-beta pruning.  I have successfully solved problems with some relatively mundane insights:

  • Don’t rely on memory, take notes and find references.
  • Look for low-hanging fruit.  Does the database even have indexes?  Do you really need to debug 2,000 lines of Javascript that essentially reimplement the concept of linking?
  • If you ever have a technical quandry, you’re probably not the only on in the world with the same question.  Chances are one of those other people has already asked the question somewhere on the web, and with a little luck someone else has already posted the answer.
  • Don’t get involved in political struggles between teams and don’t play the blame game.  Be unerringly pleasent in contentious situations, and if someone agrees to something in a meeting follow up with and email or some kind of documentation.
  • Prototype and iterate, people tend to use vague terminology and don’t always want exactly what they think they want.

So, if you’re going to end up implementing shopping carts or interfaces between large internal systems most of your career, why bother with brain teasers and algorithm interview questions?  Does this mean all that fancy book learning should be thrown out the window?

No!  Of course not!  If you do, when a really juicey problem does come along you’ll choke like me.

I’ve come to the conclusion that I need to make a concerted effort to look for problems that are difficult not because I don’t have enough time to do them, or because the two teams involved hate each other, or because the business analyst said “X is always Y” when he meant X is usually Y.  My guess is I’ll be hit with some soon at work.

In the mean time, got any good logic puzzles?  Textbook problems?  Favorite websites?  Feel free to post them in the comments below to get me started.