Wednesday, February 06, 2013

Programming language compiler and virtual machines

Today I came across a post touting Topaz, an implementation of Ruby. That implementation uses RPython, which powers PyPy. And it just struck me, how many times I see "we implemented language X using language Y". I understand, a lot of it is just scratching an itch, playing with a toy. Self-hosting makes sense to me. I can understand wanting to use your favorite language in a mature ecosystem (all the languages hosted on the JVM). But I think that I don't get the rest. If you know Python well enough to write a compiler for Ruby in it, why aren't you just coding in Python? If Haskell is so great for "correct" code, why write a Perl VM in it?
I really am curious, is it just play, or is there an underlying sense I'm missing.

Thursday, September 06, 2012

Science knowledge of politicians.

Mitt Romney believes in cold fusion
This makes me both amused and nostalgic. I was in the middle of the experiment that would provide the data for my dissertation in nuclear physics when the press release from Fleischmann and Pons came out. There was a big hubbub, and all sorts of impromptu conferences to discuss it.

They did bad science, in the sense that they went ahead and did a press release before getting any peers to review their data. They were so eager to patent, that they forgot the basics of academic research.

The months following were further amusing. Nuclear physicists that I knew weren't touching it. But physicists from other areas were trying to replicate the results. I'll never forget the sight of my roommate, a condensed matter student, setting up a neutron detector next to a electrolytic bath.

"Dave, you do know that if this thing works well enough to set off the neutron detector, you really ought to be wearing lead underwear, don't you?"

Thursday, June 14, 2012

Presidential Effigy

Apparently HBO's Game of Thrones had a copy of GWB's head on a spike. This is wrong, and the immature twits that had a giggle over this should have been fired. That being said, listening to the uproar over this, I have to ask, would they have reacted the same way if it was the current president's image? If not, then this is just more partisan politics, and has nothing to do with respect for the presidency.

Wednesday, June 06, 2012

Fermented foods, part 2: Kefir

The last post addressed the dearth of information on this blog on my yogurt making habit, which has been going on pretty much continuously for the last eight years. This one talks about my first steps with kefir.

I can't recall how I started getting interested in kefir. Most of the web sites that turn up in a google search turn up vendors. Here is one site that is just useful information.

Kefir is fermented milk (usually) product. I say usually, since the cultures are used to ferment other food liquids, such as sugar water or coconut milk. Unlike yogurt, where I can just inoculate the milk with the culture from a previous batch, I need to use kefir grains, a symbiotic colony of various yeasts and bacteria, to culture the milk.

After a brief search, I could not locate kefir grains, live, dehydrated, or otherwise, in any of the local health food stores. Only premade, flavored kefir beverages. So I was forced to order my grains online. I finally settled on buying from someone in Idaho on eBay.

I order on Friday, they arrived on Monday, pretty sweet. They came in a plastic ziplock baggie, with some milk, inside of another ziplog bag, in a bubble wrap envelope, with instructions, a round coffee filter, and a rubber band.

Now, you might be concerned that milk traveling by snail mail, without any sort of cooling, would be pretty funky on arrival. That was not the case. There was pretty much no odor at all.

As soon as I got home with it, I immediately drained the milk with a strainer, and put the approximately 3 tbs of kefir grains in a 2 cup glass jar with milk from the fridge, covered with the coffee filter, set it on the counter.

The next morning, I lift the coffee filter to check it out. I was warned it would probably take a couple of cycles before I started getting good kefir, so my expectations for drinking anything were low. But what really amazed me is that there were no off-odors when I lifted the lid. If I had left uncultured milk on the counter, it would be pretty nasty by then. (As a side note, I don't know why, but my sense of smell has gotten rather inconveniently sensitive of late.)

Since it looked pretty good, rather than discard the milk and start the next batch (which are typical instructions for reviving kefir grains), I moved it to a larger jar, and added another couple of cups of milk. Since my kitchen is a little cooler than optimal for fermenting kefir, I left it for another 24 hours.

This morning, I was ready to strain out the kefir grains, and sample the kefir. Some writers warn to uses a very fine, non-metalic strainer. This is to avoid losing the very small kefir grains. I used a fine stainless steel strainer, and found that nothing really got through, so I switched to a coarser stainless steel strainer, and still had to shake the mixture about a bit in the strainer to get out the liquid. With that, I started up a new batch of kefir in a clean glass jar. My one concern is that it appears I have to give considerably more attention to care and feeding of kefir than I do for yogurt.

I sampled my first kefir this morning. A half cup, to make sure that any digestive surprises it gave me were minimized. ;-) It was a bit sour, as expected. I added a little bit of sweetener, and found it crossed the line into too sweet very quickly, so I will have to watch for that in the future. It was also slightly gritty, as predicted by Dom above, considering I fermented at about 66 deg F. I'm hoping for a creamier product when it gets warmer. And there was that tail of fizzy flavor that I recall from commercial kefir and kombucha.

The other notable from the experiences is that after drinking the kefir, all hunger vanished, and it was another three hours before hunger distracted me again.

Fermented foods, part 1

Some time back, here or on some other blog, I talked about how easy it is to make yogurt.
See here, and here.
I've got my system down pretty well now. I still have my 1qt Salton yogurt maker.


  • a little less than 1 qt milk, skim, low fat, whole, or supplemented with half and half, depending on taste
  • 1/2 to 1 cup of dry milk powder
  • 1/8 tsp stevia powder (optional, or substitute your preferred non-sugar sweetener)
  • 1-2 tbs plain yogurt
  1. In a glass or stainless steel container mix together milk, dry milk powder, stevia
  2. Place container in a water bath maintained at a slightly less than a simmer, with a digital probe thermometer in the milk
  3. Maintain milk at 180 deg F for 30 min, or 190 deg F for 10 minutes. Don't let it get to 200 deg F.
  4. Remove from water bath, and cool back down to under 115 deg F. 
  5. Mix in yogurt.
  6. Place mixture in container in yogurt maker (following manufacturer's instructions) for 4-12 hours, depending on how you like it.
Some notes on this:
  • I add the dry milk powder because it makes for a thicker, more custardy yogurt
  • Step 3 I learned from Harold McGee in On Food and Cooking. The heating denatures the whey proteins, which also makes for a thicker, more custardy yogurt. It's only really necessary to heat the milk to about 160 deg F to kill off any critters that might compete with the yogurt cultures.
  • For my water bath, I use a slow cooker. It takes a long time, but I don't have to pay close attention to the process, the way I would with a water bath on the stove. I short-cut the process some by boiling the water before I stick it in the slow cooker, and heating up the milk mixture in the microwave. If I wasn't going for denaturing the whey proteins, the microwaving would be sufficient, and I wouldn't need the water bath.

When it works out right, the yogurt has the thickness of greek yogurt, and a texture similar to flan.

Thursday, May 31, 2012

Liberal vs Conservative

A piece on a very tailored view on liberal vs. conservative. Have a read, I'm just posting my reaction.

  • The description fits a libertarian much more than a conservative.
  • Both conservative and liberal depend on the context, be it fiscal, social, religious, etc.
  • Religious conservatives insist you worship as they do
  • Moral conservatives want to put tight restrictions on how you live
  • The current crop of neocons want the rich to pay a lower tax rate than the poor, even though the impact on them is much less
There's fair, and there's "screw the poor, they can't defend themselves anyway..."

Thursday, May 19, 2011

A calorie is a calorie is a calorie... NOT!

The great Richard Feynman lends his formidable talent and name to debunking certain misconceptions in the nutrition establishment. In particular, that the possibility of metabolic advantage resulting from low carb diets is in fact consistent with thermodynamics.

Saturday, May 07, 2011

A Low-Carb "Aha" Moment

One of the blogs I follow is that of Dr. Michael Eades, one of the authors of "Protein Power". That was the low-carb diet I used back in 1999 to drop 25 lbs to get close to my ideal weight. His post yesterday talks a bit about Gary Taubes' new book, "Why We Get Fat". He talks about insulin resistance in the article, and that would appear to be a lot of what WWGF is about as well.
I used to wonder how it was that I could eat a very full low-carb meal, and still be hungry within an hour. Now I have my answer. To get the longer version, read Dr. Mike's post, or better yet, Gary's book, but I guess we could describe the problem as differential insulin resistance. My liver is more insulin resistant than my fat cells. So when my blood sugar starts to drop, there is still too much insulin in my bloodstream to allow fat to be released from my fat cells to feed me. So, even with a winter's storehouse of extra fat, I am hungry.

Monday, April 25, 2011

Science as a career choice.

By way of a Slashdot posting, I came across an interesting article. Why aren't there more women in science?
To summarize it for you, the key point is that women are smarter than men when it comes to listening to their elders and choosing a career. The article discusses what work in science looks like in the real world, and I can't argue with it, it is pretty much spot on, having followed a similar career trajectory to what was described. I'm lucky in that I got out during my first post-doc, rather than waiting until I was denied tenure for the second time.

Friday, April 01, 2011

Cookware to last on the cheap.

I like to cook, but I share my kitchen with a number of other cooks whose technique is different from mine. What that means to me on a practical level is that my cookware needs to be really durable, and tolerant of high heat and rough treatment. Around here, non-stick coatings get scraped and burned off, and anodized aluminum coatings are stripped away. So I've given up on fragile cookware. Cast iron, carbon steel, and stainless steel are now my choices. Well-seasoned cast-iron and carbon steel provide an excellent non-stick coating. And if the coating becomes, well, sticky, I can always re-season.

So, to the title of this post. I've got two anodized aluminum woks that are kind of sticky. Noodles and rice stick to them. I wanted a carbon steel wok, but I couldn't really justify it while the woks I have are still serviceable, if not ideal. I can get a 14in carbon steel wok for about $20 online, not including shipping or tax, which is pretty reasonable, but still enough to slow me down. I was driving along and saw a thrift store, and decided to check it out. Wow. 14in carbon steel wok with wooden handles for $4. 9in cast iron skillet for $3. Why could I find such a deal? They were rusty. Someone who didn't know how to care for steel and iron scrubbed off any seasoning, and they rusted. I took them home, scrubbed off the rust with some abrasive powder, rinsed and dried well, and seasoned them. I won't tell you how to season them, a web search will provide more links than you know what to do with. For half the cost of a new pan, I got two.

Sometimes the old ways are not only cheaper, but better than the new ways.

Thursday, March 03, 2011

Double Edge Shaving Update, 3 years into it.

I don't know why it came to mind, but it seems it's time for an update on my shaving experiences. You can find all my posts on the topic here. To recap, a bit more than three years ago, I became interested in simplifying. When cartridge razors got to five blades, it became ridiculous enough to me to react. I bought a used Gillette Superspeed on EBay, one of those butterfly opening ones, and picked up blades at Walmart. When I moved to Washington, the box the Gillette was in got misplaced, and I bought a Merkur Classic, with comb edge for heavy beards. I also order a box of 100 Turkish Derby double edge blades for $25 online.

Now, three years later, I still have some Gillette Fusion blades that are now over 3 years old I haven't used. I'm just finishing up the box of 100 Derbies. (I have about 10 blades left.) The Gillette Superspeed reappeared. Once when I was shaving with it, it opened up a little bit, not enough for me to see, but enough to make the shave be a bit bloody. Since then I've stuck with the Merkur. My technique has gotten to the point where shaving cuts are rare (maybe once every couple of months), and shaving with the Gillette Fusion is by comparison uncomfortable. I use it once in a while, since I have the blades, and I figure sometimes I just want to shave quickly without being so careful. It's not much quicker, though.

I've been using Trader Joe's Honey Mango Shaving Cream. This is as much because my family objects to any unfamiliar scents, and they are used to this one. In the shower, I spread the cream on with my hands. At the sink, I wash my face and head with hot water, and then spread on the shaving cream with a shaving brush. I use many short strokes, stroking the same area repeatedly until the blade slides smoothly across my skin. I used to try to keep track of how long I had been using a blade. Now, when the blade feels like it is pulling to much, I change it out.

The cost savings have been considerable. I have a heavy beard, and I shave my head nearly as often as my face. I've probably saved about $250 over the last 3 years, maybe more. If I get lazy, and let my beard go a couple of days, it's OK now, the double-edge doesn't mind, and doesn't get clogged the way the cartridge blade would. This experiment has been a decided success.

Thursday, September 09, 2010

Some Freemind Scripting

I go back and forth, trying to find my ultimate tool for knowledge and task management. I have been switching between TiddlyWiki, email, Freemind, and other wikis and online/local tools. The pendulum has swung back to freemind for the moment, and I'm finally getting around to scripting what I need in it. As some background, Freemind is my preferred mind-mapping application, whether online or on my desktop. I also keep coming back to it as my knowledge management tool.

I downloaded the source code of freemind, since documentation is non-existent. What is documented is that there is a groovy scripting environment. The main classes used are MindMapController and MindMapNode. The controller is used to make and changes to your mindmap, and the node is used for reading and traversing. The environment provides you c as the current MindMapController and node  as the current node. Just so you know, I am by no means writing idiomatic groovy. I am using Freemind version 0.9 RC7

With this bit of background I wrote the following short script:

import freemind.modes.MindMapNode;
import freemind.modes.mindmapmode.MindMapController;
import freemind.modes.attributes.Attribute;
import java.text.SimpleDateFormat;

def now = new java.util.Date();
def fmt = "yyyy-MM-dd HH:mm";
def formatter = new SimpleDateFormat(fmt);
def nowString = formatter.format(now);
def status = node.getAttribute("task");
if(status == null){
    def attr = new Attribute("task","todo");
    def timestamp = new Attribute("task-changed",nowString);

What it does is to add a pair of attributes to a node.

At first, what I attempted to do was to associate it with a pattern. In other words, from the context menu for a node, I went to Physical Styles -> Manage Patterns -> Needs Actionand at the bottom of that page opened the script editor, inserting the above script. I ran it from the script editor, and it acted as expected, to my pleasant surprise. Then I saved and exited, assuming that every time I hit F4 on a node, the script would be run on that node. Alas, that was not the case. In fact, to my chagrin, when I opened up that attached script again, I found pieces had been cut off, and all my formatting was gone. With a little probing, I found that the script was saved in my personal patterns.xml file, and probably the saving and parsing isn't quite working right.

Next step. I just saved the script to a node. That is, with a node selected, I went to Tools -> Script Editor, pasted in the script, and then hit ALT-F8 to evaluate it. That worked.

The approach I am going with now is to associate the script with the root node. As a first step, I look for any node that starts with the string "todo::". If that is present, I create attributes indicating this node is a task, and the time at which it was set as a task, and remove one of the colons from that prefix string, so that the node doesn't get reprocessed. Then I can use a filter to find just the task management nodes. Granted, I could do this with filters, but this allows me to add some tags on when a task was created and when it was completed.

Here is the final script

import freemind.modes.MindMapNode;
import freemind.modes.mindmapmode.MindMapController;
import freemind.modes.attributes.Attribute;
import java.text.SimpleDateFormat;

def setTags(MindMapNode pnode, MindMapController pc, String pstatus){
    def now = new java.util.Date();
    def fmt = "yyyy-MM-dd HH:mm";
    def formatter = new SimpleDateFormat(fmt);
    def nowString = formatter.format(now);
    def status = pnode.getAttribute("task");
    if(status == null){
        def attr = new Attribute("task", pstatus);
        pc.editAttribute(pnode,"task", pstatus);
    def pTS=pnode.getAttribute("time-" + pstatus);
        def timestamp = new Attribute("time-" + pstatus , nowString);
        pc.editAttribute(pnode,"time-" + pstatus, nowString);

def processTasks(MindMapNode pnode, MindMapController pc){
    // check if text is tagged
    def nodeText=pnode.getText();
    def matchTodo = (nodeText =~ /todo::/);
        setTags(pnode, pc, "todo");
        nodeText = matchTodo.replaceFirst("todo:");
        pnode.childrenUnfolded().each() { aChildNode ->
            processTasks(aChildNode, pc); /* recursive invocation */
            def placeHolder = 1;

processTasks(node, c);

Monday, July 12, 2010

WSJ on men's razors

Razor Burn. -- The Wall Street Journal has a piece on men feeling the pinch of the artificially expensive market for the latest razors. If you've been reading this blog, you've heard my own opinions on this matter, so it seems it's time for an update. I've been using my Gillette super speed for the most part for over two years now. I also picked up a Merkur classic with the comb edge when it seemed my Gillette had disappeared in a move. The Merkur is a bit aggressive for me, I tend to cut myself more often with it, especially on my head. I picked up a pack of 100 Derby razors on ebay for about US$25. After two years, I still have about 15-20 left. I typically generally shave every other day, but I have a very tough beard that grows fast, and I shave my head as well. It takes a bit more care than using cartridge razors, but I'm at the point that I can pretty reliably shave almost as fast, and without cutting myself.

When I was shaving with a five-blade solution, I was paying about $3.50 per cartridge. I see I can get them for about $3 online. If we assume one cartridge per week, I was paying $156/year just for blades, and now I am paying about $10/year.

Tuesday, June 22, 2010

Fast food versus Healthy Food

Came across a discussion of food perception on wise bread. I take issue with fast food restaurant versus healthy restaurant, where french and italian food is included in healthy. Replace 'healthy' with 'fancy' in the article, and it is all more sensible. Anyone who goes to a restaurant that doesn't publish nutritional information can't assume that the food meets or doesn't meet any dietary guidelines. What's in the salad dressing? Are they using whole milk cheese or skim milk cheese. Just how much oil or butter was used to pan fry that dish? For example, american's tend to think of asian food as healthy. Having cooked chinese food for the last eight years, knowing what my recipes call for, and assuming short cuts on the part of restaurants, I'm no better off than eating typical american fare. If it's creamy soup, it being Thai doesn't mean the cream will have fewer calories.

Monday, June 21, 2010

The logic of paleo diets

I am sympathetic to the idea that we return to hunter-gatherer diets, but I find myself thinking about what that actually means. How did we happen to start farming? How did we decide as gatherers what was edible? Was it starvation that drove us to try new foods? I like the idea of climate change driving early agriculture. "Gee, these grass seeds are hard to eat, but I'm hungry. Gee, look at that, I survived the winter eating grass seeds and roots." I'm afraid the logic that some paleo-philes present as to the transition from hunter-gatherer to farmer feels very weak to me. I think that without that transition, perhaps humans would have come close to extinction, if we didn't disappear altogether.