Monthly Archives: April 2011

CS 462: In conclusion

This week concludes my time as the TA for Phil Windley’s CS 462 class on distributed system design. I thoroughly enjoyed the class itself, as well as the opportunity and responsibility to help the students and manage the class project. It has been a growing experience for me. Giving the lab review lectures every few weeks stretched my presentation skills and forced me to improve them. Helping students individually has increased my ability to explain difficult concepts in an understandable way.

I loved learning the material and building the project myself and then watching the students learn and build it themselves. It has been a rewarding experience in every way. I’ve also grown to love these guys; seeing them hand in the final tonight and walk out of the room was a bit saddening. I’ve built friendships that will last for a long while yet.

I’d like to say to Phil Windley and to all the CS 462 students, thank you for letting me be your TA and learn with you. It has been a marvelous experience for me, and I hope it has been good for you. Best wishes!

Relevancy for the average user

Holden Page wrote a post earlier today about whether relevance services like my6sense are, well, even relevant to the average user.

While I cannot put myself in the shoes of an average user, I have to imagine that keeping up with information that the average user puts out daily, and consumes, could be quite easily managed without third party tools.

Holden follows 400 people on Twitter and has 343 friends on Facebook. For him, relevancy products are essential if he is to make sense of all the information coming in.

I have about half the people that Holden has–I follow 200 people on Twitter and have 166 friends on Facebook. For me, relevancy isn’t a problem at all. Even in my Google Reader, which has some 100 feeds, isn’t easy enough to manage as a stream without any relevancy services.

For anyone who follows fewer people than I do or reads fewer blogs, I don’t see the value of using a third-party app or service to aid in stream consumption. I don’t see the value for me (yet).

What are your thoughts? Have you used my6sense or XYDO?

Creating a RESTful web service with KRL

Phil Windley’s example of creating a blog using KRL got me thinking about what other (somewhat unconventional) things could be done with KRL. The first that came to my mind is building a RESTful web service.

The advantages of setting up a web service this way include zero configuration (just write a ruleset and deploy it), awesome integration with data sources all over the web, an extensible rule-based language, and drop-dead simple persistent data storage.

I put together a simple example. It has four methods:

  • echo Simply echoes back the “body” parameter
  • sum Takes two parameters (“first” and “second”) and returns their sum
  • counter Maintains a global (application-wide) counter, incrementing it each time and returning the value
  • ent_counter Same as the normal counter, except it is maintained on a entity basis (requires cookies, so it only really works in a web browser)

I’m using webhooks to implement this. The URLs aren’t super pretty, and they probably wouldn’t be desirable as endpoints for a production system. But it’s easy enough to build a proxy in front of them.

You can try out this web service with the following URLS:

Here’s the source code:

Many thanks to Sam for his answer yesterday on StackOverflow.

The beginnings of a Google Docs spreadsheet KRL module

KRL modules are just too much fun. I’ve written the basics of one for reading and writing to Google Docs spreadsheets. It’s based heavily on an example by Sam Curren. There are two things that you must do to use the app:

  • Publish the spreadsheet. This is one of the options under the “Share” button in the upper-right corner of Google Docs. This will make the data accessible for read operations.
  • Create a form and make it active. This is under the “Form” menu, and it allows the module to write new rows into the spreadsheet.

Find information about this module in the new Kynetx module listing.

The current version (still in its infancy) only supports writing one field with the submitsingle action. Eventually you’ll be able to pass an array of values and have those submitted, but I’m not there yet. In addition, that is the only way to write to the spreadsheet. You can’t, for example, update a cell. Yet.

I’d like to make this work with non-public spreadsheets, but those details get a little hairy, since authentication is involved. All in good time.

Kynetx module for Postmark

UPDATE: This module is now listed in the Kynetx module directory. Check it out here.

There was a question on Stack Overflow over the weekend about sending email through KRL. Sam’s answer was that it’s currently not possible in the runtime, but that you could create a module to work with a service like Postmark or SendGrid. I decided to take on the challenge.

The first draft of this module only lets you send with from, to, subject, and HTML body, but I’ll extend it to support everything in the Postmark API.

Here’s how to use it from your own app:

A few things to note:

  • You need to provide keys to the module which contain your Postmark API key and the sender address. The sender is set globally here because that is more in line with the way the Postmark API works.
  • The send_email() action will automatically raise and HTTP post event called “postmark_send”. You can listen for this event and use the responses, as illustrated by the second rule in the ruleset.
  • You need your own account with Postmark to use this. The free portion of the API is limited in how much you can send. You’re also not allowed to send bulk emails or anything of that sort. Using Postmark responsibly rests on your shoulders.

Let me know what you think of it!