Category Archives: Dev

Ramblings about add-art

Ignore this, it is just a braindump from the train.  Unless you want to help out.

I’ve started working on a project called add-art.   The idea is to turn advertisements into beauty.  It is based on the popular ad-block-plus firefox extension, but instead of leaving holes where advertisements are removed, it would insert art.  Curators could book shows on add-art.org for artists.  When you go to a website with tons of ads, they would be replaced by art images.

Great stuff!   Once we get the plugin working with add-art.org, we should look at decentralizing it.  Let the extension communicate with multiple ad block lists and multiple replacement image servers.  Then package the add-art.org server as an installable package so anyone can run it.  Let users pick up the url of other servers as a way to get art from the artists they like on their browser…

Deviantart might run something like this.
Maybe flickr/explore/interesting could be a provider.
Hell, why not use atom/rss as the provider and let any rss list of images be the provider?
Image sizing becomes an issue.  You need to stick in appropriate sized images.  If they aren’t the right size you’ll need to slice them up on the client side.  Is that cheap?  Does the browser give you a way to not only decently resize, but also slice from an image?

Databind a ComboBox to an Enum and your business object

Databinding intelligently in .net is usually pretty easy. Recently I wanted to quickly bind a combobox where the items are the values of an enum made up of single words and the selected value is tied to my data object. I was surprised that it wasn’t all that straighforward. Here’s me saving you some time in the future.

What you want is an easy way to get a list of objects that you can bind the combobox to. Here is a list you can easily create from any enum that will give you a handle on the names and values of the enum.

code:

public class ComboEnumList <V> : List < keyvaluepair < string,V> >
where V: struct //at least we can constrain that it ain't a class
{
public ComboEnumList():base()
{
//because generics don't allow a constraint like "where V: enum"
if (!typeof(V).IsEnum) throw new Exception( "New Argument Not An Enum " + (typeof(V).FullName));
Array values = Enum.GetValues(typeof(V));
foreach (object value in values)
{
this.Add(new KeyValuePair(Enum.GetName(typeof(V),value), (V) value));
}
}
}

To use this, you’d inherit an instance of this class with type V = your enum.
code:

public class AvailableJerseyStyles : ComboEnumList
{}
public enum JerseyStyleEnum{
Stripes,
Diamonds,
Paisley,
CheckerBoard,
Houndstooth
}

Now go into the VS2k5 designer, add a new project data source based on your AvailableJerseyStylesClass. On instantiation, create the AvailableJerseyStyles object and set it as the datasource for your bindingsource. DisplayMemeber = “Key”, ValueMember = “Value”.
Bind the enum property of your business object datasource to the SelectedValue of the AvailableJerseyStylesClass and you are good to go.

Hope it helps.

Offline and online

Google came out with a good idea a while ago called Google Gears.  The idea is to make some of these new fangled web applications able to function when you aren’t connected to the internet.

It never seemed like that great of an idea to me, but I’ve been using a personal Wiki to track household stuff with my pardner Sam.  I’ve been wishing for a wiki that I could use when I’m on the train and away from the internet.

I love the network.  When you are away from it though, why couldn’t you have a better cache – a mini net that is the last known version of what you seem to care about.  I’ve been using programs to download entire websites locally so I can read them while I commute.  It would be nice if you could just mark them as being of special interest in your browser.  Let computers hum and whir and keep it all up to date and in synch.  If we can do it with email, could we do it with the web, or at least the web I’m interested in?

Some folks think that offline and online will disappear as the network penetrates every corner of the world.  I doubt it.  Someone’s got to pay for it. More folks are interested in drinking water than BoingBoing, but it hasn’t penetrated every corner of the world.

The shotgun approach to recruiting is counterproductive

> Hi Matthew,

>

> I'm very impressed with your rating/experience.

> At the current time, I have a few clients that are looking for experienced

> Ruby Rails developers (both contract &amp; permanent) like yourself. There

> is

> lots of room for creativity and growth at these places.

>

> So, my contacts are below if you're still looking. Also, if possible, can

> you pls forward me

> your current resume?

>

> Thanks much!

>

> Leslie Doan

> ******************

> Managing Partner

> MINDSPHERES, INC.

> 2570 North First Street

> Suite 200

> San Jose, CA 95131

> C: 408.386.7246

> E: leslied@mindspheres.com

> W: www.mindspheres.com
Hi Leslie Doan,

I know it's tough to be a recruiter.  Cold calling is difficult and much

of recruiting is a volume game.

But you aren't doing yourself any favors with this email.

You're starting this relationship with me by lying to me.  You say you've

looked at my working with rails profile and been impressed.  But that

can't be true.  I've never worked on a real rails or ruby project.  I have

no ratings or experience, so how can you be impressed.My resume is also clearly linked from my working with rails profile.  If I

can't rely on you to know that, how can I trust you with my career?  I've

worked with a lot of recruiters, and I know that high volume folks treat

you like a tiny number. They are usually more interested in getting you

hired anywhere at any price so they can collect a commission.  I smell

that big time in this email.

If you show any level of familiarity with who I am or any of the many

links on my profile, I'm so much more likely to work with you.

Hope this helps you, and good luck in the recruiting game,

Matt

p.s. To make this letter worth my time as well as yours, I'm putting it up

for my pals on my website.  Don't worry, I don't have a very high

readership.



As you might imagine, I haven’t gotten a response from Leslie. I don’t think she’s interested in investing time in my career.

Paper Wallet Generator

I was very excited to see Ryan Stewart’s paper wallet pdf generator a while ago. Excited, but frustrated. It was good, but had some flaws. I got in contact with Ryan, and he invited me to help out with fixing the problems.

Some of the issues are in the underlying ezpdf code for PHP, so I thought I’d go over them. Ezpdf and the pdf class underlying it have some bugs with handling rotated text, which I think I’ve fixed. It’s rough, but I’ll be putting it up soon, and then I’ll submit the changes to R&OS for inclusion into ezpdf.

Should be going up sometime this week.