Category Archives: Computers

Fitbit Dashboard.  Jes continues to kick my ass.

Fitbit Charge HR review

Since my Fitbit Force was recalled earlier this year, I’d been pining for a simple motivational aid.  Microsoft’s Band looks awesome, but it’s sold out as soon as they get another batch of units.  The Garmin VivoSmart had some interesting features, but lacks stair climbs (important to me because I do so much of that in a given day) and was at the upper end of my price range.  (They weren’t discounting it for CyberThanksGivingBlackShoppingHolidayWeek, either.)  Fitbit, meanwhile, has been such a tease, but finally wanted to take my money in exchange for Fitbit Charge HR.  I’ve used it for two weeks.

I was a little nervous about the heart rate sensor needing to be super snug against my arm.  I’m happy to say that it doesn’t need to be.  If you’re used to wearing a watch, you won’t notice the difference.  If you don’t wear a watch, like me, you’ll fiddle with it a few times a day.

Fitbit Charge HR on my very hairy arm.
Clearly, my day job as a data scientist doesn’t involve a lot of physical exertion.

The heart rate sensor uses two green LEDs that need to be “close enough” to the skin to do their thing. When you take it off for charging, or if there is some kind of malfunction, the LEDs will power down.  If you bump it at night, you may get an eyeful of blinking green LED.  Reason: the Fitbit is designed to record your heart rate all day.   The pretty HR graph is available on the Fitbit web site, but not the phone application.

stairway
The web page shows the full day’s heart rate. My peak represents powering up Pike Place Market, on the way to the bus stop.

I’ve found the HR sensor works best if the watchband is two to three finger-widths from the end of my wrist. The heart rate reading seems believable. The “resting heart rate” setting should record after one wakes up, but is still lying in bed. Unfortunately, it seems to wait until I’m up and out, reading a little higher than expected. I’m sure they’ll get this kink worked out.

The Fitbit web site sorta kinda integrates with other apps and products. For example, I use MyFitnessPal to record my dietary intake because its food list is very good and EveryMove for additional motivation.  The “sorta kinda” is FitBit records my caloric intake, but not the things I ate.

Fitbit Dashboard.  Jes continues to kick my ass.
Fitbit Dashboard. Goals complete, yet Jes continues to kick my ass.

A huge plus over the Force and the Charge (non-HR) is the band has a real clasp. The little nub on the prior model was prone to coming undone when anything tugged against the band or if the nub wasn’t thoroughly pushed through.  In my first week of The Force, I nearly lost it twice.

Another really nice improvement is the sleep recording is automatic. Previously with the Force, I’d have to remember to set the timer before going to bed and unset it when I get up. Needless to say, I often didn’t. Now, it’s more of a wear and forget device, which is precisely what I wanted.

Nightly sleep measurement.
Nightly sleep measurement.  Is 92% efficient good?

Battery life seems to be on the order of 5-6 days of normal use, where normal use is “Use the vibrate to wake up Monday-Friday” (it is really nice you can set multiple alarms on different days) plus walking and occasionally hitting 10k steps. Because the cord is proprietary and apparently incompatible with every other model of Fitbit, I have been charging it roughly every fourth day.

No wonder I was feeling really awful at work Monday
No wonder I was feeling really awful at work Monday

So, overall, I’m pleased with the device. It’s also had the desired effect of getting me to the indirect route through Seattle’s stair district in an effort to boost my stats for the day.

Do they speak English on Code 80242009?

Windows Update

Another, big batch (27) of security patches landed on my Windows 7 desktop. Since I’m likely to be running long, data-intensive jobs, I have it not apply them right away. Sensing this large group would necessitate a reboot, I avoided installation until lunch time today. The philosophy is simple: computing should not be about constantly applying software patches.  One of those Windows update failed. I rebooted and tried again. Same result:

Why? Because Code 80242009, that’s (expletive) why.  Don’t bother clicking “Get Help” because it won’t help at all.  In fact, it’s almost a guaranteed waste of time and dipoles.

Borrowing a scene from Pulp Fiction, this is kind of how I’m feeling at the uninformative error message:


Do they speak English on Code 80242009?

Clearly this error code has some meaning to the programmer who tests for that condition; it’s unfortunate they cannot use an informative error message like “Microsoft’s update site is borked; ignore this until we fix it next Tuesday.”

GoogleSoftwareUp clearing CS_VALID and Mac Freezes

PSA: In case someone else encounters similar symptoms where your MacBook freezes and the only indication is an error GoogleSoftwareUp clearing CS_VALID, I hope to save you a wasted evening of trying things and reading forums…

Symptom: My heretofore reliable MacBook started going into “beach ball” mode.  The active application remained responsive to keyboard, mouse and screen input but only until as long as it accessed things in memory.   Eventually, it, too, hung.  The only recourse was a hard power-down.  After rebooting, the problem occured again in about an hour.

<tl;dr>If your system is using a Crucial M4 SSD, you probably should update its firmware.</tl;dr>

One of the most helpful diagnostic steps in these situations is asking oneself “What recently changed?”  Earlier in the afternoon, I had been fiddling with my /etc/hosts file to do a more thorough job of blocking ads, web beacons, and the like (using this).  I don’t normally look at the output of Utilities → Console, but when I did , I found what I would dub “a metric buttload” of diagnostics. This one caught my attention:

A metric buttload of diagnostics.

Complete red herring #1: My first thought was I had munged something in the hosts file that was causing this program to continuously restart itself, killing the system.  Secondary thoughts include: “why is postfix running on my laptop” (answer: because I have the developer tools running and was hoping to find a solution more reliable than Cozi that my better half won’t complain about) and “this is a really useless error message.”  Undoing the /etc/hosts changes is really easy.  However, since I don’t really need MacOS Server, I uninstalled it. Another crash ensued, the same diagnostic was observed. Dumbass didn’t reboot?

As I was getting ready to head out with family, the beach ball returned.  A different message preceded this one:

CODE SIGNING: cs_invalid_page GoogleSoftwareUp clearing CS_VALID
If a warning were logged to a file and nobody was around to read it, would it still matter?

I power-cycled. At this point, I realized my full disk backup is just slightly less old than my tolerance for complete system annihilation without a backup.  I made hot-backups of important files onto another hard disk as it would really suck to lose these.  Upon coming back from dinner…

CODE SIGNING: cs_invalid_page GoogleSoftwareUp clearing CS_VALID
GoogleSoftwareUp, it appears your hand is in the “crash cookie jar”

The machine crashed about an hour after powered-up.

Complete red herring #2: Googling for error messages and visiting almost any site or forum that not part of the StackOverflow family is a waste of time.  The term GoogleSoftwareUp returned a lot of useless shit, including messages that Google Software Update was retired in 2008, there was a Google Chrome bug that crashed Macs because of some (GPU problem, memory leak, “toxins” in the diet, orbital mind-control lasers employed by the Koch brothers) and so on. As a safety measure, I removed the Google hegemony of applications: Chrome, Picasa, Drive, and Earth.  That worked… not at all.

.. along with the otherwise benign Printer Pro Desktop task, used to print from my iPad
The definition of insanity is repeating the same thing and expecting different results…

The real problem: a bug in Crucial m4 SSD drives’ firmware that causes the drives to lock up.  The symptom manifests itself after 5,184 hours of drive use (mine was ~5,400).  Once it starts, it recurs approximately every hour after powering on.  Crucial’s firmware update version 040H on December 4th, 2012 seems to finally remedy this problem as well as a few others created by previous firmware updates.   Installation steps are briefly:

  1. Unzip the download
  2. Burn the ISO to a bootable drive (CD, DVD, memory stick) using the Disk Utility tool.
  3. Power cycle the Mac, holding the “C” (or appropriate) key to boot from the external device.
  4. After experiencing some nostalgia at the state of computing when I was in college, answer yes to applying the revision 040H prompt.
  5. Reboot and update your system backup, crisis joyously averted.

The GoogleSoftwareUp message originates from Google Software Updater, a package surreptitiously installed with most (all?) of the Google applications on the Mac, e.g., not just Chrome, but also Google Earth, Picasa, Drive, Music Manager.  According to The Google, it should be running only once per day.

I should note that I don’t normally check my console logs, you know, for fun, so it seems plausible it’s been erring out for some time.  The only way to get rid of it is to remove all Google applications (including Music Manager, which is the odd duck of the bunch as its indicator resides in System Preferneces).  Next, run the Google Software Updater Uninstaller instructions.   Should you subsequently install any of the Google apps, the updater will reappear and resume its error logging.  Setting the run interval to “0” doesn’t seem to affect the error logging.  Fortunately, it doesn’t seem to be doing any harm, beyond annoying.

 

Dolphin Kick

When I first heard someone mention the term dolphin kick, I thought it was a reference to the 1980s Patrick Duffy show, Man from Atlantis. The BBC says the dolphin kick “replaces a standard underwater leg kick with a whipping motion that minimizes water resistance.”[1] It’s a little easier to make sense of this if you watch the video. Suffice to say, if it’s done correctly, as has been used by Michael Phelps[3,5], it confers an advantage to the swimmer.

Mesh
Example of meshing[6]. There is a
cut plane through the face showing
pressure contours.

Researchers[2] at George Washington University’s Fluid Simulations and Analysis Group (FSAG) have worked to understand the underlying physics of the underwater segment. According to Dr. Mittal, the goal of their project “is to understand what makes swimmers like Phelps and Coughlin such great dolphin kickers, both of them get a significant advantage during the dolphin kick phase,” says Mittal. “They usually come out of the water about half a body length or more ahead of the competition. We’re trying to understand the fluid dynamics behind this.”[6]

In one of their earlier publications[4], they mentioned they combined laser scans of Gabrielle Rose and Lenny Krayzelburg as input for simulations. In these, they come up with a mesh representation of the swimmer, develop a computational fluid dynamics (CFD) model of the water flow.

To create animations, the meshes were matched “frame-by-frame” to videos of Natalie Coughlin and Michael Phelps, respectively, doing dolphin kicks. Each dolphin kick was divided into 32 segments[6], each segment had 2000 interpolated frames. Static and dynamic simulations were run on FSAG’s linux clusters.

An example frame is represented by the mesh on the top left. Each mesh is composed of approximately 30,000 triangles. In areas where there is a lot of movement, smaller triangles (“refined mesh”) are used.

Post-processing is done on the simulation results to visualize the analysis. For example, the topmost picture shows a frame from Gabrielle Rose. The colored contours represent vorticity magnitude (red is high). Here is an animated example of the vortices. There are other interesting examples on the ICS site [4].

Swimmer
Model of Gabrielle Rose; contours indicate relative vorticity magnitude[6]

Sources:

 

Dates

I’ve been researching date/time formats for inclusion in a software product, and wanted to share some of the thought processes involved.Use case: an engineer or scientist wants to plot something over some time period. All time periods are possible, so we must provide years down to minutes. For example, a coastal engineer surveyed said he:

“visualizes the results of the global wave prediction models we run. I am typically dealing with long term (20 – 40 year) datasets of hourly to sub-hourly model data.”

Another scientist[1] samples temperature readings in and around geysers located in Yellowstone national park. Samples are typically taken at intervals ranging from 15 seconds up to 30 minutes (though 30-seconds is typical). He might look at data over a period of months, then want to zoom in on smaller areas for particular areas of interest. For example, here are some sample views of Congress Pool, Yellowstone National Park, taken from October 5 – 18, 2005[1]:

October 5 – 12 24-hour period, October 10, 2005 0:00 – 0:15, October 10,2005

Storage: This was perhaps the easiest thing to determine. Representing dates as text strings is problematic because we deal with tens of millions of data points. Converting to and back would make the files larger, be prone to round-off error, and would introduce a lot of problems with supporting different input formats. Madness!
We borrowed from Microsoft Excel, which stores date/time values as a floating point number. The integer is the number of days since December 31, 1899. The decimal is the fraction of a day. For example:

Date/Time representation FP value Note
Not defined 0.0 Not defined
1 January 1900 00:00:00 1.0 Midnight!
1 January 1900 01:00:00 1.041667 One hour
1 January 1900 00:01:00 1.00069444 One minute
1 January 1900 00:00:01 1.000011574 One second
1 January 2008 11:00:00 39448.45833 Polar Bear Plunge!
23 February 2008 12:34:45 39501.52413 As I type this

There are a couple of instances where someone might want to look at data from prior to 1900, so we allow negative integers. However, we’re only allowing back to 1800 because the Gregorian calendar has some quirks, especially in 1752.

Calendar systems: Gregorian. Seriously. We decided early on that we would not support other calendar systems[4] — like the more accurate Iranian calendar[3] or the artistic French Republican Calendar[5] — until there was a sufficient business case. If someone wants to wave a bunch of Rial or Euro at us, we will reconsider. (Except the US Treasury prevents us from transacting business with Iran, so it’s unlikely.)

Printed values: Now the hard part, what representations to use for dates? For example, consider how most people in the U.S. write dates. “02/24/08” typically means “24 February 2008.” In Europe, this would be abbreviated as “24/02/08.” This isn’t so bad, because there’s obviously no “month 24.” However, if you write 02/08/08, you might be referring to either February 8th or August 2nd. Entirely different seasons demand entirely different wardrobes!

The official standard, ISO 8601 [6], standardizes the ordering in a rational way. Thus, our default suggested format is ISO 8601-happy yyyy-mm-dd hh:mm:ss, or 2008-02-23 12:34:45. However, we leave the determination up to the user. We think with millions of points of data, they’ll use a more compact format. 🙂


Sources:

 

Notes from SC10

King Neptune
King Neptune, outside Mardis Gras Land

A few weeks ago, I spent a week in New Orleans at Supercomputing 2010.  (Sometimes my job has perks.)   I wrote a really long summary of this for internal use, but thought I’d share some of my notes:

Jack Dongarra of Oak Ridge National Labs offered his perspective on HPC (High-Performance Computing), past and future.

  • 1988 – first GigaFLOP (one billion floating point operations per second) machine, Cray Y-MP, 8 processors, used to solve static finite element cases.  For comparison, the Nintendo Wii I purchased last year is supposed to have up to 61 GigaFLOPs of processing power.  Its games are a lot more fun than the ones on the Cray Y-MP.
  • 1998 – first TeraFLOP machine, Cray T3E, 1480 processors, used to simulate magnetism.  Sony claims the Playstation 3 has a Teraflop of computing power.
  • 2008 – first PetaFLOP machine, Cray XT (“Jaguar”), 150,000 processors, used to model atoms in a super conductor.  (Interestingly, the IBM RoadRunner is also claiming it’s the first for hybrid computers.)  A PetaFLOP is roughly 10x the estimated parallel processing power of the human brain, after a cup of coffee.   Here is a time-lapse of the Jaguar being assembled, after a cup of coffee:
  • 2018 – first ExaFLOP machine is expected. He anticipates it will have 10^7 (10 million) processors and effectively 10^9 (one billion) threads.  With it, you’ll be able to see perspiration working its way down individual hair follicles of players in Madden 2030.  (Why you would want to do this, I have no idea… but you can.)

Areas for more graduate student research:

1) New algorithms. This was also echoed by Steve Wallach (CEO of Convey Computers), the plenary speaker.   For supercomputing, it’s a great research project.  For commercial products, we’ve had more effective results from putting an application in a performance analyzer and identifying bottlenecks: unnecessary serialization, putting too much/too little on the heap, doing too much work up front.   There are a lot of psychological tricks one can do in applications that give the perception of faster that we could still tap into.
2) Effective use of multi-core and hybrid architectures.   Many of the Top 500  are hybrid architectures where CPUs (general purpose, can interface with I/O) ferret tasks onto (massively parallel) GPUs.  These are notoriously difficult to program.  The Parallel Computing 101 tutorial lead bristled every time someone asked about these computers.
3) Mixed-precision in algorithms. Single precision calculations are 2x faster on CPUs, 10x faster on GPUs.  A coworker and I had discussed this separately, hypothesizing we might benefit from variable precision – to avoid using double precision when single precision plus a couple of bits for accuracy would do fine.
4) Self-adaptive/auto-tuning software.  (This reminds me of a question John Bennett asked us in COMP 425: “How many of you have ever written self-modifying programs?”  (hands go up)   “How many intended to do this?”)
5) Fault-tolerant algorithms.  This is the obvious fifth bullet, as systems achieve their scalability by throwing more hardware at problems.  Unfortunately, the more components you have also begets a the higher statistical likelihood of a failure.  In one of the sessions, I heard they expect some component failure to occur as often as once a day.   He didn’t elaborate on what ideas there are.

 

Jean Baptiste I know I parked the car here last night.

 

I thought it was amusing he had a slide on the typical breakout of time for building supercomputers as:

  • 20% what to build
  • 80% building it
  • 0% understanding its effectiveness to make changes for the next supercomputer

I think he left out:  25% write new grant proposals.

One of my favorite pet topics was how metrics can be abused and selectively chosen to make anything look good.  (Well, duh, that’s the basis for marketing, right?):

  • FLOPS/s (floating point operations per second) – not useful for comparing among machines and applications because there’s an incentive to undo optimizations of the compiler to get “credit” for work that’s unnecessary.
  • Efficiency – artificially inflated and biased towards slower systems.  One could make a supercomputer by stringing together a bunch of iPhone/Androids.  It would be *very* power efficient, but take thousands of years to finish a weather model.
  • Speedup is only a characteristic; Amdahl’s law is a model for the relationship between the expected speedup of parallelized implementations of an algorithm relative to the serial algorithm, under the assumption that the problem size remains the same.  They cited Amdahl’s law + Murphy’s law: if a system component can damage performance, it will
  • Application scaling – comes in two forms, weak scaling (how the solution time varies with the number of processors for a fixed problem size per processor) and strong scaling (how the solution time varies with the number of processors for a fixed total problem size).  Pitfalls include having an unrealistic problem size.

Recommendations include:

  • Focus on first-order effects: there is no need to know performance of each transistor.
  • Split modeling effort: work on single processor execution time, then processor count, topology, network, etc.  In other words, get it working on one processor first.  Or, as we say in real world product delivery: get it working correctly first, then optimize.
Tomb of Marie Laveau
Marie Laveau‘s tomb

When not enjoying the arguments between the CUDA acolytes and the OpenCL disciples (“Every time a programmer uses CUDA, [deity] smites a kitten”), I spent a lot of time walking around the French Quarter, clearing out every geocache I could. There are some pretty areas and unexpected finds, like this mini-park under a busy road:

Margaret of New Orleans
Margaret of New Orleans

The best geocache in the city was View Carre’. I went into the building and asked the front desk security guard if they could “take me to the geocache.” The cache owner, Team Bamboozle, is the chief engineer, but had gone home a few minutes before my visit. However, another engineer, Shawn, took me up to the top floor, then to the secret engineering elevator to the 32nd floor maintenance room. It was a pretty easy find:

View Carre (GCE02C) - huge cache!
This is soooo not an urban microcache

After signing the log and dropping a travel bug, we went up on the roof where he gave me a visual tour of the city. Outstanding! View from View Carre (GCE02C) I Le Pavillion