The Unavoidable Compromise of Business Driven Development

Given enough money, time, experience,  technical experience and creative input, time has shown as an industry we can build awesome things. Unless you’re working on a self-funded project with unlimited supplies of cash and time, it’s unlikely that most of us will ever have the experience of working with minimal or no resource constraints.

Software development in ‘the real world’ is really no different from any other business, and the concept of the Triple Constraint has been well understood in Project Management for some same. This describes the inter-relationship between 3 attributes of:

  • schedule
  • scope
  • cost

and how they interact to affect quality of the final product. At a high level, it’s generally understood that you can have ‘any two’ of these, but it’s impossible to have all three at the same time. Each of these attributes translates to desirable qualities of:

  • fast (deliver the product in less time)
  • good (include all desired features)
  • cheap (deliver at low cost)

So, you can have fast and good but it won’t be cheap, or you can have fast and cheap but it won’t meet all your requirements (some features will have to be left out).

So back to the original topic. How is software development a compromise? Invariably because your client or your company wants all these things: “we want it developed in an impossibly short amount of time (get it ready for tomorrow), we want this massive list of features (and no, we’re not prepared to leave any out), and oh by the way, we only have enough money to pay for 1 developer to work for 8 hours”.

While technology can go some way to helping produce more for less (code generation etc), the reality is that software development in the real world is not a technical problem. It is a business problem of negotiating contracts and managing expectations. For the technologist, this is the continual struggle – pretty much everything you work on will be under less than ideal conditions.

Business Driven Development (BDD). Welcome to the Real World.

(Page views: 17)

What real users are saying about Windows 10

The Control Panel. Yes, the Control Panel. How is it possible for a final, shipped product (8, 8.1, and now 10) to have multiple versions of a single app (the Control Panel) where some options are in one version and other options are in the other? And the UIs of each are completely different.

At least the Control Panel vs Change PC Settings options are now no longer shown together in the same pop open Charms menu as they were in 8.x. I suppose at least in 8.x they put one at the top of the menu and the other at the bottom of the menu, like there was some discussion to keep them far apart because, oh I don’t know, because having two different links to two different Control Panels in the same menu might be confusing to users.

Anyway, so the bizarre charms menu is gone. The Metro Change PC Settings app from 8.1 is replaced with a new app in 10 with some snazzy looking icons. But wait.. the Windows 7 style Control Panel is still in Windows 10? With the the previous Windows 7 UI style? Wait, what? So there’s still 2 different Control Panels in 10? Microsoft please, get your design teams in the same room!

More other bizarre observations and pet peevs in this post over at The Register.

(Page views: 22)

Can’t wait for your Windows 10 upgrade? Download it now.

If you ‘reserved’ your free upgrade to Windows 10 but you haven’t seen anything popup or appear to prompt you to install yet, if you really want to get it installed right now, Lifehacker have a link to the Windows 10 Media Creation tool which you can download and use to do an upgrade of 7 or 8.x to 10 right now.

(Page views: 41)

Windows 10 – is it ready?

Only a day away from Windows 10 starting to rollout on July 29th, and people are wondering whether it’s really ready for release or not, or as The Register puts it, Microsoft are still playing ‘whack-a-mole’ with bugs before the actual release: “A number of nagging bugs have cropped up in the last few days that have some Windows 10 testers scratching their heads at just how an OS this raw can be considered production-ready.”

But if we’re prepared to accept’s Microsoft’s concept of ‘Windows as a Service’, this is all perfectly ok, because you’ll be getting a continual stream of Windows Updates to patch all the issues after the first release is pushed out. I’m not sure how this differs from any other Microsoft release of any prior release of Windows, but ok then, if you say so.

So your release forecast for tomorrow is: extremely buggy, with a very good chance of patches released later in the day.

(Page views: 38)

Configuring rtl_fm and Direwolf for decoding Amateur Radio Packet on the Raspberry Pi

rtl_fm is one of the utilities from the rtl_sdr package for using a TV dongle as an SDR. Head over here if you need more info on this.

Direwolf is a soundcard based packet modem.

According to the Direwolf docs, it supports using rtl_fm as an input, so I thought I would take a look at look at getting these running together.

I’ve used rtl_sdr and rtl_tcp on my Pi before, but not rtl_fm, so first to get this working.

To playback the stream from rtl_fm you need to pipe into into some audio app. This is the same way that direwolf is going to read the stream too. Following the suggestion here on the rtl_sdr page, this command works fine for a local broadcast radio station on 96.9MHz:

rtl_fm -f 96.9M -M wbfm -s 200000 -r 48000 | play -r 48000 -t s16 -L -c 1  -

I’m not sure what all these options are, but the key options seem to be -s for the sample rate, and -r for the resolution. The -r value needs to match on the rtl_fm side and on the play side.

Now to get direwolf installed on Raspbian:

– per the userguide, first install libasound-dev:

sudo apt-get install libasound-dev

– download the source zip from: https://home.comcast.net/~wb2osz/site/?/page/Download/

– unzip and cd into the direwolf folder

– make with:

make -f Makefile.linux

make install-conf

make install_rpi

At this point I have rtl_fm on the Pi working as it should, and direwolf working great when decoding audio input from a 2m radio input via a USB soundcard. Combining the two though is giving me issues.

I don’t thing I’m able to get a strong enough received signal on 2m on the RTL stick even with an external 1/4wave 2m antenna.

This is the combination of commands, rtl_fm, piping into Direwolf:

rtl_fm -f 145048467 -M fm -s 200000 -r 32000 -g 35 | direwolf -n 1 -r 32000 -b 16 -t 0 -

I’ve allowed for the tuning offset ppm on this RTL card, but maybe I’ve calculated this wrong?

Anyway, since Direwolf by itself on the Pi is working well and what I needed for a small packet project was to be able to decode packet on the Pi, I’ll be putting rtl_fm on hold for the time being and playing with Direwolf by itself.

(Page views: 46)

Changing display resolution on Rasbian

Settings such as HDMI video output are configured in the /boot/config.txt file – you can edit this on the Pi with ‘sudo nano /boot/config.txt’. If you need to edit on another machine, see details here.

This page lists available video modes. On my LG E2341 connected by HDMI, uncommenting and changing these two settings works to set the output to 1080p:

hdmi_group=1

hdmi_mode=16

 

 

(Page views: 72)

Setting Raspberry Pi / Raspbian default locale and keyboard settings

Default locale and keyboard settings on the Raspberry Pi can be configured using raspi-config on Rasbian.

Select option 4 Internationalization, and select options to configure your locale, timezone and connected keyboard layout.

If you’ve installed Raspbian and kept the defaults you probably ended up with a UK keyboard layout, and if you have a US keyboard, you’re wondering why some of your keys are producing unexpected characters :-)

(Page views: 460)

MongoDB aggregation queries for ‘counts per day’ (part 1)

I need a MongoDB query to retrieve document counts per day to feed a heatmap display (using https://kamisama.github.io/cal-heatmap/), for my Amateur Radio received signals historical visualization service, SpotViz.

The data to feed Cal-heatmap looks like this:

{
  "946721039":4,
  "946706853":2,
  "946706340":7,
  ...
}

What’s interesting about this data structure is the property name is variable, and I’m not sure how to project a result into a property name in a MongoDB query. I asked this question on StackOverflow: “Return a computed value as field name in MongoDB query?” – so far I haven’t had any answers or suggestions, so I’m not sure this is possible.

There doesn’t seem to be a way to do exactly what I need, so my next challenge was how to group documents per day (ignoring the time part of a date), and return a count per day.

I started with a working Aggregation query from the shell, and then took that and implemented using the MongoDB Java api. The challenge with this query is that there doesn’t seem to be any out of the box feature that allows you to select matching documents based on a date and exclude the time portion of new Date(). What I need is the equivalent of ‘find counts of documents that are grouped by the same day’. The catch is to not group docs by exactly the same yyyy/MM/dd hh:mm:ss values, but to group by only the same yyyy/MM/dd values.

Since there is a way to extract the year, month and day values from a date with the aggregation $year, $month, $dayOfMonth operators, these could be used to get the result I need (the counts per day), but this format doesn’t help me get the property name for the counts in a seconds past 1/1/1970, e.g. “946721039”.

A query using this approach would look like this:


db.Spot.aggregate(
[
  {$match: {spotter: "kk6dct"}},
  {$group: { _id : {
    year:{$year:"$spotReceivedTimestamp"},
    month:{$month:"$spotReceivedTimestamp"},
    day:{$dayOfMonth:"$spotReceivedTimestamp"}
    },
    count:{$sum: 1 }
  }
}
])

… this approach follows a suggestion from this SO post.

This approach to group the document counts by day is good, but it doesn’t return the docs in the format I need with each day represented by seconds since 1/1/1970.

A better approach would be to group by millis for the date, and return that value. Converting a date in mongo to another format however seems to be somewhat challenging – I spent probably far too much time to work out a query to do this, getting close, but still not what I wanted, and ended up with this rather complex query:

db.Spot.aggregate(
[
  {$match: {spotter: "kk6dct"}},
  {$group: { _id : {
    yearval:{$year:"$spotReceivedTimestamp"},
    monthval:{$month:"$spotReceivedTimestamp"},
    dayval:{$dayOfMonth:"$spotReceivedTimestamp"},
    "h" : {
      "$hour" : "$spotReceivedTimestamp"
    },
    "m" : {
      "$minute" : "$spotReceivedTimestamp"
    },
    "s" : {
     "$second" : "$spotReceivedTimestamp"
    },
    "ml" : {
      "$millisecond" : "$spotReceivedTimestamp"
    }
  },
  count:{$sum: 1 }
  }
},

{$project :

  {
    "date" : {
      "$subtract" : [
        "$spotReceivedTimestamp",
        {
          "$add" : [
            "$ml",
              {
                "$multiply" : [
                  "$s",
                  1000
                ]
              },
              {
                "$multiply" : [
                  "$m",
                  60,
                  1000
                ]
              },
              {
                "$multiply" : [
                  "$h",
                  60,
                  60,
                  1000
                ]
              }
            ]
          }
        ]
      }
    }
  }
])

What I was attempting to do with this approach was to use the $project stage to subtract the $hour, $minute and $second values converted to millis from each of the timestamp values to get just the millis value of the yyyy/MM/dd but ignoring the time part. This is about as close as I got, but I couldn’t get the math to work, or at least convert between types so the calculations would work the way I wanted.

My next attempt was based on the suggestion in this SO post. This is a much simpler approach to the problem – my new query looks like this:

db.Spot.aggregate(
[
  {$match: {spotter: "kk6dct"}},
  {"$group": {
    "_id": {
      "$subtract": [
        { "$subtract": [ "$spotReceivedTimestamp", new Date("1970-01-01") ] },
        { "$mod": [
          { "$subtract": [ "$spotReceivedTimestamp", new Date("1970-01-01") ] },
          1000 * 60 * 60 * 24
        ]}
      ]
    },
    count:{$sum: 1 }
    }
  }
])

If I try and break this down into words, then what I’m doing is:

– for date x, calculate millis since 1/1/1970 (the epoch date)

– subtract from this the number of millis since the start of the day (this is the millis since 1/1/1970 mod number of millis in a day, the remainder of one divided by the other)

… the result is the millis of each date at midnight, i.e. excluding the time part.

Ok, almost there! How I then took this query and converted into the MongoDB Java Drvier API is coming in part 2.

(Page views: 85)