Recently at work we’ve started up a “book club” of sorts (I’ll take the blame for it). The idea is that we cooperatively come up with material to review and then discuss it once a week to see how it can perhaps fit in to making us better.
I’m hoping it’s going over as well as I’m thinking it is (which is to say fairly well). I’m also hoping that the other developers aren’t secretly saying this is some stupid shit behind my back.
I’m just trying to find ways to keep us all interested, motivated, and most importantly keep rust from forming on our skillset/careers.
Anyway, one of the books we’re going over is McConnell’s latest Code Complete book. One of the topics from last week or so was the idea of readability and the concept of “Software is written once, but read often”.
I’m not sure where I got it from (I have my ideas), but I really like things such as:
if ( gatekeeper.getPermissionManager().getUserPermission() == Permission.READ_ONLY ) {
However attractive (or unattractive) that may seem to you, the argument would be that this:
PermissionManager pm = gatekeeper.getPermissionManager();
UserPermission up = pm.getUserPermission();
if ( up == Permission.READ_ONLY ){
would be more readable. And honestly, I’d have to say that is a correct statement.
It bums me out, really. But I’m cool with going along with it, and besides I can write personal code however I see fit.
Where this really leads me though, is I’m currently digging in to the .NET 2.0 framework code (huge props to Denis Bauer’s Disassembler) researching an assumption/theory about the new FileUpload component. My current path lead me to the HttpRawUploadedContent.WriteBytes method. There’s a terribly attractive line in there that looks like this:
byte[] buffer1 = new byte[(num2 > this._fileThreshold) ? this._fileThreshold : num2];
Looks good doesn’t it?
However, there’s that readable itch there in the back of my head saying “Geez, shouldn’t we break that out?”. I suppose the otherside (we’ll call him the “evil Cameron”) is saying “Come on, if the framework developers are doing it, why not”
You be the judge. I know it isn’t as readable. I know it isn’t as maintainable. But me I still prefer it.
Tags: code
If you ever wanted a way to eat whatever you wanted, just spend 6-8 hours on the bike.
via The Boston Globe
This is what chef Gisbert Kunz typically feeds Tour de France riders:
Breakfast
8.8 ounces (dry measure) rice or pasta
4 ounces muesli
4.4 ounce carton of yogurt or fromage blanc
1 to 2 slices whole grain bread
Homemade marmalade
Omelet made with 3 egg whites and one yolk (optional)
1 to 2 slices ham and/or cheese
Freshly squeezed orange juice
Coffee
Feed bags
4 cakes or bars (including rice cakes, almond cookies, and dried fruit bars)
Cut-up fruit: three chunks of pineapple, banana cut in three pieces, quartered apple
2 or 3 finger sandwiches filled with ham and cheese or preserves or chicken salad
3 or 4 protein bars
One .15 liter mini-can of Coke
Snack ( in hotel )
Small bowl rice pudding, served tepid
Sliced fruit
Dinner
1 to 2 slices prosciutto or other cured ham
8.8 ounces (dry measure) pasta with fresh tomato sauce
8.8 ounces beef tenderloin
Ratatouille (eggplant, zucchini, tomato stew)
Yogurt
Fresh fruit
Slice of cake (optional)
Water
Glass of beer, sometimes mixed with lemon soda or lemonade (optional)
Glass of wine (rarely)
Tags: bike
“Being productive isn’t something that just happens. You don’t just sit down and be productive. Real productivity takes time. It’s a process. You make your way into it. Sometimes it takes 15 minutes or a half hour or an hour or more to really get in that zone. And when you’re in that zone you are actually getting real work done. But once you get knocked out of that zone it takes a real toll on you. You go from highly productive to annoyed. And all these new methods of interruption, and the ability of anyone to find you any time, well, I think they’re just making it easier to indirectly annoy people. I don’t have research to back this up, it’s just a gut feeling.”
Link
Tags: code

I spent the weekend building out a deck off of our patio this weekend. We started a couple of weeks ago by pouring cement for the support beams out on the far edge, and then really started it up on Saturday.
We also decided to use Trex composite decking since we’re here in the northwest. We also went with Chinook Lumber on a recommendation, and it was well worth it. They’re a smallish lumber shop with the small-town lumber shop feel. Highly recommended for any decently sized wood project of any sort. Skip HD or Lowe’s and go with them.

Saturday was pretty good, with only two short pauses for some rain storms. Got about 60% of the framing done
Sunday sucked. Rained the whole day nice and hard. Finished the framing and started laying decking boards
Monday was much better weather of course since my help was only around till noon.
It’s now Tuesday morning around 5:15am, and there isn’t a damned cloud in the sky.
As you can tell from the picture we aren’t quite done yet. We decided to push out from 13ft to 14ft. Stairs and benching/railing need to be finished as well.
update: Some more details on Trex: “As an added benefit of your Trex deck, you are helping the environment because Trex is made primarily with recycled plastic grocery bags, reclaimed pallet wrap and waste wood.”
Tags: home
I did this quite awhile ago, but with the race season in full swing, I thought I’d bring it up.
Velonews RSS feeds generated by scraping the specific sections of their site and put into separate RSS files.
Dare I go out and do more sites?
Enjoy.
Tags: code

The latest creation to come out of the kitchen.
Cold veggie salad
--------------------------------
1 tbsp. Champagne Vinegar
3 tbsp. Olive Oil
1 tsp. Dijon Mustard
(Mix together in small bowl, add at the end)
1/8 c. Dry Roasted Pignolis
1/8 c. Glazed Walnuts
1/4 c. Blue Cheese or Feta Cheese
1 c. Frozen Corn
1 c. Frozen Edamame
1 c. Frozen Peas
1/2 c. Kidney Beans (canned)
1 c. Green Beans (canned)
1/2 c. Cooked Quinoa
Salt/Pepper to taste.
1500 calories
(140g carbs, 55g protien, 76g fat)
Tags: food
They reasoned that extra-terrestrial intelligence should be common by now. Fermi listened patiently, then asked, simply, “So, where is everybody?” That is, if extra-terrestrial intelligence is common, why haven’t we met any bright aliens yet? This conundrum became known as Fermi’s Paradox.
– Full article
Tags: technology
Earlier this year I mentioned how cool it would be if Netflix would have a feature stating if/when I had a movie sent to me from them before.
Well they’ve got that feature now. Obviously this is a rather derivative idea, so I’m not taking credit at all. I’m just damn happy they’ve got it now.
Tags: news
If you live in Seattle or San Francisco, you can get street level views at http://preview.local.live.com
We had a brainstorm that could help flesh this out. What if you paid people on a per image basis to drive/walk/bike/bus around taking images every 10 seconds or whatever.
Microsoft, what if you paid people 10 cents an image and let the community flesh this thing out for you?
Tags: technology · news
I’ve been bit by this at work recently, and I thought I’d try to figure out what the problem is.
Doing a google on Cut paste broken in Firefox will give you 288,000 results. Seems like there could be a problem there.
I even found a site (can’t find the link now of course) which had some very elaborate steps including going into .js files within your profile directory and modifying values.
Well, I think a simple solution has come about for this. See, I have 2 monitors at work and I have to admit, I only have this problem at work.
A co-worker suggested that maybe it was because I was cut/copying in one monitor and then trying to paste in the other monitor.
Hmm….
So I I drag the window I want to paste to over to the other monitor, and try a Ctrl-V. Nothing. Well ok, let me go try to do a copy again. Ctrl-C -> Ctrl-V and it works!
The even stranger thing, is that I can copy/cut content from the actual webpage being displayed, its only the address bar that doesn’t carry over.
Go figure.
Tags: computer