Sunday, February 19, 2012

Tools Update: Ditto Clipboard Manager

One of my favorite tools is the Ditto Clipboard Manager. This is an open source tool that is basically copy/paste the way that it should have been done in Windows to begin with.

The long and the short is that it keeps your clipboard contents back as many entries as you want (I store the last 500 entries).  You access them by the key stroke Ctrl+` (this is configurable) and it looks like this:

Ditto Clips dialog

























The team just released a new version. Get it here

Friday, February 10, 2012

MongoDB and the .NET Developer, Part 1: Mongo what?

I have found the whole NOSQL movement an interesting one.  And the product that I am most intrigued about is MongoDB.  I just went to their MongoDB Boulder event this week and was struck by how big a deal Mongo is in the PHP/Python/Node/etc... space but hasn't gotten much traction with .NET folk, so I am going to write a bit on getting started with it from a Visual Studio user's perspective.

First what is NOSQL and particularly MongoDB?  In general NOSQL is a growing set of technologies that are alternatives to the Relational Database.  Why bother?  We have so grown up with using the relational database that we assume it is the answer to every storage problem except few like file storage.  NOSQL questions that.  I will point out different benefits as I go, but for a more in depth treatment ask Wiki or the Duck

MongoDB is a fairly mature, open source NOSQL database produced by the company 10gen. There are binary downloads for Windows, OSX, many flavors of Linux and others.  It is easy to start it as a regular exe, but can also be run as a service. It manages data as collections of JSON/BSON documents.

One of the coolest things about it is that you can store rich hierarchical data in a very simple manner, in .NET basically handing an object off to your repository, it is serialized and stored and you are done.  Big deal you might say...we can do that pretty easily in a SQL table. First I promise it is much easier to do in Mongo than in SQL Server. But the real difference here is that all of that hierarchical data can be indexed by Mongo to make searches very efficient. For example, here is an simple example document of a person contact info:
{
  _id: 3409d3008c8d35c816390000
  firstName: “Matthew”
  lastName: “Nichols”,
  addresses: [
    {streetAddress: “123 Smith St, Unit Q”, city: “Denver”, state: “CO”, postalCode: “80206”, type: “Home”},
    {streetAddress: “123 Barney St”, city: “Denver”, state: “CO”, postalCode: “80211”, type: “Office”}
  ]
}

A collection in MongoDB could have many thousands of documents like these.  With the right indexes set up on the addresses array you could search for all of the people that lived in Colorado.

Features
So why bother?  There are a number of features that Mongo has that I find compelling:
  • A simpler and more flexible programing model: In Mongo your documents are just the data that your application hands it.  You are essentially just storing your domain model.
  • Replication is easy to setup. This allows for very high availability and data safety.  I will walk through setting this up in a later post.
  • Scales horizontally:  Database sharding is made pretty easy in Mongo. This allows the system to scale across multiple cheap machines rather than scaling vertically on increasingly expensive hardware.
  • Unlike many cross-platform open source projects Windows is well supported.  There is excellent documentation and a very competent driver.
Next post I will walk through setting up Mongo and some related tools on a development machine.

Tuesday, January 10, 2012

Daniel Suarez & Daemon

A couple of years ago my friend Mohan turned me on to the novel "Daemon" by Daniel Suarez which I thoroughly enjoyed.  It and it's sequel "Freedom" are a tale of  what sort of changes, good and bad, could be forced upon us by the software around us.  While certainly there were a couple of exaggerated technologies, by and large I am convinced that it is a fairly realistic possibility.  Entertaining and educational.

Today I heard a podcast of the author speaking at one of my favorite lecture venues, the Long Now Foundation about the same subject matter.  I recommend checking it out. Link

Drawing a tree diagram with Raphaël and CoffeeScript

I recently had to create an interactive tree diagram displaying companies and their subsidiaries and the business requirements specified something "prettier" than I could achieve by styling a nested HTML list.  Additionally I had to support Internet Explorer 8, which does not have Canvas or SVG support.  Pondering the problem I remembered hearing on The Changelog of a client-side drawing library called Raphaël.  Raphaël provides an abstraction over SVG on browsers that support it and on IE does the same thing using VML and thus giving me the ability to draw pictures in the browser going all the way back to IE 6.

So armed with the ability to draw I created my tree.  Most of the new client-side code that I am writing today is in CoffeeScript so that is what I used here.  The following is my main drawing routine:

And then some code to create some sample data and call it:

See it in action here

I'll post the zipped code shortly.

Monday, December 26, 2011

Charles Babbage's birthday: The computer age that didn't quite happen

Today is the 220th birthday of Charles Babbage, the man who designed, but didn't implement, what would have been the first general purpose programmable computer in the mid-1800's!!

Tuesday, October 11, 2011

On the client-side

I have been writing rich web applications for 5 plus years and have gotten pretty good at it (and getting better all the time I hope). I am entirely satisfied with the sort of interfaces and functionality that I can achieve combining server-side code with client-side javascript, HTML and CSS, except for one tiny little complaint; client-side code takes forever!  Compared with the productivity that I can achieve writing the server-side code, the level of effort that goes into writing the client-side code is daunting.

I am committed to changing that in a significant way.  There are some very interesting tools emerging in this regard; some of the ones currently attracting my attention are:
  • CoffeeScript: a very interesting language that compiles down to readable and efficient javascript.
  • LessCss: Css with the basic programming structures that geeks expect.  Again compiles down to CSS.
and other similar stuff. More to come.