Sunday, December 5, 2010

All your nodules...

As a side project, I'm presently working on an MVC framework for node.js, and I'm calling it (tentatively) nodule.  The following ideas are being used:

Controllers: simple exports object { target: method }.
View: Resig's simple templating engine, plus HTML helpers
Model: Based on concepts from my old PHPTableModel (which may or may not work at the moment), essentially it's a way to chain tuples, jQuery-like, before committing to a query.

Dispatcher: first, check the router table, then, for http://server/a/b/[...], execute controllerA.B([...].split('/'))

All model and view decisions are made by the controller.

Anyway, it's not that far along yet, but I'll keep everyone posted.

Wednesday, September 8, 2010

Want cheaper fuel? Go pro nuke.

Nuclear power in the United States has the potential to reduce our carbon production by half. First, by supplanting electricity production. Right now, nuclear power has spent the last thirty years producing about 20% of our power, and hasn't had a single radiologically induced fatality, and very few injuries as a result. There's been only one significant release of radiation, and fast action by the plant owner and the surrounding community quickly saw to it that there was little harm, if any. If we were to increase our nuclear buildout to replace our coal generation industry, we would reduce our carbon production significantly.

There are other targets for nuclear energy. One is to ape the U.S. Navy. They have been running nuclear-powered ships for the last 50 years and have not suffered a radiation release. If we were to enable a move of our commercial fleet of ships to nuclear power, in addition to the gains from electricity, the United States would get an overall carbon reduction by around half.

There is a lot of fear surrounding nuclear power. One is that of coal unions; their opposition to nuclear power is that it eats into Coal's demand budget, thus putting a lot of people out of work. While I don't think that's a convincing argument from an energy perspective, I do think it may have teeth from an economic one. This post is an attempt to provide a path to avoid such job losses.

It is true that a greater dependence on coal for energy budget will reduce the generation demand for coal. If mining companies are smart, they will quickly move into alternate areas of coal consumption.

"Clean" coal
"Clean coal technology" refers to a mix of chemical tricks - the most important one being coal gasification. This is the process of converting coal into a mix of carbon monoxide and hydrogen, called "synthesis gas", or "syngas". While this is a good substitute for natural gas - reducing the need for fracking and oil drilling - there are other uses for syngas.

Further processing via Fischer–Tropsch synthesis yields diesel fuel. You can also convert syngas to methanol - a fine stand in or filler for gasoline. Syngas can be the source for plastics production. Generally, with the demand for electricity covered by nuclear power, coal companies can concentrate on replacing oil. This may not reduce carbon production from the coal industry, but we gain energy security benefits and reduce our dependence on foreign oil. Additionally, if we're never burning coal directly, we're not pouring SOx and NOx emissions into the air. If we're mining coal more smartly, using in situ processes - which we can do if we don't need it in solid chunks - we can reduce the water pollution that goes into coal mining.

Unfortunately, this plan does not solve mountaintop removal.

Overall, there are a lot of targets for coal without being our primary production avenue for electricity. The question is: does the coal industry have the wherewithal to eat the lunch of the oil companies?

The primary benefit to consumers, of course, is that without OPEC manipulating prices, there will be a natural reduction in the cost of diesel, gasoline, and natural gas. It's been a while since they had any real competition in the market for these three fuels, and it's about time we gave it to them.

The coal industry will eventually slow to a crawl - that is inevitable - but this path enables a smooth transition while reducing our carbon output. Moving to a syngas-based economy has other migratory advantages. You can also produce syngas via carbon sequestration, Sulfur-Ioidine hydrogen synthesis, and waste heat from high-temperature nuclear plants. You can start building cars that run on electricity, using direct methanol fuel cells, and get much higher efficiencies as a result. Betavoltaics built using Strontium-90 from spent nuclear fuel (present at ~6.5% in U-233 fission, ~6% in U-235 fission, and ~2% in Pu-239 fission) can later be dropped into the same electric vehicles, only requiring a "refueling" (or overall recycling) every 30 years or so.

But replacing coal-based electric consumption and diesel shipping with nuclear power should be our first-order goal as a nation. During that time we should finish development on LFTR and the IFR, so they can be deployed on greater scales.

Saturday, August 28, 2010


I've never understood why the mind-body dichotomy is considered coherent.

The mind body dichotomy, quickly stated, is the idea that there is a nonphyiscal phenomena, called the mind, whose attributes and behavior are distinct from the body. A practical consequence on, say, a doctor is that he must determine whether a cause is physical or mental.

I suppose it all comes down to definitions - i never saw the mind as much more than software running on the brain, with the body as a host of attached peripherals. I'd built up this model long before I'd read anything about the MBD, and immediately thought, "why is it a dichotomy? The mind is the behavior of the brain. if it's mental, it's also physical. I can understand how that's a little unhelpful, but it's no big mystery."

What I find even a bit immature is this: the body, while distinct from the brain, is intimately integrated with the models the mind generates to interact with the world. that means that, fundametally, the mind _is_ the body - at least, in part.

so i suppose I'm taking issue with the word 'dichotomy'. the practical problem still stands - does a doctor treat the physical aspect, orr the mental?

since the two are intimately tied, I think the answer must be "both". a physical issue may have mental repercussions, and a mental issue can cause real physical problems.

for the former, think of amputees with phantom limbs. for the latter, consider someone who has phantom back pain, causing rsi's on his major joints from comensating for his pain.

in both cases, it's incumbent on a doctor to clear away the symptoms as best as he can before focusing on the real causes - it's best to have as much of the bullshit out of the way when getting down to business.

still, the concept of the mind is a tricky one, but i believe i can describe a theroetical emergence in a plausible manner:

the mind started out as a simple decision maker. this was the fish brain. all it could do is figure out: eat, kill, both, or run.

as we grew more complex, so did the mind. new featues included goal searching ("i'm hungry; let me look for one of those things that made me less hungry before"), prediction ("that thing over there looks as though it could eat me; i'd better stay clear"), agent detection, ("that odd shadowy thing over there could be a predator"), and feedback ("hey, here's a scenero that i've formed with my predictive models; what do you think?")

i believe that between feedback, predictivity, and agent detection, we form the basis for what we internally experience as 'mind'.

but i'm probably just imagining it ^_^

Wednesday, June 2, 2010

PopAtomic Fanservice

I wanted to help out Suzie Hobbs at PopAtomic get nice open-sourcable images for her 'rocks' campaign.  So... uh... here ^_^.

Thumbnails are images, links are in SVG format. If you're using a browser that doesn't suck, you'll be able to view them natively. They're Suzie's stuff, so respect her authoritay.

Additionally, I created a couple of my own inventions in similar veins. They are protected by Creative Commons.
Creative Commons License

Saturday, May 22, 2010

Mr. President, Close the Cycle

In response to the vapid republican presidential orders I've been hearing: "Mr. President, Do your Job", "Mr. President, Finish the Dang Fence", I've been thinking: Why aren't the republicans telling him to do something, oh, I dunno, useful?

For example, we have a political monster that rears its ugly head from time to time: storage of nuclear waste.  It's an artificial problem, really; Part of Carter's various obsessions as President was the prevention of nuclear weapons proliferation.  In his zeal in this regard, he made probably the most disastrous move for the United States' energy economy that any president has, ever.

On April 7, 1977, President Jimmy Carter banned the reprocessing of commercial reactor spent nuclear fuel.

Reprocessing is a neat trick. When you burn low-enriched uranium (95% 238-U, 5% 235-U) in a light water reactor, two major things happen:

  1. About half of the 235-U fissions, producing a melange of mid-periodic isotopes called "fission products"

    1. 90% of fission products decay to background radiation within a year
    2. 97% decay to background in 10 years
    3. 100% decays to background in 300 years.

  2. 238-U breeds to 239-Pu

    1. 239-Pu is an excellent reactor fuel
    2. 239-Pu is no more weaponizable than the 235-U that is normally present in nuclear fuel
    3. 239-Pu burned in a light water reactor is more valuable as energy than as weapons.
The fission products end up causing problems: they absorb neutrons that could be put towards fission, fouling up your reactivity controls, and eventually turning off your reactor.  As a result, you can only fission about 1% of your input mass - the rest becomes spent fuel.

Reprocessing is the act of removing the fission products from your fuel pellets, and recasting them into new fuel elements.  There's no need to remove the 239-Pu - in fact, you wouldn't want to.  239-Pu is an excellent fuel for light water reactors.

If we permit reprocessing, three things happen:
  1. The cost of running a nuclear plant goes marginally down; you can re-fission the same fuel over a hundred times.  
  2. The sustainability of nuclear power goes up - from 6 years at full burn to over 600
  3. Long-term storage of nuclear waste ceases to be an issue, as all of your input fuel eventually becomes fission products - most of which can be sold as industrial materials after just 1 year.
So, when I say, "Mr. President, close the Cycle", I mean permit reprocessing.  Close the loop; help get us off of foreign energy.

Monday, May 17, 2010

Blueberry Pancakes

Blueberry Pancakes recipe, engineer style, made for 3"x5" card, in raw HTML:

Blueberry Pancakes
Electric or stovetop griddle 1/2 tb unslt butter 1 c AP flour 1 t baking powder 1/2 t baking soda 1/4 t kosher salt 4 t sugar 1 lightly beaten egg 1 1/2 c buttermilk 2 tb melted sweet butter 1/2 c blueberries
Preheat griddle to 375°F, or over medium-high heat        
  Whisk together in medium bowl
Whisk just to combine. Do not overmix.
Sprinkle water, if the droplets bounce, it's ready.
Brush butter onto hot griddle.
Pour batter onto griddle, 4oz drops, 2" apart
Drop blueberries in cooking batter
Cook for 1 minute, or until underside is golden brown
Flip and repeat

Adapted from Smitten Kitchen's Pancakes 101

Concept shamelessly stolen from Cooking for Engineers

Thursday, May 6, 2010

Search-awareness, Twitter, Blogger, IE

Added a neat little trick to the site: Now, when you come here having searched from Google, the site automagically notices and calls out the words you were searching for within its content.

Simple trick, I know. I'm going to add similar functionality for other engines soon; this was just a proof of concept. Anyway, test it out; search for "Code Monkey Bryan" on google and check the call-outs.

I also added support for my Twitter status to be in the nav bar area of the About section.

Lastly, I migrated the blog to Blogger, with the site being populated by its RSS feed. Saves me the trouble of actually implementing a blog.

Meanwhile, I still have to break off the time to improve IE support. It's presently not there.

Thursday, February 25, 2010

Shoes for the Cobbler's Son

I've finally gotten around to building my portfolio site. It's only been seven years.

A chronic problem, I think with developers, is that we don't usually think that a portfolio site is necessary - and this is probably true. I think, however, that if on my next interview, this site is visible and available, I will be far more likely to be asked, "What was your role in Project X", rather than, "What projects have you worked on?"

I find the former to be an easier question to address, as it's a specific description of things I like to do, rather than a nebulous inquiry into the haze of past accomplishments.

Friday, January 15, 2010

Buying your own product

It says very little about a company dedicated to interactive web development when they farm out the development of their own website.  Like they have no confidence in their own talent, or faith in the value of their work.

Thursday, January 14, 2010


A problem I've come across more than once is scheduling of QA during the initial development cycle.

It's not that I don't think QA isn't useful - QA generally will catch many, many things that we developers skim across in an effort to get from one test condition to the next.

Honestly, I'm not even saying that if QA is scheduled, they shouldn't be testing; hey, go for it.  The thing is, I don't want to hear anything QA has to say until after we, the developers, have been over the first pass.  That is to say, bugs in pre-alpha code are not only to be expected, but generally just an artifact of yet-to-be-implemented stuff.

The fact is, though, if you have QA scheduled well before the first pass is over - say your manager thinks it might be "streamlined" to break the project into phases, each of which is QA'd after your team has had at it - you should push back hard.  QA will complain about bugs, and your team will be expected to break off resources to deal with them.  This will cripple you as you strive to meet your timeline for an Alpha RC.

This will be difficult.  Your project managers are pressured to deliver projects ahead of time; they want to earn a reputation for being efficient; they want brownie points from the next man up the ladder, who has the same incentives as he.  Your job, in this case, is to explain carefully why this model will not work - that preemptive QA is, at best, a needless distraction - and at worst, a labor vampire.  Explain that it's better to actually schedule out time, post-alpha, for the QA <-> Dev cycle to occur.  This, along with an honest assessment of the normal expected environmental difficulties, and an allowance for unforseen events*,  makes the initial timeline realistic - and any overtime inevitably result in the coveted early delivery.

Now, I understand that it's not always possible to get the deadline you're after.  We've all been in a situation where the expected completion date is reported as March, and the PM, or their boss, or the client demands something earlier, say November.

First, as a freelancer, I never stood for this; the client can demand any date she wants, but the site described by the resultant SLA would be far less than the client wanted.  When the client noticed this (as they usually would), I would explain that the more complete site carries with it the deadline I had originally proposed, and that if you want it sooner, you will get less.

Second, if a PM agrees to a date that is significantly earlier than the dev team estimates, that PM should not be allowed to retain their position: a manager who flatly ignores the advice of their primary resource is, failing any better word, incompetent.

Third, if you find you are a developer in a position such as this, craigslist has many, many open positions.  Look into them.