Aimless noise and insights into my little world
Monday, July 13, 2009
New CouchApp feature
Saturday, July 11, 2009
Writing kanbancouch
sudo easy_install couchapp
(I already had CouchDB 090 installed and running as CouchDBX)
I then generated and initialised the kanbancouch application:
metson$ couchapp generate kanbancouch
[INFO] Generating a new CouchApp in /Users/metson/workspace/KanbanCouch/src/kanbancouch
metson$ couchapp init --db=http://localhost:5984/kanbancouch
[INFO] Initializing a new CouchApp in .
So far so good. I then did a test push, and low the app appears in Futon.
metson$ couchapp push
[INFO] Pushing CouchApp in /Users/metson/workspace/KanbanCouch/src to design doc:
http://localhost:5984/kanbancouch/_design/src
Which hasn't worked. I realised this is because I was pushing the parent directory (src) and not the kanbancouch application. Moving the .couchapprc file into kanbancouch and running push from inside there worked fine:
metson$ couchapp push
[INFO] Pushing CouchApp in /Users/metson/workspace/KanbanCouch/src/kanbancouch to design doc:
http://localhost:5984/kanbancouch/_design/kanbancouch
[INFO] Visit your CouchApp here:
http://localhost:5984/kanbancouch/_design/kanbancouch/index.html
Lesson 1: push from the right directory!
Next I pulled in the Simple Kanban empty html file and used this as the index.html for the application. Pushing this up to the server gives me the Simple Kanban interface but being served from my CouchDB instance - nice!
metson$ cd _attachments/
metson$ wget http://www.simple-kanban.com/download/Simple_Kanban_App_1.0RC1_Empty.html
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 73011 100 73011 0 0 95224 0 --:--:-- --:--:-- --:--:-- 130k
metson$ ls
Simple_Kanban_App_1.0RC1_Empty.html index.html style
metson$ mv index.html placeholder.html
metson$ mv Simple_Kanban_App_1.0RC1_Empty.html index.html
metson$ cd ..
metson$ couchapp push
[INFO] Pushing CouchApp in /Users/metson/workspace/KanbanCouch/src/kanbancouch to design doc:
http://localhost:5984/kanbancouch/_design/kanbancouch
[INFO] Visit your CouchApp here:
http://localhost:5984/kanbancouch/_design/kanbancouch/index.html
Next I needed to decide on how to store data, and what their associated views would be. I figured I'd have two types of document:
- Stories
- The Kanban "story" that represented some work you needed to do
- States
- The different states a story could be in
The state documents would be simple, just their name and shortcut identifier. There would be one view which would list all the state documents.
{
"_id": "d5164b50205561f45f9b4dbb7b69607b",
"_rev": "2-1724121541",
"state_shortcut": "D",
"state_name": "Design"
"state_position": 0
}
This made me think it'd be kind of neat to be able to push data up into the CouchApp. Looking through the code quickly I think that's not possible - feature request/patch for the future...
So I have a bunch of states, now I need a view to spit out the states, sorted by their position, in a format ready for the kanban script to consume. And here it is:
function(doc) {
if (doc.state_name){
emit(doc.state_position, doc.state_shortcut + ',' + doc.state_name);
}
}
This goes in a file called views/states/map.js. Pushing that to the server I can now see the json data from the resulting view. (This was sort of non-obvious from the docs/examples - I think something has changed in CouchApp that's not been reflected elsewhere, though I did see mention of it in one GitHub commit)
Next I'm going to need a few example stories and associated views. The stories need to have a syntax appropriate to the Simple Kanban code:
There are three columns for stories. The first column contains the state the story is in, the second contains an identifier for your story and the last column the name of the story. You can edit the columns, change states, change names, remove and add stories.
The state will be the state_shortcut and the story id will be the document id (I'm in two minds about whether to let couchdb auto-generate this or allow it to be a user filled field, if couch generates it then I'll need to shorten it in the view). I thought I'd go a bit further than this and add a tag to a story and associated tag cloud. So a story document looks like:
{
"_id": "work123",
"_rev": "2-3372157482",
"story_state": "D",
"story_tags": [
"kanban",
"couchapp",
"blog"
],
"story_name": "kanbancouch",
"story_description": "A port of the Simple Kanban web page to a CouchApp, and associated blog post"
}
Now I need a view to generate the data for the stories and another one for the tag cloud.
Stories data (views/story-data/map.js):
function(doc) {
if (doc.story_state){
emit(null, doc.story_state + ',' + doc._id + ',' + doc.story_name);
}
}Tag cloud map (views/story-tags/map.js):
function(doc) {
if (doc.story_tags){
for (t in doc.story_tags){
emit(doc.story_tags[t], 1);
}
}
};Tag cloud reduce (views/story-tags/reduce.js):
function(keys, values, rereduce) {
return sum(values);
};So that's all the CouchDB internals done. Now I need to hook it into the Simple Kanban code.
"References"
Pages I read while writing this
Thursday, February 26, 2009
Good Week At FNAL
It's been a good week at FNAL, I think we've got a lot done despite some bad news re effort available for our group. Got some cool t shirts too.
But now I'm tired and feeling a bit fluey, very glad to be heading home tomorrow afternoon, despite Sarah and Daves awesome hospitality!
Posted with LifeCast - Geolocate this post
Friday, February 13, 2009
Thursday, February 12, 2009
Monday, December 22, 2008
First Blog From The Iphone
Posted with LifeCast
Monday, December 08, 2008
Sunday, November 16, 2008
Thursday, November 13, 2008
Wednesday, October 08, 2008
Not yet our flag

That was from the Continental Airlines site, looks like it's fixed now...
Tuesday, October 07, 2008
Wednesday, September 10, 2008
Tuesday, July 29, 2008
Screenshot
Setting up my new computer today and I'm really quite pleased with it. Have Ubuntu installed and now tweaked to doing just what I want, which was surprisingly easy! More screen grabs soon - this is my Ubuntu environment, currently my windows one is very plain. LInks to the .conkyrc, theme and background to appear soon (e.g. probably never ;)). They're basically tweaks of things you'll find in my recent del.icio.us bookmarks.
Sunday, July 13, 2008
Dead Simple Pesto
Ingredients
- roughly equal amounts of Basil and Parmesan cheese
- Olive Oil
- Clove or two of Garlic
- Salt and Pepper
- Lemon Juice
Roasted Goats Cheese and Butternut Squash
Ingredients (serves 2)
- Butternut squash
- Goats Cheese
- Homemade Pesto
- Pecan nuts
- Tomatoes
- Balsamic Vinegar
- Olive Oil
- Italian herbs, black pepper
Serve with roasted crushed boiled potatoes and green leafy salad.
Friday, July 04, 2008
Sunday, June 22, 2008
Wednesday, June 11, 2008
Not Inspired, Inspired
First up: The Internet, or more correctly the World Wide Web. There was once a time when those three W's would make my neurons explode with ideas. I had things I wanted to find out there in cyberspace, things I wanted to put out there (other than random blog posts). Now it seems the web is just a place to sell things on various "social networking" sites. The user experience has become homogenised to the point of being an identical set of click-throughs. Where once I saw dreams, ideas, new horizons now I just see cheap CD's.
I do occasionally get excited about webby things but they are either mundae, work related or more about some technology geek-out. In most places the content of a page leaves me cold. I'm as bored of the internet as I am of TV - probably for similar reasons. I guess I've moved out of the target market, so that content is no longer aimed at me. I suppose that is a good thing (who wants to be a target) but as someone who has historically been quite "into" the web it leaves me at a bit of a loss.
Visuals, or more specifically me creating them and actively engaging in that process, is a tough one. I don't think I'm disconnected from it, or bored of it, more that I don't have time to engage as deeply as required. A ten minute flick through DA or Flickr every few weeks isn't really enough to consider oneself engaged. I do a bit more photography than before, but nothing like enough to satisfy any creative urge. I haven't done a photo-manipulation for years (well there were two a month ago...), likewise for any kind of design/typographical stuff.
Music is a tricky one. I've probably bought more music in the past year than in the past 6 or 7 years preceeding it, mainly due to having a salary these days. But a lot of the CD's I've bought have been back fill - getting the CD of the MP3's I've had for ages, filling in gaps in an artists discography. There's very little "new music" in what I've bought. Why is that? Well, partly I don't have the time to trek through record stores and go to empty gigs every week night.
There's also a massive failing in radio and music press to cover anything I'm interested in either intelligently enough to make me want to read/listen or at all. Music magazines/websites are either painfully pretentious or aimed at the pre-pubescent. (One exception is Stereogum!)
Last but not least, there's a lot of shit out there, and wading through it gets you rather smelly. People don't have (and don't need) and kind of quality control they record songs on their laptop, using free/pirate software and upload to MySpace. Don't get me wrong, I've stumbled upon some amazing music on myspace for which I am extremely glad, but there's not an easy way to interact there (the site is dreadful, admit it!) and I can't dial up a bunch of new tunes at random.
I've used podcasts a bit (again Stereogum!!) but they don't really solve the problem (I'm not sure what the problem is...). I have more than three weeks worth of solid music on my computer - why do I need more? It's like a crack habit.
The catalyst to this post was reading a NY Times article on Trent Reznor. Love or hate his music, you've got to admit this guy is a genius, a generous one too! The whole way that Year Zero was "marketed" was phenomenal. More like a piece of Brecht theatre than an album launch. The recent releases of Ghosts and The Slip really brought NIN into the "digital age", and set a high benchmark for what people should expect. These MP3's were beautifully packaged, for want of a better word. Each track with individual art work. Splendid. Inspirational.
So, what to do? Where to go? How to progress? What is my "next action"?
Well first up, I want to get inspired by the internet again. I want to create things with the wide-eyed amazement of my 16 year old self. One thing I plan on doing is writing a little script that makes a podcast from a bunch of artists on MySpace. Half of the code has already been done (must remember to blog that...) so it'd really just be making the podcast xml - simple!
Next, Visuals. Hmm, well YANU need a decent web presence. Time to get on that, I think. I worked out how blogger style sheets work a while ago to help Chloe with a web page so maybe it's time to put that knowledge to good use! This place could do with finishing off, too. I've also got a ton of photos from Iceland to sort through.
Music, well again it's about time, and making the most of what you've got. I'm playing in two bands, one as a hired gun (The Uphills) and another where I'm more central (YANU) - I should be making more of this! With The Uphills I get to goof around and play loud solo's, fine. In YANU I used to write more of the music. Recently I've not been as involved, busy boy, and I think I'm going to put my mark back on what we do. I think that we've lost some of our experimental edge and are kind of rehashing the same ideas. Time for a change!
One common thread in this is a lack of time. But these past two days I've got loads done, I just had to get off my arse and do it. So, I think next time I'm mindlessly clicking through the web, bored to a coma, I'll stop myself, think about what I'd like to see or hear, and go off and make it!








