eub: (quiz)
[personal profile] eub
Well, I took some pictures of the cherry tree blooming out front, and had fun with Photoshop.
flowers crop median min crop
spray sky rot crop dodge sharpen

I really don't know what I'm going to do for a job. Trying to persuade people that they don't really need me to have five years of full-lifecycle industry experience doesn't seem to be working.

I spent my whole coding day tracking down a timing problem that turned out to stem from a boneheaded error in doing arithmetic. Here's a quiz for your job applicants: given two pairs of uint32 values, (start_hi, start_lo) and (stop_hi, stop_lo), compute the 64-bit difference (stop - start).



Possible answer #1: something like
diff_lo = stop_lo - start_lo; // wraparound still gives correct lo.
diff_hi = stop_hi - start_hi;
diff = (((uint64) diff_hi) << 32) | diff_lo;
Diagnosis: too dumb.

Possible answer #2: something like
diff_lo = stop_lo - start_lo; // wraparound still gives correct lo.
diff_hi = stop_hi - start_hi - !!(start_lo > stop_lo); // borrow?
diff = (((uint64) diff_hi) << 32) | diff_lo;
Diagnosis: too damn clever.

Possible answer #3: something like
start = (((uint64) start_hi) << 32) | start_lo;
stop = (((uint64) stop_hi) << 32) | stop_lo;
diff = stop - start;
Diagnosis: might be okay.



But we had very good sushi at Ototo. (For better or for worse, they were out of this intriguing-sounding green tea tiramisu.)

Profile

Eli

April 2017

S M T W T F S
      1
23 45 678
9101112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 27th, 2026 11:29 pm
Powered by Dreamwidth Studios