HNHacker News
TopNewBestAskShowJobs

cyanoacry

935 karma · joined October 16, 2012

an electrical engineer with a love of anime, headphones, and programming.

Caltech, Dabney House. Currently CTO of Esperto Medical (a medtech startup), focusing on blood pressure measurement.

Formerly SpaceX, Boeing Satellite Systems, and Phase Four. So far, I've somehow I landed 3 spaceships without incident... :) (I was reentry Mission Director for CRS-10, 11, and 12)

http://wsyntax.com

submissionscomments
cyanoacry··on Commercial GPS Turns 25: How Unwanted Military Tech Found Its True Calling
GPS comes in two flavors, SPS (standard positioning service, your standard civilian positioning) and PPS (precise positioning service, for the military).

The SPS specification[1] says you should expect 95% of reported locations to be within a 9m diameter circle (ref 3.8.3). Realistically, though, you can get much better, and a lot of receivers get within 2-3m.

Up until about 2000, there was thil thing called Selective Availability[2] (aka SA). This limited civilian performance to much worse (95% ~20-30m) by some clock dithering techniques. During-SA and post SA accuracies are very different.

In order to support airplanes using GPS for precision landing, the FAA rolled out WAAS[3], which is a wide-area augmentation system that broadcasting atmospheric correction data (specialized just for the US; there are other national systems). GPS+WAAS gets you to within a meter or so. [3]

If absolute position isn't important, but relative position is (say, if you're measuring the movement of two tectonic plates relative to each other at a fault), there's this neat thing called RTK. This gets you relative positions (in the field) on the order of millimeters[4].

[1] http://www.gps.gov/technical/ps/2008-SPS-performance-standar...

[2] http://en.wikipedia.org/wiki/Error_analysis_for_the_Global_P...

[3] http://www.navipedia.net/index.php/WAAS_Performances

[4] http://hemispheregnss.com/DesktopModules/EasyDNNNews/Documen...

cyanoacry··on Home Built Laser Projector (2004)
Yeah, English isn't his first language, but I thought it was super informational all the while. Original Japanese here: http://elm-chan.org/works/vlp/report.html
cyanoacry··on Ask HN: What is the most difficult tech/dev challenge you ever solved?
I made a bunch of LCD nametags for a project a while back[1], and ran into the strangest issue. Occasionally, the display would fail to start up and would display an all-blue screen.

My initial hunch was that it was a timing issue, and that I was seeing different behavior based on temperature. Even when I made things super slow to exclude timing, the performance was inconsistent. Next on the list was excluding race conditions (maybe I'm not resetting in the right order, and getting lucky?)

At some point in time, it was 8am after an all nighter after I'd been debugging this, and I hadn't been able to reproduce the bug. Lo and behold, when I give up, the problem starts occuring, just as I open the blinds to get some sun.

Turns out that the display driver had light sensitivity issues. Since it was a cheap display[2], the backside of the driver IC was exposed (the epoxy fill didn't encaspulate it all the way, just the edges; you can see it as the white strip in the Digi-Key picture).

Putting a piece of tape over the IC solved the issue, and I didn't run into problems with the display again.

[1] PCB (business card sized): https://bitbucket.org/cyanoacry/ditch_day/src/3bf75f6bd2fba1...

Hardware picture: http://www.albertgural.com/blog/caltech-ditch-day-2013/image...

[2] http://www.digikey.com/product-detail/en/COG-C144MVGI-08/153...

cyanoacry··on Japan's Plan for Centimeter-Resolution GPS
In this case, Japan's move makes sense. The satellites are placed into an orbit so that they can be seen high in the sky, which is impossible to do for all locations on the earth.

At some point, you need to break up the augmentation systems on a continent/country-wide basis so that you can optimize the satellite orbits to work for you, instead of against you.

Additionally, QZSS seems to be pretty similar to WAAS. I get the feeling it's probably the same sort of system (though I haven't taken a look), so it's likely easy to implement from a GPS chip perspective.

cyanoacry··on Japan's Plan for Centimeter-Resolution GPS
A really big problem with satellite technology are the harsh environments they go through. You're dealing with something like 10-20g's of vibration peak-to-peak on ascent, and then you subject it to the freezing colds and searing heat of space, all while doing this in vacuum.

Since those clocks need to be super precise, it's easier to have an accurate reference on the ground where everything's not getting shaken and baked to bits.

cyanoacry··on Dudley Buck's Forgotten Cryotron Computer
Wow, that's neat! Has any of this technology made it out of the lab?

It feels like the main limit to mass production of this technology (if people wanted it) is the cryogenics system involved. What other barriers (other than lack of demand) are there to, say, placing a superconducting device in a mass-market product?

cyanoacry··on Dudley Buck's Forgotten Cryotron Computer
This is absolutely fascinating. I didn't realize that today's nanofab labs used technology that was available in the 1950's (e-beam lithography is pretty common, with a second contender for nano-scale structures being FIB[1] milling).

The article's amazing for being a look into a future that could've been. A number of physics tools that are around now depend on microscale cryogenics, but they're still fairly rare (like SQUIDs[2]).

[1] http://en.wikipedia.org/wiki/Focused_ion_beam [2] http://en.wikipedia.org/wiki/SQUID

cyanoacry··on Detecting duplicate images with Python
This is a bad approach for a couple reasons: 1) The total measurable space/information over a resized icon-size greyscale image is pretty small, so you run into a much higher likelyhood of collisions/false positives.

2) It's not too hard to program a Haar wavelet[1] transform[2] (basically iterative scaled thesholding). This has worked well over at IQDB[3], where they do reverse image lookups on databases of over several million images via a modified Haar wavelet.

You can't beat this algorithm for simplicity, though. Have you guys done any false positive checks with this algorithm? The saving grace might be that icons are fairly small and limited in detail/color.

[1] http://en.wikipedia.org/wiki/Haar_wavelet

[2] http://stackoverflow.com/questions/1034900/near-duplicate-im...

[3] http://iqdb.org/

cyanoacry··on Ask HN: Where do you find interesting papers to read?
If you're just starting reading academic papers, I highly suggest delving into background and seminal papers in the field first, because the terminology in contemporary papers is usually pretty precise and depends on already knowing the field. Typically my workflow looks like:

  1. Pick a field.
  2. Look on Wikipedia, get a feel for history and seminal papers. Also
     cross-reference any summary papers that you might see in ACM/Nature/Science.
  3. Flip through a textbook on the topic and see if you can start grokking the
     terms. The useful textbooks will probably name more fundamental research
     that will serve as good reading.
  4. Start digging back in sources. You'll start seeing familiar names pop up,
     these are usually the seminal authors in the field, or people who write
     really good summary papers.

     If you google the topic, and all the papers you find reference "x et al"
     in their abstract, you probably want to find that paper. 

  5. Read from back to front. Skip a little in the middle if pressed for time.
  6. Now you can read papers on Nature/arXiv/Google and be well-prepared for the
     terminology.
I like to study synchrotrons and particle accelerators in my spare time, so I looked at Wikipedia to find out about the history of the field[1]. This lead me to Courant and Snyder's landmark paper[2] about the basis of strong focusing (how to keep all those particles in a thin ring without gigantic, building-sized magnets). Through some Googling and helpful advice I found a free textbook about accelerators[3], which lead me to the granddaddy of papers, M. Sand's summary of basically everything accelerator related [4].

I think the above approach should work for any field, but the openness of the field will vary a lot. Physics and math typically have large collections of PDFs online, but I'm not sure how good CS or bioengineering is in that regard.

[1] http://en.wikipedia.org/wiki/Synchrotron

[2] http://ab-abp-rlc.web.cern.ch/ab-abp-rlc/AP-literature/Coura...

[3] http://www.fieldp.com/cpa.html

[4] http://slac.stanford.edu/pubs/slacreports/reports02/slac-r-1...

edit: formatting

cyanoacry··on Nuclear fusion milestone passed at US lab
This is definitely true, and the BBC totally omitted these facts. The official NIF announcement[1] tried a little bit to cover their tracks. They posted some flashy numbers about the total energy output from neutrons, but nestled in the bottom of the page is the total energy dumped into the entire system:

1.7 megajoules.

In comparison, the fusion power produced was a paltry 8 kilojoules, which they compare to the "energy required to form the plasma".

For this technology to be actually effective, there needs to be a multiplier of several thousand. As other commenters have mentioned, this is mostly just nuclear weapons development.

[1] http://www.physicstoday.org/daily_edition/politics_and_polic...

cyanoacry··on Poking holes in the "Gravity" trailer with NASA's help
I saw the movie yesterday, and I really don't think it's fair to blame the movie producers for their inaccuracies. The premise is real[1], and much of the rest of the movie is constructed by taking the minimal liberties necessary to make the movie work. If the premise of the movie happened in real life, it'd be a 5 minute movie with no survivors, which is no fun, right?

[1] http://en.wikipedia.org/wiki/Kessler_syndrome

cyanoacry··on Why hardware development is hard: Verilog is weird
VHDL generics and generate work nicely for 1d cases, but for 2d cases (systolic arrays), it's difficult to make the scripting really work without hard-coding a bunch of corner cases.

Another example is that defining barrel shifters is impossible to parameterize, because you need to hardcode the mux cases (see the Xilinx datasheet[1]). That's kind of insane, considering that bit-shifting is a very common and basic operation. This is particularly problematic if you're trying to describe something without having to resort to platform-specific instantiation blocks.

It's a little frustrating that VHDL doesn't have a higher-level standard instantiation library, because you're chained to a platform the moment you start doing anything other than basic flip-flops.

[1] http://www.xilinx.com/support/sw_manuals/2_1i/download/xsisy... (pg 51)

cyanoacry··on Why hardware development is hard: Verilog is weird
By far, most of my time spent in FPGA dev so far has been envisioning the state machines and timing details involved. I use VHDL, so it's never been a question of "how can I make VHDL output what I want?"---for me, it's always the struggle of "why can't I just ask VHDL to make n of these units?", where n is some upstream provided number.

I think the author might need to step away and look at it from the other side: how can we take a working, but overly-verbose language like VHDL and make it more powerful? At least VHDL was envisioned from the beginning as a hardware description language, and it definitely shows.

cyanoacry··on Our Newfound Fear of Risk
I recently started a job in the aerospace industry, and it's still taking me a little bit of time to get used to the concept of risk, simply because it:

  1) is rarely addressed in education (nowhere in sciences nor humanitites)
  2) is an extremely "scary" word
  3) is difficult to visualize.
The combination of all three of these factors means that people don't realize that risk is an everyday thing: there are probabilities and outcomes that you need to weigh in order to make the decisions properly. Risk management is big if you're managing multi-million dollar contracts or huge rockets, but it seems to never filter down into the common psyche, which is disturbing. Humans have successfully managed risk to fly planes and go into space, so we have the models to make these decisions, yet we don't seem to be able to properly apply it on the ground.

Is the solution more education? I think so, but in a different light: people need to accept that bad things happen, and that you can model the probabilities and work out for yourself what tradeoffs you're making. Rarely is it all good and bad, and by estimating the expected value, you get the opportunity to say "no, this costs too much" in response to all-out "safety" measures.

cyanoacry··on MIT student applies predictive modeling to improve emergency-room wait times
I'm a little suspicious of how much of this is press-piece fluff, given that they make the assertion that his algorithm reduces times by 40 minutes, which is 10%. This means that the average waiting time is 400 minutes, or over 6 hours.

While I've seen one report[1] that claims this, data from recent sources[2,3] give me median/mean times of around 50-180 minutes, which is much more reasonable.

Does anybody know which is right, and if there's a real paper that lists these findings? I'd be very surprised, as other commenters have noted, if such optimization work wasn't being done already.

[1] http://www.cnn.com/2011/HEALTH/01/13/emergency.room.ep/index...

[2] http://www.medicare.gov/hospitalcompare/Data/emergency-wait-...

[3] http://www.cdc.gov/nchs/data/databriefs/db102.htm

cyanoacry··on Reasons to avoid code comments
The best comments are surrounded by pertinent code. I don't think I've seen a workflow yet that allows you to attach specific portions of commit messages to specific code passages, so it's a little difficult to ensure that what you're saying is clear.

It's also not guaranteed to stay with the lifetime of the file. This is often a problem if you're downstream; if you just download the source code, it's a lot of steps to go back and get to the source repo and look at all the commit messages.

Additionally, the commit log will be only be a log of deltas, and doesn't give you a picture of what's finally there. With well-written comments, you should get a good idea since they're kept up to date (I hope!) and present a unified picture of what's going on.

cyanoacry··on Reasons to avoid code comments
I used to hold the same opinion, that code should be expressive, so we shouldn't need comments. However, I've found this to be false for a number of reasons:

1) Proper comments allow you to explain the reasoning behind the code, not just what the code does.

Excellent examples of this sort of commenting include ZFS's code[1] and Linux's SLAB memory manager[2].

This is important because a lot of the time, there are minutae that are extremely important to get right, but it's not immediately obvious why you did it that way. For instance, maybe there is a special reason fine-grained locking was implemented a certain way, perhaps there is a reason this method of IPC was chosen, etc. A lot of thought goes into properly architectured code, and without comments, future contributors have no idea why this works.

System architecture details become particularly important when you delve into more difficult problems. For instance, I've seen the following snippet of VHDL code:

  process(clock)
    if(rising_edge(clock)) then
      delayed_signal <= signal;
    end if
  end process
This piece of code delays the signal by one clock cycle, but a lot of time in poorly documented code, there's no explanation why! Maybe there's another signal that needed to be synchronized with this one, so you need another clock cycle. Maybe this signal needed to be re-synchronized into the clock domain and one DFF does the trick. Without appropriate commenting, you'll never know the true purpose of this code, so if you change something around it, there's a higher likelihood that everything will break.

2) Proper comments also explain what isn't there: the things that have failed, and why you probably shouldn't try them again.

The OP mentions that sometimes you spend a lot of time optimizing a block of code, only to find out that it doesn't come out better in the long run. Why isn't it commented? By commenting "oh, we tried this other topology, it didn't end up being right for this scenario because of reasons x, y, and z", you can save a lot of grief for somebody down the road.

You might say that the source history should show this, but how often do you look at previous commits when coding? I find that most people ignore the tree until it's time to merge, and even if previous attempts are documented, their reason for removal is often abbreviated in the commit message: "wasn't fast enough"/"didn't work as expected".

You can see the result of this on a large scale, if you take a look at the file-drawer effect[3]. If you dump a huge amount of time/money into projects, and then don't let other people know what happened because it didn't turn out well, people are likely to repeat the same mistakes you made.

3) Proper comments make it easier.

I'll admit it: I'm lazy. If I don't write the comments that specify points 1/2 immediately, as I'm refactoring the code, I'll lose my train of thought. Even if I manage to get away and dump the ideas in another file, they probably won't be as clear as if I wrote it right then and there, with the source code to reinforce my arguments.

The time to context-switch between writing code and writing documentation should be as small as possible, so I'm a big fan of systems like Haddock[4] which allow you to write code and documentation and parse-out the docs into HTML for later browsing.

Ultimately, the code and your comments serve as knowledge for the future, so don't let your time go to waste: document what you did, why you did it, and why maybe other things didn't didn't work.

[1] https://github.com/illumos/illumos-gate/blob/master/usr/src/...

[2] http://lxr.free-electrons.com/source/mm/slab.c

[3] http://skepdic.com/filedrawer.html

[4] http://www.haskell.org/haddock/

Example of great Haddock docs: http://hackage.haskell.org/packages/archive/snap/0.12.0/doc/...

edit: formatting

cyanoacry··on Why Snowden Asked Visitors in Hong Kong to Refrigerate Their Phones
An anti-static bag (even the metallized type) probably won't be the best idea. Faraday cages depend on the conductivity of the outer shield to exclude electric fields from the inside, but anti-static bags aren't very conductive (100k-10G ohm square resistivity[1]).

You might even be better off wrapping the phone in aluminium foil, but the problem is then going to be ensuring that all seams in the "cage" are actually conductive.

[1]http://www.esdjournal.com/techpapr/ryne/esdbags.htm

cyanoacry··on School experiment finds cress won’t germinate near router (Danish)
I find this pretty unlikely, for the same reason that nanobots have difficulty communicating: it's hard to make an antenna at those size scales that can receive a signal, much less contribute to chemical-level energy changes.

At the point where the wavelength of the EM radiation is small enough to get detected by DNA-scale antennas, it's probably already classified as ionizing radiation.

cyanoacry··on All American Airlines Flights Grounded, Experiencing Nationwide Computer Outage
A similarly described SABRE outage in 1989 seems to have caused minimum trouble, because they had the real capability to work off-line with paper:

http://www.nytimes.com/1989/05/13/us/computer-chaos-for-air-...

> Apparently, no information about reservations and other travel plans was lost, and American said there were no serious disruptions of its 2,300 daily flights.

cyanoacry··on If the Earth were 100 pixels wide
I think the best thing to do would be to provide periodic asteroids or rocks that go across the screen every now and then---it's very difficult to get a sense of speed with a repeating star field, not even including the fact that this wouldn't happen in the first place.

Since the starfield was periodic, it looked to me as if it were staying still or moving backwards at times (the wagon-wheel effect[1]) :(

[1] http://en.wikipedia.org/wiki/Wagon-wheel_effect

cyanoacry··on No, ZFS really doesn't need an fsck tool
I've had to deal with one scenario where ZFS fsck would have been very useful, though it comes up rarely: corruption leading to valid checksums, but bad ZFS data.

In my case[1], our setup died due to some power problems, and somehow, NULL pointers got written to disk with valid checksums. Normally this wouldn't happen, but when it does, it's a PITA to debug because trying to traverse/read the disk gives a kernel fault, instead of a segfault as you might see in a user-level fsck program. This was a real pain, as we had encrypted disks, and every reboot meant going through the disk attach steps (enter password, etc etc), every time.

As a result, a userspace implementation of scrubbing would be useful since in this sort of rare instance, I'd be able to probe the fsck process with a good debugger and see why it's crashing. Since it's in userspace, the fsck program can also quit more sanely, with a full report on where it found the corruption. I was able to get my data back via some ad-hoc patches, but it was an... interesting experience having to debug in kernel vs in userspace.

zdb isn't a substitute for most of these things as the on-disk compression and RAIDZ sharding makes it difficult to actually see the raw data structures. Max Bruning wrote a post a while back with an on-disk data walkthrough[2], where he wrote some patches to fix this, but they haven't made their way upstream yet. Additionally, FreeBSD and Linux don't have mdb. :(

[1] http://lists.freebsd.org/pipermail/freebsd-fs/2012-November/...

[2] http://mbruning.blogspot.com/2009/12/zfs-raidz-data-walk.htm...

edit: formatting

cyanoacry··on Smart Guy Productivity Pitfalls
This is definitely true, but I've been hard-pressed to find a similar environment in the States, even in labs and hackathons. There's an almost oppressive social pressure to getting the job done in Japan, because you _must_ work as hard as your boss, who is working as hard as their boss, etc.

A lot of people fight back against the sort of no-frills culture I saw (Google perks, work-at-home attitudes, etc.), so it surprised me that it was so efficient. A part of me expected cubicles and quiet work environments to force an Office Space result.

cyanoacry··on Smart Guy Productivity Pitfalls
Last summer, I finished a 3-month internship in Japan, and it was the most productive 3 months of my life.

I'm currently a college student, so my work ethic is a little poor. Procrastination and "seeming busy" is standard fare for my day. It's far too easy for me to get distracted by checking Facebook, Twitter, or even tangential data sheets.

Yet, despite my bad habits, the environment at my job forced me to get down and churn through code. Some of my officemates could fit the salaryman stereotype[1], but all of them posessed a capability for relentless focus. I initially tried to settle in by "shooting the breeze" and making smalltalk, but they seemed to prefer communicating through their work: some code, but more importantly, well-done demos.

In the span of those 3 months, while I always brought headphones with me, I never ended up using them: the silence of the office carried a note of tension, the sound of concentration. Listening to this proved to make me more productive than I'd normally be, if I were listening to (even quiet) music.

I came in expecting to be maybe 20% efficient, as the OP mentions: a few minutes here, a half hour there. At the end, it was nearer to 75-80%: instead of procrastinating, I set goals for myself to get things done, because that was really the best way to get through to my neighbors.

While I don't think that this sort of pressure cooker environment is well-suited for all people, I think it speaks volumes to how positive peer pressure, in more ways than one, can force people to shape up. I'm not sure I would've survived for a 6 months or a year, but it very quickly eliminated my excuses. If everyone around you is working their best, it's hard not to get dragged along.

[1] http://en.wikipedia.org/wiki/Salaryman

cyanoacry··on Hackathons are bad for you
I went to my first hackathon last weekend, and I'll agree, it definitely is a treat! It's a lot of fun to practice something you don't normally do, but I definitely think it's not something to do for the result. The process and crunch time is what really makes it any fun.

What surprised me the most is how much time I needed alone. A lot of my best design decisions come to me when I'm holed up in the shower, and the hustle and bustle of a hackathon isn't anything close to that. I couldn't make any sound design decisions while really "at" the hackathon. I ended up repeating the same pattern: I'd hole up in a corner for a bit, or wander off for a walk. Then with a little focus, I could figure out what I was actually coding!

Coming "back" to the hackathon, however, was really important, as it kept my work ethic honest. I have a problem with premature optimization (not to just mention laziness), and the environment made me want to get back to work. You don't want to be the odd kid out just staring at browser tabs all day!

Sometimes, you gotta churn out code after you've made all the sexy design decisions, where the work is really just laborious idea-to-code elaboration. That's usually really hard for me to do, but a hackathon is a really good place for that sort of work.

cyanoacry··on Touch Enabled Business Card
Powerstream ( http://www.powerstream.com/thin-primary-lithium.htm ) makes a number of paper-thin primary and rechargable cells. I haven't personally worked with them, but the specs look incredible.
cyanoacry··on How a Norco case killed 13TB of our data
The funny thing is, I'm not sure that the hot-swap circuitry is even necessary in the first place due to the connector design.

The SATA spec defines "pre-charge" voltage pins that are connected after ground, but before any of the other voltage pins are connected. The idea is that by inserting a small (10 ohm) resistor, you can limit inrush current to a tolerable value while capacitors charge and regulators start up, and then when the other pins connect a couple of milliseconds later, the drive gets the proper low-impedance power connection.

Do you know if implementing pre-charge via connector mechanics obviates hot-swap protection circuitry? Supermicro seems to have hot-swap protection on their backplanes as well, but I haven't had a chance to closely inspect it.

cyanoacry··on How a Norco case killed 13TB of our data
We actually used to use Samsung EcoGreen drives in order to get more storage for cheaper, since our main use was backup: write once, read maybe. Unfortunately there don't exist 5400RPM 3TB drives; if they were as cheap as the 3TB Seagates, we'd buy them for sure. The 5400 rpm Ecogreens used to be the cheapest 2TB drives on the market by a large margin.

I never expected that paying more for a slower drive (but better power and less power-related issues) would actually make sense!

cyanoacry··on How a Norco case killed 13TB of our data
The FETs blew as soon as we turned on the case, oddly enough, and even if we had a single drive plugged in, that FET would blow by itself. This is even the case when we took the backplanes out and started testing them individually in free air in the server room, where ambient is more like 18C instead of 25.

Is the design solution to use a FET with a lower Rds at 5V Vds for smaller heat dissipation?

But more importantly, is there a standard current that most chassis are tested to? I would expect all SATA hot-swap bays would support all SATA drives on the market, since nobody ever gives power dissipation or consumption figures.

cyanoacry··on How a Norco case killed 13TB of our data
Er, I should say "tested at 0.6A" MOSFETs. If they have thin bond wires or something, it's plausible that excess current just vaporized them. If they never tested them at 6A, and skimped on the gauge...

I also saw a couple instances where the trace to the gate blew up (like, black board, no copper, looks like a burnt fuse), so it's possible that static during manufacturing killed their FETs even before they shipped. (We're pretty good about static, and if it was our fault I think maybe one drive/channel would die, not several)

← PreviousPage 2 of 3Next →