free hit counter

Thursday, February 19, 2015

Lenovo has truly jumped the shark

I had lots of complaints about my Thinkpad W530, and I swore that it was a sign Lenovo had started to go they way of every other crappy PC maker out there.  In fact, I've been holding off buying a new primary development machine for at least a year now because I don't want to go through the pains of finding something new or being disappointed further by Lenovo.

However, this Superfish security nightmare proves that they've really jumped the shark and this will officially be my last Lenovo machine.

Tuesday, January 13, 2015

What Every C Programmer Should Know About Undefined Behavior #1/3

And I always thought this was a clever trick:

It is undefined behavior to cast an int* to a float* and dereference itLLVM Project Blog: What Every C Programmer Should Know About Undefined Behavior #1/3

I guess the little extra effort to create a union is worth it.

Monday, October 21, 2013

The Four Hundred Sixty Five Million Dollar Software Bug

I love the story of a really good bug, and this one is a $465M whopper:
"While processing 212 small retail orders that Knight had received from its customers,
SMARS routed millions of orders into the market over a 45-minute period, and obtained over 4
million executions in 154 stocks for more than 397 million shares. By the time that Knight
stopped sending the orders, Knight had assumed a net long position in 80 stocks of approximately
$3.5 billion and a net short position in 74 stocks of approximately $3.15 billion" 


Wednesday, April 24, 2013

Leveraging Existing Sensor Drivers in Embedded Linux

Here are the slides from my talk "Leveraging Existing Sensor Drivers in Embedded Linux" at Design West.

Thursday, April 18, 2013

speaking at Design West 2013

I'll be speaking at Design West next week with a talk entitled

"Leveraging Existing Sensor Drivers in Embedded Linux"

The proliferation of sensors in Android devices has greatly increased the availability of sensor drivers available for Linux. This is a boon to embedded systems developers who want to take advantage of sensors, but the lack of sensor driver interface standards and documentation can make them daunting to use.

The good news is that most sensor drivers utilize the Linux Input Event framework or the Linux IIO framework user mode APIs. Once you become familiar with the APIs for these frameworks you will be able to integrate many sensors into your system.

Through demos and code examples this session will walk you through the command line utilities and user mode APIs to debug if sensors are working, connect them directly to user mode code, or bridge into higher level frameworks such as Android.

Monday, February 18, 2013

"Sent from my windows phone"

So I've been using a Nokia Lumina 920 since Christmas as my primary mobile phone.  That's a lot to say.  Like Woz, I think it's got a beautiful user interface - but more than that, it's a *useful* interface.

One my biggest complaints is that they made the "Sent from my windows phone" signature difficult to turn off.  This helpful blog post explains how you can only turn it off through the email app's mail settings and not through the global settings for mail where I had been looking.

My other predictable complaint: lack of quality apps. I didn't use or download many apps.  But I didn't realize how much I relied on the few I used: Flight Tracker Pro and the NPR News topping the list.

Wednesday, November 21, 2012

ssh-agent script for git on windows

For the past week I've been back in Windows to do some embedded development and I couldn't stand having to type in my passwords when for contacting git repos and updating submodules.

MySysGit doesn't come with ssh-copy-id, but this script I found at works every bit as well.

Then to get an agent to keep those keys available there's this little script somewhat hidden in a github help page:

I call it from my .profile and it works like a charm, asking for my key's passphrase just once when I launch my first mingw shell.


# start the ssh-agent
function start_agent {
    echo "Initializing new SSH agent..."
    # spawn ssh-agent
    ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV"
    echo succeeded
    chmod 600 "$SSH_ENV"
    . "$SSH_ENV" > /dev/null

# test for identities
function test_identities {
    # test whether standard identities have been added to the agent already
    ssh-add -l | grep "The agent has no identities" > /dev/null
    if [ $? -eq 0 ]; then
        # $SSH_AUTH_SOCK broken so we start a new proper agent
        if [ $? -eq 2 ];then

# check for running ssh-agent with proper $SSH_AGENT_PID
if [ -n "$SSH_AGENT_PID" ]; then
    ps -ef | grep "$SSH_AGENT_PID" | grep ssh-agent > /dev/null
    if [ $? -eq 0 ]; then
# if $SSH_AGENT_PID is not properly set, we might be able to load one from
    if [ -f "$SSH_ENV" ]; then
  . "$SSH_ENV" > /dev/null
    ps -ef | grep "$SSH_AGENT_PID" | grep ssh-agent > /dev/null
    if [ $? -eq 0 ]; then