Sunday, January 28, 2018

January 28, 2018 at 11:16PM

Two days ago I learned: (I wrote up most of this on Friday and forgot to finish it out; instead of letting it die, I'm cheating and pushing it out today.) 1) ...a bit about the Impossible Burger, widely hailed as the most meat-like non-meat burger in the marketplace. My impression is that the Impossible Burger is a very, very heavily engineered food. A lot of effort went into making the texture, taste, and sound (yes, sound) of the Impossible Burger similar to that of a beef patty. However, if I were to collapse the Impossible Burger's design into one trick, that trick would be leghemoglobin. Leghemoglobin is a protein normally produced in the root nodules of soy plants, where it has something to do with oxygen buffering. The protein is structurally similar to animal hemoglobin and myoglobin, and acts similarly -- it complexes with a heme molecule, which allows it to efficiently bind dissolved oxygen. Heme, it turns out, is why bloody meats are red, and gives meat a lot of its rich, metallic flavor. Impossible Foods (the makers of the Impossible Burger) decided to make a burger with plant-based heme using leghemoglobin as a heme source. Unfortunately, soybeans don't make a lot of leghemoglobin, and it's a *pain* to extract, so Impossible Foods moved the gene for leghemoglobin (and, presumably, the enzymes required to make heme) into yeast, which is *very* easy to grow and relatively easy to extract proteins out of. That lets Impossible Foods make a rich, hemefull burger patty that's 0% animal. There's only one small catch, legally speaking -- leghemoglobin isn't FDA approved. It seems it doesn't *need* to be -- it's being sold anyway -- but just to be on the up-and-up, Impossible Foods sought FDA GRAS approval of leghemoglobin. They have some data feeding mass amounts of leghemoglobin to rats (no effects) and, perhaps more importantly, argued that leghemoglobin is an ancestral protein that we have no particular reason to think is toxic that's structurally very similar to tons of proteins we already eat all the time. The FDA rejected the approval request, I think on the basis that a) leghemoglobin might just be an allergen and b) there could be small amounts of other yeast proteins that make it through purification along with leghemoglobin that aren't necessarily human-safe (they're not using bakers' yeast, and I don't think the kind of yeast they are using is typically eaten in any appreciable quantity). 2) On a related note, Impossible Foods claims that 90% of the rennet used to make cheese is now yeast-produced. Whatdyaknow. This explains the multiple times I've run into "vegan cheese" that used rennet. I guess they were (probably) vegan after all. Those cheeses, when I've tried them, were significantly better than non-rennet vegan cheese, so I'm kind of excited to get back into the cheese substitute game. 3) If you want to burn little tea-light candles in water, don't take them out of their metal shells -- the wick of one of those candles is attached to a little metal pad, and when it heats sufficiently it will drill through the bottom of the candle and fall into the water, taking the rest of the wick with it. Bonus candle fact -- it's pretty easy to modify candles with tin foil by heating the tin foil over a lit flame and quickly pushing it into the candle somewhere.

Monday, January 22, 2018

January 22, 2018 at 03:29AM

Today I learned: 1) I kind of knew this from experience, but Andrey Shur confirmed for me today that it's rare to find a 2 amp USB phone charger, largely because USB isn't quite rated to carry 2 amps. This is curious, as Raspberry Pis recommend you use a 2 amp charger. As I am learning, Raspberry Pis were made with some really odd design decisions. 2) ...a bit about Hilbert curves. Or, technically, *the* Hilbert curve, which is the limit of pseudo-Hilbert curves of N iterations as N approaches infinity. If you google image search for "Hilbert curve", you'll find a bunch of example pictures, which is going to be much easier than reading me awkwardly try to explain the shape... but in short, a pseudo-Hilbert curve of N iterations is a fractal line that neatly visits every grid point in a square (with side length log2(N)). As you take larger and larger iterations of the pseudo-Hilbert curve, it becomes a denser and denser nest of curves. The cool thing about the Hilbert curve is that, in the infinite limit, it is "space-filling", which means that it eventually visits every single point in the square it's defined over. Essentially, that makes the Hilbert curve a mapping from a line to a plane... which sounds obviously wrong, but is mathematically provable. It turns out that a (the?) key property of the Hilbert curve for analyzing its space-filling-ness is that it's "stable", in the sense that if you follow a point on the pseudo-Hilbert curves as you add more iterations to it, that point will converge to a fixed position, and it's possible to calculate what that position is. That's important, because without this property, the concept of "the curve that this curve approaches as you iterate to infinity" doesn't make sense -- if the mapping of every point doesn't converge, then the curve doesn't really "converge" either. If you'd like to learn more about Hilbert curves, I highly recommend this video, "Hilbert Curve: Is infinite math useful?": https://www.youtube.com/watch?v=3s7h2MHQtxc 3) ...a little bit about screenplay script formatting. Industry screenplays are... weird, coming from someone who has never written one before. For one thing, everything's centered. Scenes open with a description of the scene, usually one sentence, using the whole page width and ALL IN CAPS. Those scene-setup sentences also usually start with "INT." or "EXT." for interior and exterior scenes, respectively. Most of a screenplay is dialogue, of course, and all dialog is written with insanely large margins, so it reads like a little column of text smack in the middle of the page. The name of the speaking character gets its own line. Description of *how* a line is delivered come in the form of parentheticals, which also get their own line, are contained within parentheses, and have about an extra half inch on each margin relative to the actual dialogue. (I didn't say I learned anything about writing a *good* screenplay, just that I learned how to *format* one.)

Saturday, January 20, 2018

January 20, 2018 at 09:05PM

Today I learned: 1) https://www.youtube.com/watch?v=ciStnd9Y2ak If you care about the environemnt, and you haven't written to your congressperson about nuclear power, I highly recommend the above TED talk. Basically, we're killing about 7 million people a year around the globe by using fossil fuels instead of nuclear. For comparison, total deaths from all the nuclear disasters in the world are in the four-digit range, and something like 90% of that was deaths during unnecessary evacuations that had nothing to do with radiation exposure (i.e., traumatically moving people from nursing homes and emergency care facilities). Oh, and nuclear is also cheaper than renewables *and* generates less emissions and other waste. Honestly, I'm having a hard time thinking of a bigger failure of humanity than that of our not using nuclear power as our primary energy source. Maybe world war II? Any other suggestions? 2) ...how to test the power supply on a Raspberry Pi! There are a couple of test points you can stick a multimeter to that will tell you what kind of voltage the Pi actually gets. Sadly, my Pi is getting plenty of power and still won't boot. =( 3) So, according to George Church, the off-target mutation rate of Cas9 in humans is now below background mutation rate, using off-the-shelf tools and good, proper computational design. Gonna be honest, I thought it was a lot higher than that.

Friday, January 19, 2018

January 19, 2018 at 09:32PM

Today I Learned: 1) I've wondered for a long time how text-based loading bars work. Many command line programs feature progress bars that somehow fill in using only text... even if the progress bar is in the middle of a line. For example, the Arch Linux package manager prints a lot of lines that look like core 126.8 KiB 906K/s 00:00 [###############-------] 66% where those "-"s eventually fill up with "#"s. But how does a program overwrite its old text? Well, today I finally went and googled exactly that question, and it turns out to be pretty easy -- there's a character called a carriage return ('\r') that sends the print-output-cursor to the beginning of the line. If you carriage return and then start typing, it will overwrite whatever was already in the output, at least if you output to a terminal window (I assume if you write a \r to a file, it will faithfully copy an ASCII '\r' to the file and keep going, but I haven't tried it). I've run into '\r' before, but almost always coupled with a carraige return ('\n') character, which in some systems is used to represent a new line (also, confusingly, '\n'). It never occurred to me that carriage return could be used *without* a newline. This is some seriously useful magic. For one thing, it makes loop-counting diagnostic prints a hell of a lot cleaner -- now if I want to know how a long loop is progressing, I can have a single line of output per loop, instead of printing stacks and stacks of output. 2) Did you know that the sex ratio of humans at birth is not quite 1:1? It's actually more like 107:100 male:female, quite reliably. This is *at birth*, so before any effects of selective infanticide. That 107:100 number is especially surprising in light of theoretical evolutionary game theory that suggests that gender ratios for most binary-gendered organisms should be very, very close to 1:1 -- essentially, if there are more males than females around, then you get a fitness boost by having more female offspring and vice versa, and the only stable equilibrium is even birth ratio. The wiki page on human sex ratio points at at least one potentially good evolutionary explanation for the imbalanced sex ratio. Why do *you* think there might be more male human births than female human births? 3) ...about an alternative to tempered MCMC and annealed MCMC, called adiabatic MCMC, that has some nice theoretical properties over the tempered and annealed versions. A quick reminder: MCMC is, extremely roughly speaking, a class of methods for sampling from the inputs of a function so that the probability of drawing some input is proportional to the value of that function for that input. Usually MCMC is used to sample from probability distributions, in which case it's a way of randomly sampling from a (potentially very complicated) random process. Typical MCMC algorithms use some kind of "walkers" in the input space. By some algorithm, they take a random jump in the input space, and then either accept the jump or stay where they started, depending on the probabilities it calculates at the start and end points. Essentially each walker is a noisy hill-climber -- it will tend to move up hills toward high-probability regions, but it can wander enough that it will also sample lower-probability regions some of the time, too. A major problem for simple walker-based strategies is that if the probability distribution under sample has two high-probability peaks that are separated by a low-probability valley, then walkers that start on one hill can take a really, really long time to wander over to the other one. Parallel-tempered MCMC and annealed MCMC try to get around the problem using a thermodynamic analogy. They essentially "heat" the walkers so that they can move around more easily, then "cool" them to trap them in local hilltops. This does kind of work... but unfortunately, the speed at which you heat and cool matters a lot, and there's no great way to pick a heating or cooling speed. Enter adiabatic MCMC. I'm not going to pretend the mathematics of adiabatic MCMC yet, but I *will* pretend to understand Andrew Gelman's metaphor for it here: http://ift.tt/1oNbdSs. Essentially, tempered MCMC treats temperature as a tunable knob, which it turns manually to achieve nice mixing. Adiabatic MCMC, in contrast, manages temperature by connecting the walker system to a heat bath with some temperature, and lets energy flow between the two according to their relative temperatures. Don't ask me how that actually *happens* at an algorithmic level, but the bottom line is that this more-or-less solves the problem of temperature adjustment. (Addendum: This seems like an awful lot of effort and complex math for relatively little gain. Why do I care about tempered MCMC and adiabatic MCMC? Well, for Techncial Reasons, tempered MCMC lets you compare the probabilities of different models in a Bayesian framework, according to some data. That's pretty powerful stuff, and it's really tricky to do in general. However, I've been warned by actual statisticians that using tempered MCMC for model comparison is Dangerous, so I'm interested in anything that can more safely replace it.)

Thursday, January 11, 2018

January 11, 2018 at 01:51AM

Today I learned: 1) ...which silverware is mine. This may sound silly, but for a long while, I'd mostly lost track of which silverware was mine and which was my roommates'. I knew a handful were mine, and I'd just been eating with those... today we went through all the silverware as a house and tagged them with their owners. It turns out I actually have a lot of silverware. 2) Today I found myself wondering how microwave ovens are so efficient. How can they possibly transfer energy to food more efficiently than, say, an oven? For that matter, how do they make microwaves at all? It's not by blackbody emission of a hot element -- if it was and was powerful enough to cook food, it would emit mostly visible stuff anyway and it would be a regular oven. Well, I don't think I really learned why they're *efficient*, but I at least learned how microwave ovens *work*. The key component in a microwave is a device called a cavity magnetron. A cavity magnetron is essentially a multi-chambered flute for electrons, tuned so that it produces microwaves. The metaphor is more literal than you might think. Cavity magnetrons have a bunch of chambers -- just holes in metal, really -- over which you can shoot a beam of electrons. As the electrons pass by each cavity, they produce a changing electromagnetic field. The cavity *literally resonates* that electromagnetic field at a characteristic frequency, which, in the case of a microwave oven, is in a microwave frequency. If you build up enough resonance, some spills out as a microwave-frequency photon, and it's guided out into the oven by another device. For more details, see http://ift.tt/1CKAOBh 3) Speaking of microwaves, while digging through wikipedia for #2 above, I learned that microwaves can cause runaway heating with some materials. See, as some materials heat, they become more responsive to changing electromagnetic fields, which can make them absorb microwave radiation more efficiently. That makes them hotter, which makes them more receptive... etc. Fun fact -- one such material is glass. If you pre-heat glass before putting it in a microwave, it's supposedly possible to melt it in a microwave.