The content of this blog is my personal opinion only. Although I am an employee - currently of Nvidia, in the past of other companies such as Iagination Technologies, MIPS, Intellectual Ventures, Intel, AMD, Motorola, and Gould - I reveal this only so that the reader may account for any possible bias I may have towards my employer's products. The statements I make here in no way represent my employer's position, nor am I authorized to speak on behalf of my employer. In fact, this posting may not even represent my personal opinion, since occasionally I play devil's advocate.

See http://docs.google.com/View?id=dcxddbtr_23cg5thdfj for photo credits.

Friday, March 09, 2018

Idea?: symlinks to reorganized content marked, aged, and deprecated

I am reorganizing a number of my directory trees (actually, moving Windows "stuff" out of a Cygwin repo to make it easier to use when I have not installed Cygwin).

As I am doing this, I am (often) leaving symlinks in the old location pointing to the new.

The problem with such symlinks is that the filesystem never gets clean.  Not until you actually delete the symlinks.  But then you may not be able to find old references.

Version control .... yeah, but who wants to go through VC logs.

IDEA:  mark such "legacy symlinks".  Hide them by default.   When code tries to follow such a symlink, return an error - but a special error, that a suitable UI could provide meaningful info about.

Something like HTTP status codes

  • 3xx Redirection
    • 301 Moved Permanently
    • 308 Permanent Redirect
But we can do better:

Instead of returning an error and expecting the user to understand, we might allow the user to set configuration options that 
  • ? automatically follow such redirects ?
    • with a verbose warning
    • only if valid as of time T
    • only if not conflicting with current redefinitions of the name.

Essentially providing some sort of version control functionality.

And encouraging true cleanups, while still keeping the "find out where it went functionality".

Thursday, December 21, 2017

WISH: Exception Coalescing Operator/Expressions, like Null Coalescing


I might like exception coalescing expressions and operators, e.g.

result := expression1 ?if-exception expression2 ?if-exception expression3 ... 
result := expression1 ?if-exception(EXCEPTION_TYPE x) x 
along the lines of null-coalescing operators like Perl // or C# ??


I very much like the null coalescing operators, like Perl's //

$a = $b // 'value if b is null/undef';
I suspect that I would also like the Elvis operator ?: if I could get away with using it (i.e. if I felt that my coworkers would not crucify me for using non-standard C), and various safe-traversal operators like ?. ?[] etc.

Today, writing some unit test code, I wanted to do simple exception handling, and I think that I realized that I might like to have an exception coalescing operator, or, more generally, try-catch style exception handling as an expression rather than a statement.

I wanted to do 

result := f(input) or "error" if an exception was thrown
which usually looks like

try {
     result := f(input);
     assert( result == expected );
} catch( ... ) {
     assert( 'according to whether exception is expected or not' );
possibly testing for particular exceptions.

Of course, I (or the test framework) usually have functions like

test_assert_equals( f(input), expected_value )

test_expect_exception( f(input), expected_exception )

f := if_not_exception( f(input), 'exception_value' ).
but that can be quite clumsy.  And, in non-test cases, you may want to chain

f := if(_not_exception( g( if_not_exception( f(input), 'exception_value' )), "exception2")
In general function(args) can be clumsy compared to prefix_fn(args).suffix_fn.suffix_fn2.

In this particular case, I think that I would like an exception coalescing operator

result := expression1 ?if-exception expression2
equivalent to

declare result
try {
     result := expression1;
} catch( ... ) {
     result := expression2;
return result
and chainable

result := expression1 ?if-exception expression2 ?if-exception expression3 ...
If we wanted to specify exactly what exception is caught

result := expression1 ?if-exception(EXCEPTION_TYPE x) x 
(although this raises the possibility of multifix vs infix binary)

Q: what should the operator be?   While I could live with ?if-exception - especially if in my oft-desired XML-based-programming-language-syntax - many folks would prefer something expressible as ASCII.  I would suggest ??, except that C# already uses that for null coalescing equivalent to Perl //.


But if we can't have a nice set of hard to remember symbols, how about traditional try/catch as an expression?

result := try{ expression1 } catch(...)  {expression2 }
This happens a lot - similarity between expressions and statements.  In LISP everything is an expression. Python gets much of its readability by having a stricter boundary between expressions and statements. And debuggability - accidentally making something into an expression when it should be a statement can be hard to find.

Perhaps there should be expressions corresponding to all statements - bit with a minor syntactic indication.

'via Blog this'

Sunday, December 17, 2017

Veggies for Breakfast - Henry’s PDX

VfB score: 90% (Veggies for Breakfast)

Many vegetable omelets have a lot of egg and not so much vegetable.

Not here!

This vegetable omelet has a hearty egg wrapper wrapped around a healthy serving if vegetables - a large amount of green and other sweet peppers, plus some onion and spinach.

Tasty even without hot sauce.


VfB - Vegetables for Breakfast - my search for healthy food, protein and vegetables - for the most of important meal of the day.

Friday, December 01, 2017

2FA watch app please! not phone

Duo Mobile: Duo Security:

'via Blog this'

My new employer uses Duo's push two factor authentication.  This is good...

But oh my gosh do I wish that this 2FA app was a watch app and not a phone app!  I am coming to hate having to go find my phone...  For some reason I need to do this much more often than in my personal 2FA usage - probably because I spend more time at work on my PC than banking, etc.  And Gmail and LastPass 2FA persists across (some) reboots.

If my employer's 2FA was time based, I suppose that I could clone the TOTP to run on both my phone and my watch. Although I never trusted the TOTP implementation for my Pebble SmartWatch - I never trusted that the Pebble had good enough security, both inside the watch, and in the synched-ed to phone app.

MORAL: SmartWatches need good security.

I would hope that the Apple Watch has good security.  That's a large part of the reason I switched from Android to iPhone.  Now if only the Apple Watch had decent battery life, I would gladly switch.  Being able to use my watch as 2FA would almost be enough to justify paying for cell phone connectivity for the watch independent without going through the phone.

In my dreams, the smart watch would carry the SIM card, and
temporarily delegate it to whatever more battery endowed device it was close
to. Like phone, or tablet, or laptop.  The smart watch could/should be the
most secure device – more physically secure, or at least less likely to be left
behind. Passwords by clicking buttons or tapping. Potentially endowed with
biometrics like fingerprint, and heartrate continuous monitoring – redo slow
authentication when taken off.

Will NNs
for pleasant authentication – fingerprint, face, voice – fit in the SmartWatch
form factor and battery profile?  I am willing to relegate training to a
synched to SmartPhone app; I would prefer NOT to let biometric authentication
live in the cloud, although it is probably too late.  All of our faces are
belong to Google, and Facebook, and ….

Amusing idea;  passwords as a sequence of silly facial
expressions.  NNs to recognize you tapping your favorite song on the
phone.  Conscious control of heartrate or body temperature or galvanic
skin response for authentication. Perhaps this will be the route to direct neural interfaces, the incremental step that provides partial value.


My Apple watch owning friends are happy to rub it in that they have a watch app for Duo 2FA..

As are some of my Android Wear friends - except they say that too many clicks are required on the watch app, so they often pick up the phone.

For the Record, I am currently wearing a FitBit Blaze not-really-smart watch.  Mainly as a Fitness Tracker, and that mainly because of FitBit's social fitness challenges with my friends. I was very disappointed to realize that the Blaze provides transient calendar notifications, but does not actually store my calendar on the watch.   Although FitBit bought Pebble, it doesn't yet support Pebble-style watch apps.

Sunday, November 05, 2017

OneNote [[links]] not quite as good as wiki

How to Master Microsoft Office OneNote: "Automatically create new pages, linked together in a master list: If you’re working on a project that you know will require several pages of notes, here’s a killer shortcut: Type two square left brackets followed by the title of the first note you want to make and then type two right square brackets at the end. OneNote will instantly create a new note with that title and a link to it in your current note. " 
'via Blog this'

I am glad that OneNote accepts  the double square bracket syntax to create links to pages that do not exist yet - a syntax that is common in wikis.

It is unfortunate, however, that OneNote automatically creates the page as soon as the [[link]] is typed - rather than when dereferenced, as wikis do.  Doing it wiki-style allows you to search for pages that you want but which have not been created yet - whereas doing it OneNote style results in a lot of empty pages.

Thursday, September 28, 2017

Standalone smartwatch without smartphone: working out, including swimming

I just revived my fitness club membership, which I had let lapse. It reminded me of one reason why I want to be able to use a smartwatch without a smartphone nearby - one reason why I will probably buy an iPhone X, or at least the new Fitbit Ionic, in the next year: workouts.

I like going to the club and listening to podcasts while doing a variety of exercises. On elliptical and rowing machine a smartwatch slaved to a smartphone isn’t so bad, although it would be nice not to have to carry the phone around. But swimming makes having a waterproof smartwatch independent of the smartphone much more desirable. Locking phone away in a locker while swimming risks theft, while wearing phone in pool in a waterproof bag while swimming, quite literally, drags. Whereas a waterproof smartwatch by itself means that all I need to place in a locker are my shirt, shoes, and towel. Which I am much less afraid of getting stolen.

The main feature I want for exercise is the ability to play podcasts. Both the iPhone X and the Fitbit Ionic can store audio, music, on the watch, connecting to a new Bluetooth headset. The IPhone X almost certainly has better podcast players.

I was about to say “Unfortunately, Bluetooth doesn’t work well in a pool. So I may fall back to using my old waterproof iPod Nano with earplugs - and hence not need the smartwatch to play the podcasts”.  But there are quite a few Waterproof Bluetooth earbuds for swimmers, so that may not be an issue.

=> stand-alone smartwatch with music/podcast playing to Bluetooth waterproof earbuds while doing workouts including swimming. That will be what makes me buy an iPhone X or Fitbit Ionic.

If I can get the “Gentle Wake” app from my old Pebble Classic, all the better.

Exercise and alarm clock: two things smartphones have never been good enough at to make me happy.

Friday, September 01, 2017

Amtrak - Experience - Onboard - Journey with Wi-Fi

Amtrak - Experience - Onboard - Journey with Wi-Fi: "Amtrak offers free basic Wi-Fi service"
I enjoyed using wifi on train from Portland OR to Seattle yesterday. Got much work done.

Unfortunately, on the return trip today the wifi was ... bad.  Intermittent. Slow.  Frustrating.

(Furthermore, as I have noticed before, my Microsoft Surface Book has a habit of crashing when wifi is intermittent.)


Both trains were full.  Yesterday's left Portland circa 3pm.  Today's left Seattle circa 6pm.