Catching Up, Braindump

I’ve been working on a few longish posts, but after taking a week or so off in Costa Rica, I’m now back at work with new deadlines looming and realizing that I won’t be getting around to finishing them anytime soon. Some of them really deserve some more thought anyway, but I did want to at the very least want to do a bit of a braindump.

Anyone following my Twitter feed knows that the NSA surveillance news has had much of my attention since it broke. A month later, I still haven’t quite figured out the proper response, except that in my mind, the leak, our response, and its implications (especially if allowed to continued) is one of the more significant turning points for our society. At least its forced me to consider technological progress through a very different lens. In the meantime, I’ve been keeping what I’m calling a “worry wall” tracking news and developments on the topic. It’s a Hackpad wiki, and I’d welcome contributions: stopspying.hackpad.com

It’s quite possible that there’s no sensible course of action, but it deserves some thinking.

I’ve been somewhat keeping up w/ developments in Turkey and Egypt. This video of a 12yo in Egypt that’s been making its way around is worth a watch:

Doug Englebart died last week. A few years ago, I had the privilege to attend one of his lectures, and while my writeup of the event focused on a critique, it was framed within the large shadow that Engelbart’s seminal works cast. While I did not know him personally, it’d be fair to say that Engelbart’s work and thinking might have been the most influential/impactful not just of my field of computing (the part involving people communicating and thinking together), but also on my own work and thinking, both directly and indirectly.

It’s not every day that one of your intellectual heroes/forebearers passes, and I wish I had something better/more to write about it, but the words escape me.

Like in the Snowden case before it, I saw the AAR 214 crash news break on Twitter. A couple comments related to that caught my eye. On the actual accident itself, The Verge has done a surprisingly good job summarizing.

And that’s it for now… I’ll be headed to YxYY this weekend and while I’m not looking forward to the 100+ degree heat, will be looking forward to catching up with some old friends.

Obama’s Speech at Woodrow Wilson Center

Full transcript here.

This Administration also puts forward a false choice between the liberties we cherish and the security we demand. I will provide our intelligence and law enforcement agencies with the tools they need to track and take out the terrorists without undermining our Constitution and our freedom.

That means no more illegal wire-tapping of American citizens. No more national security letters to spy on citizens who are not suspected of a crime. No more tracking citizens who do nothing more than protest a misguided war. No more ignoring the law when it is inconvenient. That is not who we are. And it is not what is necessary to defeat the terrorists. The FISA court works. The separation of powers works. Our Constitution works. We will again set an example for the world that the law is not subject to the whims of stubborn rulers, and that justice is not arbitrary.

This Administration acts like violating civil liberties is the way to enhance our security. It is not. There are no short-cuts to protecting America, and that is why the fifth part of my strategy is doing the hard and patient work to secure a more resilient homeland.

New Pads for the Cans

While I’m not a full-blown audiophile (I’ve been to way too many concerts, shows, raves, and parties to have any illusions on the state of my hearing), I do enjoy good set of headphones/IEMs. These days I mostly use Audeo PFE 232 IEMs with a Fiio E17 in the office, and an old iBasso D2 Boa and a going-on-five year old pair of Denon AH-D2000s at home.

These Denons actually managed to replace my mighty Sennheiser HD-580s as my go-to – mostly because they were both punchier and more comfy for extended wear. However, recently, the pads had started … disintegrating (grody). I started looking for replacement pads and ended up finding the Lawton Audio Angle Pads. After a couple weeks delay, I finally got them in the mail…

Holy cow, these are fantastic. Really comfy, but most surprising is that the the audio, particularly the soundstage is noticeably better. I’m a happy clam right now, and looking forward to the next 5 years w/ these suckers.

Of course I’m wearing these while I type. Here’s one of the tracks I’ve been grooving to right now… (Buy on Amazon)

Basis Watch Report

Next in my gadget backlog series…

Basis B1 WatchI had preordered a Basis B1 Watch a long while ago and promptly forgotten about it, so it was a bit of a surprise to find one sitting on my desk after SXSW (which has turned into this amazing construct of pure marketing – good for business though, I guess).

Since then, I’ve worn it almost every day (about a month-and-a-half). I figured I’d give a report after living with it for a while since Basis is now apparently starting to sell them for real (after being back-ordered for a while).

While I have had reservations on the watch form-factor after getting a MetaWatch and realizing in the intervening decade since I regularly wore one that I now couldn’t stand wearing watches, I’ve mostly re-adjusted, and the data the Basis collects has been worth overcoming the annoyance factor.

There have been a couple reviews (the Verge one isn’t a bad summary), but here’s the basic rundown of what you need to know:

  • Price is $199. It comes exquisitely packaged in a die/laser-cut box and overall all the industrial and product design is quite nice (package, device, site/app). The watch is less bulky than the typical smart watch and is pretty inconspicuous. The capacitive touch buttons work well and the display is simple but more than adequate.
  • Unlike almost all devices currently on the market (besides the BodyMedia devices), the Basis is a multi-modal sensor device that’s more than just a glorified pedometer. Sensors include:
    • Heart-rate via green LED optical flow-based sensor (I assume using something similar to the TI AFE44xx but sadly, there’s no current support for SpO2 or glucose measurements); An important note is unlike the similarly kitted MIO Alpha, Basis specifically notes that heart rate measurements are not suitable for exercise monitoring
    • Skin Temperature (accurate to the tenth of a degree) – mine seems to be about 92-94 degrees fahrenheit when I’m up and a few degrees lower when I’m asleep
    • Perspiration specified by μS/cm, so it looks like it’s using galvanic response to calculate? The Basis itself seems to be fairly well waterproofed, and I’ve used it in the shower w/o issues (although usually not, because that’s weird, right?)
    • Pedometer and sleep tracking via a 3-axis accelerometer
    • Calories burned are derived from BMR via Oxford equations multiplied against a “physical activity level value” that’s presumably derived from the sensor data collected. Note, if you have a better BMR value (ie, I have an RMR estimate from my lean body mass from my Bod Pod measurements, you can presumably use Table 5.2 to reverse calculate what weight to enter to get more accurate estimates)
  • Battery life is good for a few days (3-5?) and you need to use a custom charger to recharge. This is a bit of a pain actually, especially if you’re traveling – the charger is a plastic band that hasn’t broken yet, but is just begging to be and will soon enough, I’m sure.
  • This charger also syncs data from your device. This is a really important point. While the Basis has Bluetooth (2.1 eww) built-in, it doesn’t work yet and the USB sync is the only way to get your data. Also, there are mobile apps (Android first, then iOS?) on the way, but again, these aren’t available yet. Personally, I wouldn’t recommend this to most end-users until this gets sorted out.

The web interface and the graphs that it gives you is actually quite nice. For me, the actual (almost) dealbreaker wasn’t the lack of wireless/mobile syncing (wireless power and data sync is definitely very high on my list for want-to-haves, personally), but rather that while there’s been the promise of an API/export for quite a while, there’s actually nothing (and no roadmap!) yet.

Paul Miller wrote a great piece on this earlier in the year about this, which I vigorously agree with and I won’t buy or support any self-instrumentation device that doesn’t give me full access to my own fucking biometric data.

Now, if you’ve read the last two paragraphs and are scratching your head on how/why I still have my Basis watch, well, that’s simple: there is an API, it’s just not publicly documented. If you’re an end-user looking for export, yes you are SOL and should send your Basis back and demand a refund if it’s important to you (and it should be!).

If you are a developer, simply pop up your Javascript console and look at the XHR calls to /api/v1 for nicely formatted JSON. Note: these calls are actually totally unauthenticated. That’s bad. However, since the tradeoff is easy access to my data w/ low likelihood of accidental leakage (data URLs have hashed unique identifiers), I’m ok with that for now.

Overall I like my Basis although I have an Amiigo on the way that, if it functions as promised, should be better than the Basis in pretty much every single way (sans telling time/wrist display – but that’s not so necessary anyway w/ a proper mobile app). It’s also half the price. For developers and data geeks, the Amiigo also promises to have a full SDK and actual developer support (although I hope they have their data as nicely formatted as the Basis data – it’s totally sweet).

However, the Basis is well designed, and if you’re absolutely buying something today, the Basis is by far and away the best device for those looking for serious self-instrumentation (ie not Fuel Points). The habit system is also on the right track, as well, in terms of general usefulness. However, as outlined, the B1 is also a seriously unfinished product at the moment and anyone expecting basic fitness-tracking functionality (like a mobile app/wireless syncing) will be disappointed. Early adopter caveats definitely apply.

It’s a pretty interesting time for fitness/activity trackers – I think we’ll soon be reaching a point where the sensor-suite will be more than good enough (as mentioned earlier, photometric glucose measurements and SpO2 should be possible w/ the existing sensor packages, and having wireless charging would be the last really nice bit), and the real value will be integrating with other data to create an integrated picture and assisting in behavioral modification/self-improvement. It’s also interesting seing some of the vertical applications as well. The LIT for example looks pretty neat.

UPDATE: Looks like a QS guy also reviewed the Basis and also spotted the JSON feed, and better yet, published some instructions and some code on Github for people.

UPDATE 2: I have a bunch of notes on wearables and smart watches on a hackpad

UPDATE 3: Current biggest discovered annoyance is that it’s impossible to change the Time Zone w/o going online to set it then syncing. WTF. Does no one at Basis ever fly?

Hacking the Ouya

I’ve made a public Hackpad (I like it and have been using it more and more, although not without reservations) to gather some notes/docs on getting Linux to run on Ouya.

I’m a fan and hope they succeed as an additional channel for indie gaming, but the short of it is that despite some previous claims/hopes, the Ouya is completely hacker unfriendly (bootloader locked, GPL-violating lack of Linux kernel sources, no one at the company answering their emails).

If you’re looking for anything besides playing Android games, you should look elsewhere (there are many alternatives).

So it’s off to the land of misfit gadgets for mine (aka the pile on my workbench) or to gather dust w/ my XBox, but was fun to d/l Gordon’s Beast Boxing Turbo demo and play it on the 70″ screen in the office.

View Ouya Hacking on Hackpad.

Dirty Hack of the Day: Python DNS Edition

In Python, you can set most request timeouts w/ socket.setdefaulttimeout(). In recent versions, urllib2 has also added a timeout field to urllib2.urlopen(). So far so good, right?

Unfortunately, while these work fine when looking up IPs or domains in /etc/hosts, this fails miserable when querying a FQDN as you’re at the mercy of socket.gethostbyname() and your DNS resolver which does not let you adjust the timeout. On my Mac this defaults to 30 seconds. It’ll ruin your day, really. (A good recent thread, old summary)

This is a somewhat common problem and you can see a lot of various workarounds (using signals didn’t work for me). The proper modern way is to probably using multiprocessing with a join(timeout) (sample) but that seemed awfully wordy, so here’s my simple one-line hack that I ended up with instead:

subprocess.check_call(['/sbin/ping','-t','1','FQDN'])

Just set 1 to the timeout you want. It’s hacky, but it works and it’s much easier and shorter – a one liner in a try block without any other libraries. Another advantage this has is that it works as it should both with DNS and mDNS (zeroconf) without any additional lookups. I’m using this for finding local machines so this is quite useful.

Some extra references:

UPDATE:

So, at the end of 2016 I encountered this problem, and decided that I could do better, especially because I wanted to do a sub-second query. I decided that of course the way to go would be to use concurrent.futures, but that was actually wrong, it turns out. When you call whether on the ThreadPoolExecutor or ProcessPoolExecutor version, it still waits for socket.gethostbyname() to finish. Here’s the simplest code that I implemented that worked:

from   multiprocessing import Process, Queue
def dns_lookup(host, q):
  try:
    socket.gethostbyname(host)
    q.put('OK')
  except:
    pass

q = Queue()
p = Process(target=dns_lookup, args=('example.com', q,))
p.start()
time.sleep(0.4)

if q.empty():
  p.terminate()
  print('dns timeout')

Using the multiprocessing library turns out to be the way to go because the terminate() function actually works like you expect it to, killing with extreme prejudice and w/o too much extra code. Hope that helps anyone dealing with the same problem.

Late Night Reading

Transcript of secret meeting between Julian Assange and Google CEO Eric Schmidt

And I wanted there to be more just acts, and fewer unjust acts. And one can sort of say, well what are your philosophical axioms for this? And I say I do not need to consider them. This is simply my temperament. And it is an axiom because it is that way. And so that avoids, then, getting into further unhelpful discussions about why you want to do something. It is enough that I do. So in considering how unjust acts are caused and what tends to promote them and what promotes just acts I saw that human beings are basically invariant. That is that their inclinations and biological temperament haven’t changed much over thousands of years and so therefore the only playing field left is: what do they have? And what do they know? And “have” is something that is fairly hard to influence, so that is what resources do they have at their disposal? And how much energy they can harness, and what are the supplies and so on. But what they know can be affected in a nonlnear way because when one person conveys information to another they can convey on to another and another and so on in a way that nonlinear and so you can affect a lot of people with a small amount of information. And therefore you can change the behaviour of many people with a small amount of information. So the question then arises as to what kinds of information will produce behaviour which is just? And disincentivise behaviour which is unjust?

Thinking about this in context of the events unfolding in Boston, and the crowdsourced attention happening among other things.

Some Notes on Labor, Technology and Economics

I think that we are all aware that advanced capitalism is leading us down a road that as a society, we may not want to travel – constant crisis due to increasingly advanced, complex, and unstable financialization, an increasingly vicious trend toward plutocracy and plutonomy that has obliterated socioeconomic mobility via massively increasing inequality, and of course, as an engine of unsustainability, where environmental, health, and social costs are externalized and reality is subsumed via a twisted economic logic.

All these things really should be teased out into much larger discussions, but a few recently related links/discussions I want to make note of (I’m slowly moving some things back out of Evernote into a way that can be narratized):

  • HN: Confessions of a Job Destroyer – a good essay that highlights what technological “disruption” really means; relevant to software, robotics and all sorts of enabling technologies
  • HN: Unfit for work (npr.org) – NPR is doing a weeklong series on how the disability program is hiding massive collapses in the workforce

Also, this image popped up in my Twitter stream recently…

A quick Google search shows that it’s been floating around for at least a year, and the bottom text references an organization that ceased to exist in 1982 so it is probably quite old, but still resonates as much (if not more) today. Here’s the text transcribed (via)

If you’re unemployed it’s not because there isn’t any work

Just look around: A housing shortage, crime, pollution; we need better schools and parks. Whatever our needs, they all require work. And as long as we have unsatisfied needs, there’s work to be done.

So ask yourself, what kind of world has work but no jobs. It’s a world where work is not related to satisfying our needs, a world where work is only related to satisfying the profit needs of business.

This country was not built by the huge corporations or government bureaucracies. It was built by people who work. And, it is working people who should control the work to be done. Yet, as long as employment is tied to somebody else’s profits, the work won’t get done.

The New American Movement (NAM)

Searching for this led to this interesting article: