In Valid Logic

Endlessly expanding technology

Archive for October, 2008

Introducing Papercut!

with 5 comments

I am pleased to introduce a new utility I’ve been playing around with… Papercut.

Papercut is an SMTP tool designed for testing email functionality in a program. Ever want to test the email functionality of a program/site, but don’t want it to send an actual email? Maybe you have a bunch of test data, or it is a snapshot of data from a live site. Papercut is your answer.

Papercut implements an SMTP that is only capable of receiving messages, not sending them. It has no recipient policy or anything, just accepts whatever it gets and writes it out as an EML file. Then on top of the SMTP server, it has a GUI that allows you to view the messages it has received in either raw MIME format, plain text, or as rendered HTML.

screenshot

This is something I run into on an almost daily basis. I might need to check something works, or verify some formatting, and Papercut makes it easy, with no hassle of pointing it to a live SMTP server and verifying my email addresses are correct. To be honest, I was surprised I couldn’t find a program like this already out there. When I came up empty, decided to write one for myself!

It also makes use of WPF, so should have a pretty small memory footprint on newer OSes (found XP/2003 use more memory than Vista/2008), and the SMTP server is asynchronous and uses the managed thread pool, so it doesn’t tie up a lot of resources and should also work well with high message volumes (though the list of messages will get full).

Head on over and get it now!

Written by krobertson

October 29th, 2008 at 5:32 pm

Posted in Software

Warehouse open sourced, and forked

without comments

Last week, ENTP/Active Reload open sourced their web-based Subversion browser Warehouse. I’ve been using Warehouse on my own box for about six months for my personal Subversion repositories and had been anxiously awaiting their next release, since it was supposed to add support for Git.

With it being open sourced, and on Github, I went ahead and forked it almost right away. One of the first things I wanted to do was to port some of my customizations from 1.1.6 over to the latest code. I had made a number of tweaks to make it so that Warehouse itself managed the Subversion repositories, rather than you pointing it to an existing repository. Also fixed up a few incomplete/unused parts like its dashboard, added the ability to display README files inline with the directory listing (like Github) and so on.

With the open sourcing, it looks like a lot of their support for Git was half done. It supports browsing and changesets, but has nothing for adding Git repositories, and have had a few issues with syncing changesets. I’ve fixed it up so that things basically work, though unsure about how much effort it would take to finish it. If you’re using something like Gitosis (which I am), don’t know if a lot of the management is needed. Gitosis takes care of most of creating repositories, SSH keys, and permisisons, but it is still nice to have the repositories browsable on the web and easily manageable. If collaborating with some others on a project, it is nice to create an account for them and add their SSH keys themselves. Could have Warehouse write to and commit the gitosis.config, though that seems a little funky.

Overall, I am not sure how far I am going to take my improvements on Warehouse. But in general, the code could use a lot of clean up, as the author admits. What would be really nice would be a rewrite in Merb/DataMapper, and designed to be more SCM agnostic, so it could also work with Bazaar or Mercurial.

Another thought is to have built in WebDAV support, so it isn’t dependent upon outside processes for serving the actual files. Right now, it basically assumes mod_dav_svn in Apache, likely Gitosis for git, or possibly WebDAV. But with those, taking the management of passwords and permissions takes additional steps to set up… you can’t just install and run. Though rewriting would be a big undertaking, which I’m not sure if I am up for. I tend to jump between extracurricular projects, as they tend to mound up.

If you do clone my code, be aware the installer is currently broke. My changes introduced some new configuration settings that the default installer doesn’t create. Going to be fixing that.

Written by krobertson

October 9th, 2008 at 7:32 pm

Posted in Code

Who are they trying to impress?

with one comment

Doing some browsing (I do a lot of that I guess), I stumbled across this site called Office Snapshots which profiles the office space of today’s tech companies. Basically it allows geeks to check out the digs, gadgets, and stylish offices of the latest start ups.

While browsing the list of companies, I realized something interesting. A lot of these companies are the trendy web 2.0 companies where you have to squint and turn your head sideways while reading the name to see how it is pronounced. And of course, these companies are VC backed. The thing I find odd is that the VC backed ones have yet to create a revenue stream, and yet they’re dumping all this cash into their offices?

I mean, too many of them are located within San Francisco, in a high real estate area, have taken $15+ million in VC funding, and are filled with today’s latest trends in hip office furniture and desks. Is it some sort of start up street cred? They do it to attract potential employees? Impress customers? Really, I don’t get what the purpose is.

I would expect that kind of impressive office space from some of the established companies like Google, Microsoft, or Apple. You know, the ones who actually generate income. But start-ups?

Firstly, if I worked for or was looking to work for a company like that, I’d be looking at it thinking ok, they got $15 mil from a VC, they’ve yet to generate income, and are blowing their wad on offices? Does this sound like a financially stable company? Or even if they are still doing ok despite their office decisions, does this sound like the kind of company I’d work for? Is it wise use of their money? What is the ROI on trendy office space?

If I was looking at it as a customer (as I do with one of them), I’d be thinking why the hell are you blowing that chunk on office digs when you service still sucks. It would be better spent on support, improving your service, or hiring talent to transform a cool service into a sustainable business.

Not as if I was partial or anything, but I much prefer how Telligent philosophy of function over form. They have the Nerf guns and scooters all over, but that can be had at Toys’R'Us for a few hundred no problem. When it comes to the office itself, there is much more focus on being modest. I mean, for a while ago, the CTO, Jason Alexander, was sharing a conference room with 4-5 interns as his “office”.

But I’m still left with the question… to what purpose who impressive offices serve start-ups? Who exactly are they trying to impress?

Perhap I’m biased since I didn’t go to a Start-up training camp Harvard, Stanford, MIT, or any one of the Ivy league tech colleges… I wasn’t indoctrinated with the VC funded start-up mentality.

Written by krobertson

October 4th, 2008 at 1:01 am

Posted in Technology

Thou shalt not abuse thy meta

without comments

I was browsing some code for utilizing webservices in Ruby the other day when I stumbled upon something that made me raise my eyebrow in a WTF moment.

This library, which will remain nameless, was pretty simple in nature, but it included some extensions to core types like File, String, Fixnum, and Symbol, which made it so you could do this:

def get(obj)
  siteroot = 'mydomain.com/api'
  open(http://siteroot/obj.xml) do |res|
    ...
  end
end

I found it quite odd… creating URLs without making them strings? Ok, kind of cool to look at. But not very practical. Sure you can tack some values together easily, but how useful is that? Don’t really gain any productivity. Could easily just write it like this:

def get(obj)
  siteroot = 'mydomain.com/api'
  open("http://#{siteroot}/#{obj}.xml") do |res|
    ...
  end
end

Not that much harder, and much clearer that it is a string! The other way is far less readable, since you might get tripped up on what is a variable and what isn’t. Upon first glance, might not realize ‘obj’ is a variable and not a wannabe string. But the .xml? That isn’t a variable, that is a wannabe string.

But it made me think… should a library take the liberty to extend the core, unless that is the purpose of the library? Should a small (this was ~50 lines) library for aiding with webservices be extending the core classes? You include this library and then the extensions are in your whole app, potentially colliding with others. Since it made use of the method_missing method, what if another library you are using takes the same liberties on the same class, then you could get some odd behavior.

It is important to distinguish between a framework and a library though. ASP.NET/ASP.NET MVC, Rails, Merb are all frameworks. This one I was looking at was a library. Frameworks are more encompassing. You build a program on them, not with them… to put it visually, a library is a piece of a building, while a framework is the foundation.

I love Ruby, but one of the side effects of a dynamic language like it is that people can go overboard with the metaprogramming and can alter behavior in ways that don’t always make sense or that could interfere with each other.

Moral of the story: Simple libraries shouldn’t modify core classes. Nifty meta tricks aren’t needed.

Written by krobertson

October 3rd, 2008 at 4:44 pm

Posted in Code