Posts

Dealing with task overload

All of us get to a point where our boss (*) gives us more work than we can handle.   With more work than we can handle one of three types of conversations will occur: Type Time Conversation B : too Busy When task assigned I’ve got too much on my plate, what can we take off to make this fit? F: I Failed/We're F@#$'d When task becomes a failure I couldn’t get this done, now we’re screwed what would you like to do. Q : I Quit When burned out I haven’t seen my family in weeks, my fish died of starvation - I quit! Even if you're not yet in task overload think very hard about which conversation your boss would rather have.   If your boss would rather conversation F or Q, you need to find a new job(+). I'll assume after doing the previous mental exercise you're not out looking for work, so let's ponder how to have conversation B. Clearly your boss didn't give you a task because she was bored, she needed the work done.  Bring your boss your current ...

Do you have a problem?

Recently I became a developer lead.  In case your company uses different titles, a developer lead is a software developer who has software developers reporting to her. Since I became a lead, I've realized the different roles in an organization see the world differently. The table summarizes how different roles see a problem. Role Says Thinks Developer We have a Problem F@!#$ one more thing to fix, how am I going to get this done Lead We have a challenge Something isn’t the way we want, we’ll get it fixed Manager (Lead of Leads) We have an opportunity My competent teams will solve this. Director Of Development (Lead Of Managers) We have a functioning team You think that's a problem? Ha ha, you'll fix it. You should see what i have to fix. I'm not sure if this is brilliant, or just funny. Maybe it'll become the career choice acid test :)

AlgoRhyme

Today, I had lunch with the mother of the internet . Among other things she told me her poem that accompanied the spanning tree protocol . Perhaps if a poem was required for each algorithom and protocol submission,  computer science would be simple and clear. With great pleasure I reproduce Radia's poem: AlgoRhyme I think that I shall never see a graph more lovely than a tree. A tree whose crucial property is loop-free connectivity. A tree that must be sure to span so packet can reach every LAN. First, the root must be selected. By ID, it is elected. Least-cost paths from root are traced. In the tree, these paths are placed. A mesh is made by folks like me, then bridges find a spanning tree. Radia Perlman

F# and the immediate window

(This post is inspired from t his Stack Overflow question ) F# debugger integration is quite good, except for the immediate window. The immediate window requires C# style syntax, so calling F# functions is not intuitive. Below are recipes for the immediate window integrated into a console application. As always code can be found here : // Learn how to use the immediate window for F#. module Program= // To build, add a reference to Microsoft.CSharp. This is required for dynamic support in // the debugger. let allowDynamicToWorkFromImmediateWindowByLoadingCSharpBinders = Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags.BinaryOperationLogical let plusOne = (+)1 let xPlusOnes = [1;2;3] |> Seq.map plusOne [ ] let main (args) = printfn "Try the following in the immediate window: // plusOne 4 ((dynamic)plusOne).Invoke(4) // Seq.Head xPlusOnes Microsoft.FSharp.Collections.SeqModule.Head(xPlusOnes) // let xPlusTwos= xP...

Using WinDBG/CDB and SOS to find a thread given a ManagedThreadId

CDB and SOS have more power than most people realize, I’ll use this post to show some some handy cdb/sos tricks while at the same answering the simple question of which thread a ManagedThreadId maps to. At the end of this post you’ll be able to: Map a ManagedThreadId to the correct thread ordinal Use CDB to convert from decimal to hex Pipe CDB commands through pipeline commands like findstr Full source for the simple app below can be found here . In the below app we want to figure which thread we’re running on so we can inspect the stack. internal class Program { private static void SleepForever() { Thread.Sleep(Int32.MaxValue); } static void Main(string[] args) { const int countThreadsToStart = 20; foreach (var unused in Enumerable.Range(0, countThreadsToStart)) { // Instantiate thread that prints and stores its ManagedThreadId. new Thread(() => {...

Use Paint.Net to Highlight key areas in an image to get your point across

Image
(Since posting this I've also become very fond of  Jing , which is the tool I use when taking screen shots) Earlier , I mentioned how important communication is to software engineering. A key tool in communication is being able to highlight portions of images.  For this task I use some basic features of Paint.Net .  In the below image I want to draw your attention to the name of the dress, and the name of the color of the dress. Without these highlighted regions, it's likely your eye wouldn't have picked up the points I wanted you to see. To perform these highlights in Paint.Net do the following: Copy image into Paint.Net Select the ellipse tool Specify Fill Options as Draw shape with outline Set Secondary color(the fill color) to yellow Set transparency to 50 % Draw ellipse

Cool Tools: Paint.Net

Paint.Net is a nice compromise between advanced picture editing software, and picture editing software usable by humans. The biggest problem I had with paint.net is figuring out how to download it. In what I assume is an attempt to make advertising dollars, this website exists that make it impossible to download Paint.net without accidentally downloading crap.  Here's a direct paint.net download link . Update here are my usages of Paint.Net: Highlighting portions of an image  Other you'd like to see

Leading by praise: How to use a carrot when you really want a stick.

Many naive leaders believe they have two ways to enact change in their followers.  The first way is "the carrot" aka praising good behavior. The second way is "the stick"  aka criticizing bad behavior.  In my experience, the stick is extremely ineffective. I'd say the only time the stick has any positive impact is when the follower doesn't realize she's doing something wrong, or how serious that wrong thing is.   The goal of this post is how to use a carrot when you want a stick.  First lets recall how to use a carrot effectively in general: Keep it timely, short, specific and often (the one minute manager is my hero).  Any time you see a new good behavior praise it.  When you praise,  be as specific as possible so the follower knows both the behavior you are praising and the valuable impact of that behavior.  It's easy to praise when things go well, but how do we praise when things are going poorly? When things a...

Google killed the video store

As a younger man I remember arguing with a co-worker about the death of local storage.  Me: Who wants to store data themselves?  I can store all data in the cloud, where it will be preserved forever! Wiser co-worker: What incentive does this cloud have to keep your data? I'll keep my data on my local hard drive thank you very much!   8 years later my co-worker was  correct. I got the following letter from Google today: Later this month, hosted video content on Google Video will no longer be available for playback. <snip> We’ve added a Download button to the video status page, so you can download any video content you want to save. If you don’t want to download your content, you don’t need to do anything. (The Download feature will be disabled after May 13, 2011) Ouch for being wrong,  and double ouch for having to download all my videos to my hard drive. Notes: Astute readers will note, I actually got a decent deal since I got 8 years of free s...

Software Engineering “The Soft Skills”

To date, I've focused my blog on the "computer" parts of software engineering. However, as I've grown as a software engineer, one of my largest aha moments is the realization that software engineering is all about people. As such, I'll start posting articles dealing not just with computers, but also with communication, people leadership and management. These "people skills" are as important to a software engineer as the ability to crank out a design specification. For the hardcore among you that think people skills have nothing to do with software, consider this .

Powershell script to enable windows to capture localhost traffic in wireshark

If you want to understand why the following scripts work read this post . Otherwise just paste the following into an elevated powershell window: Setup windows networking to allow localhost capturing in wireshark: # Find the network configuration that has the default gateway. $defaultAdapter = Get-WMIObject Win32_NetworkAdapterConfiguration | ? {$_.DefaultIPGateway} if (@($defaultAdapter).Length -ne 1) {throw "You don't have 1 default gateway, your network configuration is not supported" } # Route local IP address via the default gateway route add $defaultAdapter.IPAddress[0] $defaultAdapter.DefaultIPGateway Write-Host "Start capturing on localhost by connecting to $($defaultAdapter.IPAddress[0])" Return windows networking to normal configuration: # Find the network configuration that has the default gateway. $defaultAdapter = Get-WMIObject Win32_NetworkAdapterConfiguration | ? {$_.DefaultIPGateway} if (@($defaultAdapter).Length -ne 1) {throw "Y...

How did we get a 53 byte packet size in ATM?

I'll be honest, I don't know squat about ATM, but I was having lunch with this fellow , and he told me the story of the 53 byte ATM packet.  You can find more details on Wikipedia , but here’s the synopsis: (Disclaimer: I’m not an expert in ATM; nor am I trying to teach you technical details about ATM networks; so I’ll hand wave and trade off accuracy for simplicity. For example, ATM does have variable sized packets which it divides into cells, and it is the cells which are 53 bytes long. However, since the closest thing to a cell in common networks is an Ethernet packet, I’ll simply refer to cells as packets.) ATM is designed to be shared between data network applications, and voice network applications(+). In data networks we want large packets because this gives maximum efficiency.  This is because each packet has a fixed size header and thus the more data you can transmit per packet , the higher your ‘real’ throughput. For voice networks we want to reduce latency...

The cloud lets you evaluate the cost of performance optimizations

One of the things I love about cloud computing is you can put an honest price on computing time.  You can than balance the human engineering time required to optimize code (and often have more complex code) vs just paying for the cloud to do it.  The Zillow rent estimate post speaks to this brilliantly: We implemented the Rent Zestimation process as a software application taking input from Zillow databases and producing an output table with about 100 million rows. We deploy this software application into a production environment using Amazon Web Services (AWS) cloud .  The total time to complete a run is four hours using four of Amazon EC2 instances of Extra-Large-High-CPU type .  This type of machine costs $1.16/hr.  Thus, it costs us about $19 to produce 100 million Rent Zestimates which is the same as a 3-D movie ticket or about 5 gallons of gasoline in New York City today. A few things to note about this quote: If your data processing can be done...

Supply, demand and the trackball market.

The author of this blog is a devout trackball man, and as any devout trackball man can tell you, it has been trying times for trackball users in the last few years. You see trackballs were never really in style, and no one has made a new trackball for a while.  It's so bad out there that one of my favorite trackballs now sells used for over 200$ and new for 600$ . Crazier than that you can send away to get your trackball reconditioned on ebay, for a whopping 100 $, where they'll clean it and put on a new cord. Thankfully, there has been movement in the trackball market. Logitech released a new wireless trackball !!! So far I love the tiny USB receiver (which fits in the trackball when not in use). I wish the trackball was larger, but after several months of use, I can say it's a perfectly reasonable device. ps. If you're curious, here's the history of the trackball .

The 3 A's of security when buying a coffee

Image
The three A's of security are  authorization, authentication and auditing.  While these A's apply to computer security they are also present in most transactions.  For example, lets look at what happens when Igor wants to buy a coffee: When Igor goes to buy a coffee with his credit card, the cashier starts by asking Igor for a Picture ID, then the cashier swipes Igor's card (which dials the head office to make sure there is money), finally a receipt is printed. After all that Igor gets his coffee. Let's look at the 3 A's in this transaction Authentication - Prove the entity is the entity -  Ensure Igor is Igor by making sure the picture on his drivers license matches his face. Authorization - Prove an entity is allowed to do something - Ensure Igor is allowed to place a 5$ charge on his credit card. Auditing - Record what has occurred - Write down that a coffee was purchased. Authentication, Authorization, and Auditing in the coffee shop

Why do I keep getting exception code e0434352?

If you want to know how to debug CLR exceptions using cdb then read this post . Exception code e0434352 is the exception code used internally by the CLR to represent most exceptions(*). Regardless of if you throw a System.NullReferenceException or a System.ArgumentException in C#, you'll throw a SEH exception e0434352 under the covers. A fun way to validate this theory is to watch what happens to the CLR exceptions settings in cdb. Fire up cdb, and see the state of clr exceptions: 0:000> .shell -ci "sx" findstr clr clr - CLR exception - second-chance break - not handled clrn - CLR notification exception - break - handled .shell: Process exited Now, set the exception handler for exception number e0434352 and recheck the value of the clr exception handler: 0:000> sxe e0434352 0:000> .shell -ci "sx" findstr clr clr - CLR exception - break - not handled clrn - CLR notification exception - break - handled .shell: Process exited Armed with ...

Using NUnit to explore static field initialization

Given the following code: class Constants { public static readonly Constants Instance = new Constants(); public static readonly string ApplicationName = "ig2600"; public readonly string CachedClassName; public Constants() { CachedClassName = GetQualifiedClassName("Constants"); } public static string GetQualifiedClassName(string className) { return string.Format("{0}::{1}", ApplicationName, className); } } Which of the below tests pass? [TestFixture] public class TestConstants { [TestFixture] public class TestConstants { [Test] public void TestOne() { Assert.That(Constants.Instance.CachedClassName, Is.EqualTo("ig2600::Constants")); } [Test] public void TestTwo() { Assert.That(Constants.Instance.CachedClassName, Is.EqualTo("::Constants")); } } } Not sure? Download the code with...

SSDs rock - but not for the reasons you think

I bit the bullet and picked up an SSD. It's expensive, but it had some surprising benefits. The normally quoted benefit is speed - which I really don't notice. Most operations went from some annoying amount of time, to some other annoying amount of time. I did notice two things: 1) Silence:  I'm so used to hearing my laptop harddrive I couldn't figure out what I was missing - there is no more annoying grindings; clicking or whirring. 2) Coolness: SSD's run cooler - which means less spinning fan, which means more silence UPDATE: The most valuable thing about the SSD is the harddrive doesn't die when I drop the laptop, if you don't have an SSD in your laptop it's totally worth it! (Update: A short,  highly entertaining talk about SSDs - mostly for servers here )

Delayed Push Notification Service for Windows Phone

Image
This is a multi part blog post the other posts in this series are: Overview – you’re reading this now. The push notification service – how to implement the delayed push notification service The client library – not yet written. In this post I discuss push notifications, and share my web service which implements a delayed push notification. Push notifications are a web service that MS provides that can send a message to the phone. There are 3 flavors of push notifications: Raw notification: Raw bytes - ignored if your app isn't running, sent to your app if it's running.  Tile notification: Manipulate application tile, worth it's own blog post.  Toast notifications: If your app isn't running pop up a toast giving a message to the user.  An interesting detail about the push notification web service is how the web service is addressed, and how the phone is identified. I'd expected something like this: But instead you get the more elegant: // doesn't wor...

The Scunthorpe problem

I ran across an obscure reference to Scunthorpe problem and had to investigate what this “problem” is.  It turns out Scunthorpe is a town in England, as are the following towns which share the same problem: Penistone , Lightwater . No idea? Perhaps this interview question will make it clear: Design a simple system that can determine if a user name is obscene.