August 2011
1 post
Tired of the glowing red circle on all your google...
I wrote Firefox and Chrome extensions to get rid of it.
June 2011
1 post
Moving on
Unfortunately, I will not be joining Xamarin.
I’ve worked on Mono for a long time (nine years I think) and there are a lot of people on the team I consider good friends. I wish everyone at Xamarin the best of luck. They’ve got a great group of talented people.
(This was a tough blog entry to write, I could barely muster the energy to find a funny cat picture)
As for me, I am...
February 2011
6 posts
Microsofts Secret Army or How I'd help .NET Open...
Something really cool is happening at Mix this year. They are putting together a little party for open source projects called Open Source Fest. There will be food, recognition and prizes (hopefully ipads). Sorta like a science fair for OSS projects. Its a cool idea and its obviously being done to help stimulate the .NET Open Source ecosystem.
This reminded me of an idea I recently had to...
Elevators, Bleu Cheese and Vendor Lock-in: A...
My apartment building is currently in the midst of a full blown elevator fiasco. An elevatopocalypse if you will. In an attempt at better understanding the problem I learned quite a bit about the elevator industry this weekend. Its actually a somewhat interesting industry (not as interesting as my other current reading topic though). It turns out that elevator industry shares some of the same...
Blog by the tenants of 160 E Berkeley →
We’re trying to increase transparency a bit at my apartment complex. Instead of bitching at each other in hallways or sending angry emails to the management we’ve decided to create a blog about the building.
Reblogging the link would be appreciated, since transparency only really works if the content is easy to discover.
Using Fancy Hands to name your...
I recently read this awesome article on coming up with product names. The article details how Lexicon, a boutique naming firm, comes up with product names.
The basic process used by Lexicon is something like this:
A team learns about the product
The team lists concepts they’d like to convey with the name
A number of teams with no knowledge of the product are asked to come up with...
Updated UI for the online editor
Less than an hour after I blogged an ugly editor UI last week Jonathan Pobst sent me a nicer looking version. This is what it looks like now:
We decided to keep the save/cancel as real form buttons so you can still easily tab to the save button after editing.
Editable monodocs
We have a saying around the office that Mono is about making “happy developers” and we feel a big part of that is having excellent documentation. High quality documentation has become increasingly crucial now that we have so many of our own APIs and can’t just rely on MSDN. Things like MonoMac, MonoTouch and MonoDroid all require their own documentation.
So one of the things...
November 2010
1 post
Manos now runs on Windows
Over the weekend a totally awesome contributer was nice enough to get Manos running on Windows.
Here are the instructions he supplied:
Install Mono 2.8 (Optional)
Follow the Windows specific instructions on http://www.mono-project.com/download to install Mono 2.8.
This step is optional but you will need the Mono.Posix.dll and PosixHelper.dll when you want to compile a single Manos dll...
October 2010
2 posts
Installing Manos on OS X
First off, for those that don’t know what Manos is: Manos is an easy to use, easy to test, high performance web application framework that runs on Mono. You can read more about it here.
Lately it seems like everyone is trying to install Manos on OS X, so I spent some time last night trying to install it on my macbook.
I think I’ve fixed most of the issues so its a relatively...
Manos now using libev-sharp
I just pushed a Manos update that switches all the event handling over to using libev. libev is a powerful event loop and is used in projects like node.js. Previously Manos had its own event loop,
calling directly into epoll itself. So this switch has a nice benefit of dropping some rather complex code from Manos. The main benefit of this switch is that libev is a cross platform library that...
September 2010
13 posts
Warm reception for Manos
Before pressing the Publish Now button on my the Manos de Mono Manifesto, I mentally prepared myself for a beat down. I figured the redditors would tear it apart for using Mono, the hackernews guys would tear it apart for not being rails and the .net people would be angry about some missing enterprise feature. Oh yeah, and then there are the free software people.
I think the redditors scared me...
Manos de Mono: The Manifesto
Although I’ve spent the last five years working on desktop technologies like Windows Forms and Moonlight, my real interest is on the web. I get more excited about requests per a second than smooth scrolling and I don’t really care about grid controls. Whenever possible I like to used web based applications like gmail, tumblr and prezi.
I’ve always enjoyed using and developing...
Cleaning up user input in Manos
I’ve been working on making Manos more secure by default. One of the big things I worry about is XSS attacks. I’m sure that most people understand XSS attacks, but here’s a quick example of how things could go bad.
In the Shorty app that’s included in the (upcoming) first release of Manos, we have a method like this:
void SubmitLink (Shorty app, IManosContext ctx,...
Bundled Docs in Manos
Originally I was planning on just hosting the Manos docs on the project site. I’ve never really used offline doc tools like Monodoc for whatever reason I’ve always just been more comfortable using my browser to read docs online.
Unfortunately, there are two issues with online docs.
The first one is obvious. Sometimes you can’t access them. Either because you don’t...
Command Line Args for Manos Apps
One of the use cases for Manos is embedding a web server in your app. So it would be natural to do something like this:
int level_of_foo = 15;
.....
var app = new FooApp ("Some foo string", level_of_foo);
AppHost.Start (app);
However there are two other ways you can invoke a manos app. You can compile your app into an exe (not supported yet) or you can use the manos tool in your application...
Simple Route Patterns in Manos
After looking at some ugly regexs I decided to implement a simple pattern matching system for routes in Manos. You can now use strings like this for your routes:
[Get ("/articles/{slug}/{page}")]
public static void Articles (ManosApp app, IManosContext ctx, string slug, int page)
{
}
[Route ("/{foo}/{bar}")]
public void Foo (IManosContext ctx)
{
}
Everything inside of the { } block is matched...
Updates to the routing system in Manos
I spent my memorial day updating the routing system in Manos to allow for parameterized actions. Originally actions in Manos were simply a delegate that returned void and took an IManosContext param. This made some things simple, but also made the API a little clunky to work with. Here’s an example of what things sometimes looked like:
[Get...
More Manos Manuals: Timeouts and Object Caching...
Just added some more docs on Manos.
Timeouts
The first doc I added is on the timeout system for scheduling periodic tasks to be performed in the Manos pipeline. Here’s a quick example:
MyManosApp ()
{
AddTimeout (TimeSpan.FromMinutes (5),
RepeatBehavior.Forever,
(app, data) => app.Cache.Clear ());
}
That will clear the...
Nice doc on the resource stream locator format in... →
First draft of Manos middleware docs
I just committed my first draft of documentation for Manos’s middleware layer. Its a pretty quick and easy read and I’d appreciate any questions, comments, death threats or concerns that you may have. The doc is written in markdown so you can read is pretty easily on github here:
http://github.com/jacksonh/manos/blob/master/docs/middleware.md
Things still need to be fleshed out,...
Some cute C# tricks →
Add contact profiles to gmail →
August 2010
12 posts
Apparently this AsParallel thing works
Last night I added support to Manos to parallelize HTTP transactions.
All I did was change this code:
foreach (HttpTransaction transaction in transactions) {
transaction.Run ();
}
To this:
transactions.AsParallel ().ForAll (t => t.Run ());
I got a chance to run apache-bench on both versions today and here are the results:
foreach loop
Concurrency Level: 200
Time taken for...
Undoing mode changes in a git working tree
After restoring a bunch of stuff from a backup today I found this incredibly helpful:
git diff --summary | grep --color 'mode change 100755 => 100644' | \
cut -d' ' -f7- | xargs -d'\n' chmod +x
git diff --summary | grep --color 'mode change 100644 => 100755' | \
cut -d' ' -f7- | xargs -d'\n' chmod -x
Taken from:...
New system for remembering what to do.
At the end of the day I used to leave myself post-it notes so I’d know where to start the next day. Here’s my new system:
internal XamlContext ()
{
Resources = new List<DependencyObject> ();
1. CASCADE XMLNS MAPPINGS
2. STRUCT -> INT TYPE MAPPING
}
How to watch Netflix streaming movies on Linux...
The TL;DR version: Sorry this isn’t possible right now.
For a few years now I have been working on Moonlight and “How do I play Netflix” is by far the question we get asked the most. There is a lot of confusion about why netflix doesn’t work on Moonlight and I imagine a lot of people are beating their heads against the wall trying to get it to work. So I have lured you...
Oh, so that's why you people have such long unit...
I’m sure I’m the last person in the world to learn this one, but here is an incredibly useful naming convention for unit test methods:
public void [TargetMethod]_[Scenario]_[Expectation] ()
So a typical test would look something like this:
public void OpenFile_FileIsNull_ThrowsArgumentNull ()
I had always found those long method names ugly, but now that I know there is a...
Tired of getting IsAssignableFrom wrong? public static bool IsAssignableTo(this...
– Hacker Magnifique Jb Evain
New aPads are out!
The new version of the aPad is now available. I’m fairly happy with my aPad but will probably upgrade soon so I can use Android 2.1 (and the faster CPU).
Personally I really prefer the smaller form factor of the aPad vs the iPad. Makes it much easier to hold/read.
These devices aren’t for everyone though. If you are looking for a web/reading tablet I’d recommend them,...
Developing For Developers Presentation
Ran across this last night and thought it was a pretty good presentation on the things you should be doing if you are developing API/Frameworks.
Developing for DevelopersView more presentations from Francois Zaninotto.
Downloads for every Silverlight Release
This is one of those putting this here so I don’t lose it posts. One thing I’d like to do more with Moonlight is test things across versions of Silverlight. Sometimes I run into an oddity and I wonder when it got introduced and that will help me narrow down whats going on. For instance, in Silverlight 4 there is an entirely new XAML parser, so I can rule out a big chunk of code just...
How much code is too much code in a web template?
I need your help here.
I’ve been working on my web template engine and I can’t decide exactly what sort of things should be allowed in templates. I think most people agree that these things should be available:
Property Access
if/else/else if Branching
Iteration over loops
Formatting
Math operations (think if (foo > 10 + bar))
It gets a little foggier here:
Method...
A couple doc driven development clarifications
In my ‘hey I’ll just post something real quick’ haste this morning I left out a couple of important points that I should clarify:
Context Is Important
I’m working on writing new API and creating an application framework.
I’m not trying to sell a concept. DDD was just a title, I’m not trying to convince you to work this way. If you want to, great. If you...
DDD Documentation Driven Development
Since attending NDC I’ve become fairly interested in Test Driven Development. I really like the idea of test first and I find my code turns out a lot better when I write tests early on. However, I find that starting my code at the unit test level is way too zoomed in for me. So what I’ve been doing lately is starting with my documentation.
When I say documentation I don’t mean...
July 2010
5 posts
The Greatest News Evar
As of now, we request that developers no longer maintain the contents of ChangeLog files by hand.
The ChangeLog files are now generated at distribution time from the Git commit history. For details see: http://mono-project.com/Coding_Guidelines#Source_Code_Control And in particular: http://mono-project.com/Coding_Guidelines#Git_Workflow_Changes
— That one dude from AntiTrust
OpenRasta Codecs
I’ve been messing around a bit with OpenRasta and I’m really impressed with the codecs concept.
Codecs are just things that convert your objects from one thing to another. A normal codec would be CLR object -> html page or CLR object -> json.
So in OpenRasta instead of having the Action/View/WhateverYouCallIt return your HTML page, you have it return an object and the...
Using EC2 and ApacheBench to load test your web...
Usually when we think about EC2 we think about using its elasticity to create highly scalable sites. One other cool way we can take advantage of EC2’s elasticity is to create instances for load testing our site, regardless of where it is hosted.
EC2s pricing model can be fairly expensive for full time hosting. If you don’t have huge demands I’d recommend something like Linode....
Squeezing some extra performance out of...
I had never noticed it before but System.Net.Sockets.Socket.Send contains a couple of pretty useful overloads:
Send(IList<ArraySegment<Byte>>)
Send(IList<ArraySegment<Byte>>, SocketFlags)
Send(IList<ArraySegment<Byte>>, SocketFlags, SocketError)
Looking at those methods you are probably thinking: “Wow, thats disgusting, why do that when you could...
Internet Everywhere! →