February 26, 2015
Commuting in the car means a lot of time spent accidentally thinking about how it could be improved. I’ve come up with several ideas for accessories, and this first one is useless but very fun. For some time I was planning a system where buttons on the dashboard displayed messages on the rear bumper. Stuff like “C’MON, REALLY?” to display to tailgaters, and maybe amusing stuff like “WHAT’S WRONG WITH THIS GUY?” when someone up ahead is driving poorly. It would be a pretty straightforward bank of switches plugged into an Arduino, and either a screen with pictures or (better) a train-schedule type letter sign, if those can still be found.
A few weeks back, however, I remembered that dog picture from the Internet that says “deal with it” when the sunglasses drop:
I realized there couldn’t be a classier way to respond to tailgaters than with a live-action version, so I decided to make one. It would be a simple Arduino project, with a servo that lowers the sunglasses over the eyes of a stuffed dog. Then a relay would light up the “Deal with it” text on cue.
Setting up the Arduino code and wiring the components didn’t take more than a few hours:
Then there was the simple matter of printing out some sunglasses and attaching them to a servo (cardboard backing, super glue, and a zip tie for the arm):
Finally the sign had to be prepared. I decided to go all out and buy a real neon sign, since that is totally fantastic and you can get them custom-built. The sign arrived with this nice label:
I also opted to buy a pre-packaged relay to switch the sign, since I’m not a trained electrician and you don’t want to trifle with AC power from the wall outlet. The PowerSwitch Tail II is great, you just plug in 5V and ground wires to the side and it works like an extension cord with a switch. The rest of the wiring was just a couple of leads going to 5V and ground, and one pull-down resistor for the button. I also got a 300 watt inverter to provide power from the car battery, and a big red button to activate the sign. Wiring it all together for a test run, it looked pretty good:
The sign turned out to be bigger than I had figured, and it takes up the whole back window of the car. Luckily it has a clear backing so my view isn’t obstructed. There’s still some polishing to go, but it’s working very well.
Nobody has tailgated me anywhere near the threshold level for sign-activation yet (perhaps this is rarer than I thought) but it’s bound to happen eventually. You know when you’re waiting in a line of cars to pass a slow-moving truck, and some chucklehead decides to tailgate you, so that maybe you’ll do the same to the car in front and so on (I assume)? The next time that happens to me, I’ll press this button on the dashboard:
And I’ll take my sweet time to finish the pass. Meanwhile the offending driver will see this:
February 21, 2015
The first is non-technical: teams at Facebook are using it internally to build very large systems like the chat application. The fact that the React brand of dog food makes up a large part of their diet means that it merits serious consideration. Other libraries like Knockout or Angular are not deployed at nearly the same scale within Microsoft or Google.
Of course, plenty of software tools see wide adoption because of fashion, so with React (and the proposed Flux architecture that goes along with it) we also have to look at the technical situation. Facebook has distributed some good media on this subject (see this video and the Flux documentation) but I get the sense that some of the ideas can be obscured by the vocabulary. I’ve seen “declarative” and “virtual DOM” and “immutable” too many times to count, but these might not communicate the relevant ideas to everyone. You might wonder: What makes React different if both Knockout and Angular use “declarative” markup too?
I think the central idea percolating through the community is stateless UI. React is designed to make it practical to move all state out of your UI components and into a separate, single place for each part of your problem domain (Flux calls these “Stores”). If you’ve ever encountered bugs with two-way view-model type stuff, eliminating these bugs is what differentiates this approach. For everyone else, let’s say you have UI components A and B that are bound to your application state (some view-model type stuff), and UI component A receives an update from the user. This propagates to the application state, and if component B is watching it will update as well. But what if component B also contains some state that component A is watching? Now A will update, and so on. In the real world more than two components are usually involved, and the potential for this behavior makes the program harder to reason about.
So then why do we need a special library? Can’t we just move the state out to a separate module and route every action through there (effectively making all bindings one-way)? The reason is that most libraries weren’t designed with that in mind, so throwing away the old state and fetching new state from an external source on every action means a lot of DOM operations, making for a slow application. This is where React’s virtual DOM comes in: you can go ahead and overwrite the state from your external source, and React will optimize what is sent to the real DOM.
More details will have to wait since I’m still learning the theory, but look into reactive programming for an extreme perspective on stateless UI, and check out the Windows message loop to learn about a precursor to the Flux architecture. Again, the technical reasons are important, but the easier argument to understand is that large teams at Facebook and elsewhere have had success with React (and Flux). Happy coding.
December 23, 2014
Interstellar is a gorgeous, tightly crafted movie with a clever story, exactly what you might expect from Chris Nolan. While the plot eventually veers into mystical territory, there are some very cool elements built around theoretical physics, time dilation, and higher dimensions. The soundtrack is captivating but unfortunately a bit too loud and cluttered.
Mr. Nolan’s movies tend to be stupidly ambitious, and it could be argued that only Memento has had quite enough substance to validate its ambition. I can’t possibly suggest that this is a bad thing, though. Most blockbusters these days play it way too safe with superhero remakes and guaranteed-profitable book adaptations. When you go to one of Mr. Nolan’s films (other than Batman I guess) you are pretty much guaranteed a genuine effort at filming something enormous and new. That’s worth the ticket price.
As with Inception and the Batmans, the majority of it is wonderful. The acting is executed with great skill, and the cinematography is pure delightful hedonism. All the outer-space business works to tell an epic tale about human potential, love, sacrifice and stuff like that. As with most Nolan movies, there are carefree plot holes and hand-waving explanations (“Collect the quantum data!”) that might make you go all “whaaaat?” but there are also more than a few great sequences based on valid mathematical and scientific principles.
[HERE BE SPOILERS]
The futurist idealism of Interstellar has gotten a lot of press citing general Neil DeGrasse Tyson-ness and quantum woo-ology, which (while that might be an accurate assessment) merely serves to endorse the general can-do space exploration theme. It could be argued that Interstellar ends up preaching the reductionist humanist theologism of Stapelton’s Star Maker and other fiction in that lineage. I would argue that if there is anything approaching a “theory of everything” in Interstellar, it might use that kind of futurist and even pantheist mythology, but it doesn’t ruin the story.
The best sci-fi parts involve a wormhole with what I assume would be accurate topology, meaning perhaps the coolest visual outer-space sequence I’ve ever seen. At the other end is a system of planets orbiting a black hole, which has these like orthogonal rings for some reason. I’m told a lot of theory and work went into this visual, and it’s very neat. Also the time dilation caused by the black hole’s gravity is leveraged for one of the best sci-fi movie plots in recent memory.
Still, a strong dose of *ahem* gravitas leads the end of the movie a bit far from its strong points, which are the relationships and the goals of the characters. Additionally, the science-esque reveal linking the mystical elements to the hard sci-fi falls flat, since all available evidence suggests that gravity travels in waves at the speed of light, not magically backwards in time. Normally I wouldn’t have much of a problem with nonscience in a movie, but since it plays such a central role in the plot that has to be mentioned. A better cut might leave out the attempts at explicitness and leave it vague and suggestive or even ambiguous.
The other part which might have been overdone is the sound. I saw it in IMAX and it was absurdly loud much of the time. If I see it again in theaters I’ll have to bring earplugs, which makes me feel Officially Old. The IMAX version of Interstellar is like sitting in an enormous blender while automobiles and boulders are dropped in at intervals. You can actually feel the space debris hitting you in the face.
All in all, Interstellar is another successful story from the steadfastly interesting mind of Mr. Nolan, and it is worth seeing if you’re into cool far-out space stories like 2001. But bring earplugs.
November 21, 2014
Here’s something I think the fuzzy shirts in the news are getting wrong. Last week President Obama and President Xi met in Beijing, and then a ludicrous explosion of PR appeared in the American news media, proclaiming that America and China had reached an agreement to save the noble polar bears from drowning.
It’s all very silly stuff and of course it has none of the significance of, say, a treaty, but the propagandists ran with the ball anyway. I’m not surprised about that. I don’t think anybody is surprised about that.
The surprising part is that everyone on this side of the Pacific seems to have lost the pea, so to speak. For example Charles Krauthammer is occasionally relevant about political things, but in this case he has gotten most of it exactly wrong:
The only way forward on greenhouse gases is global reduction by global agreement. A pact with China would be a good start.
Unfortunately, the Obama-Xi agreement is nothing of the sort. It is a fraud of Gruberian (as in Jonathan) proportions. Its main plank commits China to begin cutting carbon emissions 16 years from now. On the other hand, the United States, having already cut more carbon emissions than any nation on earth since 2005, must now double its current rate of carbon cutting to meet a new, more restrictive goal by 2025. In return for which, China will keep increasing its carbon emissions year after year throughout that period — and for five years beyond.
If this sounds like the most one-sided deal since Manhattan sold for $24 in 1626, you heard right. It becomes even more absurd when you realize that, according to the Lawrence Berkeley National Laboratory, China was on track to plateau its carbon emissions around 2030 anyway because of a projected slowdown in urbanization, population growth and heavy industry production. We cut, they coast.
First of all, and this is not the point I’m getting at, but state-sponsored pacts have not come close to reducing anthropogenic carbon dioxide as much as hydrofracking and horizontal drilling in recent years. Even if the fatalist nonsense indicated a problem, Mr. Krauthammer would keep on milling around charity dinners while it was solved by engineers, as usual. The “political solution” is just another desperate pitch to set up another bloated federal agency and create more public-sector busywork. But you already knew that.
The real point begins with what the engineers have already accomplished. Without a bit of legislation forcing them to do so, and with the EPA folks still harassing every single nuclear power project for at least the next two years, the Americans are probably on track to meet the goal of whatever percent of carbon whatnot by whenever.
The immediate question, of course, is whether President Obama was unaware of this fact at the time. The answer is of course not! Mr. Krauthammer might like to say that these folks are incompetent, but the idea that they could be that incompetent confounds the imagination. There is nothing in this phony deal that puts the United States at a disadvantage.
This is quite a concession from President Xi, however. China still builds a coal plant about every week, and they are announcing to the rest of the world that they will match 20% of that output with “renewables” in some 20-odd years. This means that while their mandatory turbocharged baby-boom generation is collapsing, they will have to do one of the following: spend lots of money on energy R&D, spend lots of money importing foreign power plants, lie about it, or pretend all this never happened.
Even considering the fracking contraptions which allowed President Obama to make such an impressive pledge, it seems like it should have been much harder to get President Xi to promise not to walk out of next year’s stupid climate summit. At least until you leave the bubble and read about what else happened during that meeting. In summary:
US President Barack Obama reiterated on Wednesday that the United States does not support “independence” of Taiwan and Tibet.
Just another day of work for these jackasses.
P.S. This is mostly speculation from someone without any relevant qualifications. Please do stop by the comments, Mr. Krauthammer, or whoever, and point out where I’ve made an error. But don’t bother mentioning that I don’t have a PhD if it’s all you have to say.
UPDATE: It appears I might have been wrong about the latest trends in China. It looks like they’re already signing contracts to build a great number of fission plants in the coming years, which will (hopefully) mean a big reduction in coal development, and therefore cleaner air regardless of any of these geopolitics. Good for them.
August 10, 2014
Sometimes an architect has a wide-open space, a large budget, and unlimited freedom to design a structure. In these cases established best practices will lead to a technically impressive result. Looking at the Burj Dubai, the appearance is of a very tall structure which required engineering expertise and advanced materials to build. With this sort of tower superproject, genuinely new and unexpected patterns are comparatively rare. The technology and academic literature certainly progress as in other fields, but the result of one of these projects is pretty much what you would expect: a very tall structure on a flat foundation.
Now consider a heavily constrained project, like Frank Geary’s fallingwater house. In this case the client requested a house that fit on a unique piece of land, with forested hills and a waterfall going through the property. You might guess that limiting the possibilities available to the architect would produce limited results, but the reality is exactly the opposite. In those unique circumstances, Geary produced the famous cantilevered design and spectacular proportions which endure as iconic examples of the craft. I don’t want to suggest that one can design a skyscraper without any creativity, or build the fallingwater house without any engineering skill. In fact both projects require a great deal of both abilities. I will suggest that the skyscraper requires comparatively more of the engineering part, and the fallingwater house requires more of the creative part.
Here there is an analogy with other disciplines. Architectural concepts apply to any situation where complicated systems of interacting components have to be designed. Courses of education, business processes, and software systems are some examples.
Working programmers dream about having unlimited resources and freedom to build monumental skyscrapers of software design, but reality does not often accomodate these fantasies. Schedules and budgets are limited, often severely. Large systems usually include legacy infrastructure which was not intended to perform the task at hand. Instead of designing with a blank slate, working around these limitations makes up the bulk of a programmer’s day to day experience. I would argue that the reality makes professional programming a much more creative pursuit than it might seem after reading the textbooks and papers. This is good! It makes the job interesting and even fun at times.
The Ludum Dare competition is a great example of the same phenomenon. Each round the participants vote on a thematic constraint to impose on their game projects. Together with a deadline, this limitation acts as a catalyst for ideas. If I’m asked right now to come up with an arcade game, it probably won’t happen soon. Ask me for a game which has, say, a theme of “Escape” or “Tiny world” and the ideas come a lot faster.
The point is not just that constrained projects demand the creative side of architecture, but also that limiting the scope of a project can encourage creativity. The next time you find yourself at a loss for new ideas, try imposing some arbitrary constraints. It will probably help.
April 29, 2014
Here’s a game I put together over the weekend for Ludum Dare 29. The theme for this weekend was “Beneath the Surface” and the idea was to make an outer space fracking game.
You are controlling the latest in space fracking technology, a little rover with the task of retrieving space resources from a moon or asteroid or whatever. Use your shockwave (
spacebar) to frack open the resources, and then drill (
shift) to extract the resources for processing. But watch out for enemy rovers sent by rival corporations!
The enemy rovers are a less sophisticated model without cutting-edge fracking technology, but they have been extracting all the available resources for a while and will not hesitate to hit you with a shotgun blast and steal all your newly fracked resources. Avoid them carefully, or use your shockwave to blast them out of the way!
Watch out for the space fracking protesters, too. You don’t want to cause a PR disaster by accidentally running one of them over!
Play the current build here: http://guscost.github.io/spacefrack
Vote for Space Frack: http://www.ludumdare.com/compo/ludum-dare-29/?action=preview&uid=31734
January 18, 2014
Words are funny things. I think they function as little encodings of shared cultural experience, as I’m sure I’ve said before. This means that weird stuff happens when we try to translate certain words from one culture to another. In American English land we might enjoy total dominance of teh interwebs, but that doesn’t mean that other cultures haven’t embraced ideas which are much harder for us to understand.
As an example consider the German word “schadenfreude.” Transliterated it could be written as “harm joy” or “misfortune joy” or something like that. However for english speakers that doesn’t adequately convey its meaning. Does it describe some kind of catharsis which might accompany bad luck? In fact it does not. Rather it describes the enjoyment one might derive from witnessing another’s misfortune.
These words make interesting case studies especially when studying translation as a discipline. Germans might have adopted this phrase-word-whatever as a witty way to describe something that actually happens rather often, but it takes many more English words to describe the same phenomenon, because we haven’t absorbed the idea to the same extent. Interestingly, I would say that this means most people are wrong when they say a certain word “has no English translation.” It almost always does, though that translation will invariably require many English words!
There is a Portuguese word “saudade” which describes a certain longing or melancholy or nostalgia, usually for something or someone from the past, but also towards the transcendant and abstract. This word has no English equivalent, but the extended definition could be substituted in many cases. This awkwardness results in the phenomenon where meaning is “lost in translation” and it leads to the idea that certain translated works are never as good as the originals.
However we can also just steal these words from their respective languages and use them to denote the foreign concepts in our own language! The Oxford English Dictionary includes both “schadenfreude” and “saudade” and these days they are often used as valid English words in the appropriate context. This is one way that a language evolves to describe new concepts, and it means that there are no words which will never be “said” in some language. What is missing is often any mainstream understanding of the true definition, and the shared cultural experience which it conveys.
I don’t really have a simple point to make here, but the idea that any given language is “missing” certain words is very interesting. If you’d like to broaden your vocabulary in your native language, look to these interesting ideas from other cultures, and find some cool new words to steal!
December 15, 2013
There’s a lot of buzz about Bitcoin and its significance lately. At the time of writing the MtGox price per is around $900 after briefly going above $1000 last month. I’m no economist (or investor – I sold most of mine way too early!) but it seems like the issue here has to do with relative demand for different financial instruments, specifically stores of value and mediums of exchange.
What is called a “store of value” I would describe as a kind of hedge, a financial instrument used to offset the risk associated with some investment. In this sense stores of value are hedges against losses on investment of time spent building wealth. The investor uses them to handle the risk of that wealth losing purchasing power, due to inflation or sociopolitics or whatever. The most famous store of value in history is elemental gold, which is scarce, shiny and useful (and therefore valuable) because of geology and physics and chemistry. This means that no human institution is required for gold to be in demand, and so nations still stockpile massive amounts in places like Fort Knox as a hedge against market disruption. Some citizens have been converting their own wealth into gold, especially since the value of dollars was decoupled from the stockpile in Fort Knox.
More recently, US dollars have served reasonably well as a hedge against instability elsewhere in the world. During the depression in the 1930s, people who trusted banks to store their wealth ended up regretting that decision, and those who kept cash in mattresses and walls made out comparatively well. Since then a culture of stockpiling cash has arisen, and historically the US dollar has been the favorite for its perceived stability. While this store of value provides a great deal of liquidity and quite reasonable portability, it can only be as reliable as the institution of the United States, and because the FDIC guarantees bank deposits there is not much reason to trust paper dollars as a better store of value than a standard US bank account.
Perhaps for this reason, Bitcoin has grown from a cryptography experiment into the hot new digital alternative to gold. Like gold it relies on mathematics and computer science rather than the authority of a government, but unlike gold it requires the existence of an information network like the Internet, and leverages that technology to enable much higher liquidity. In the long-term view it seems to function as a hedge against the marginalization of existing institutions and material goods caused by Internet and new technology.
I’m focusing on stores of value with medium to high liquidity, but there are certainly other options. Collectible goods like art and vintage instruments are popular, as is real estate. The value of these investments is necessarily non-zero (at the very least they can be used to build a fire) and determined by market demand. Still, no investment is risk-free and every one of these examples could lose value dramatically in the right situation. America recently went through a boom-bust cycle in real estate and many investors went bankrupt. Wealthy Chinese have been pouring their wealth into real estate for decades, the result being a market where not enough people can afford the hugely inflated housing prices and the bottom could fall out at any time. A non-trivial amount of that wealth is now moving into Bitcoin, which is probably the dominant cause of the recent spike.
In the case of cash, the primary risk is that the government will destabilize and/or the Fed will “ease” all the value out of those mattress dollars. As that risk was discovered commodities rose in value, most notably gold. It is still unclear exactly how much of the trend is due to devaluation of the currency and how much is due to speculation and fear.
In the case of gold, the practical applications might prove less useful than the price can justify, which would adversely affect its market value. In the extreme case, mass-produced alchemic gold could even end its reign as the definitive precious metal. That seems far-fetched right now, but I can’t honestly say it is entirely outside the realm of possibility. The technology to manufacture diamonds is orders of magnitude less sophisticated, but it did not exist a century ago.
In the case of Bitcoin, the most threatening eventuality is that the Internet goes dark and the blockchain ends. This might be even less likely, but many of the gold investors are also stockpiling guns and food so they are evidently thinking along those lines. If SHA-256 is broken the implications on digital security and the Bitcoin economy would be devastating as well. A less threatening situation might involve the lack of adoption by legitimate businesses and/or banning by governments. This would push the Bitcoin market further into illegal territory, but where there is money there will be money laundering so it wouldn’t necessarily shut down the market.
In summary, the best way to store value is never known and can only be determined in retrospect. It might involve more than one method, since bitcoins can function as a traditional hedge for dollars and vice-versa. Personally, most of my (modest) capital is stored in manufactured goods, with a bit of old-fashioned mutual funds and a tiny slice of other investments. If I sold these assets tomorrow they would raise much less value than the equivalent amount invested into gold bullion (or bitcoins), but I hope that won’t be necessary. Not having to provide for a family at the moment is convenient.
However, by far the most valuable things I have acquired are my skills. It seems like a decent market position to be in these days, but of course there is still the risk of being paralyzed in a car crash. I recently bought a new set of tires to mitigate the risk, so we’ll see how that works out.
BTC donations: 1LF6NC8wC8s3E77QSFqCJY3BMhSVuH4JEV
October 16, 2013
If you’re listening to the news lately, you could be forgiven for thinking that America “needs” to extend its line of credit by raising the debt ceiling again. This is an absolute mockery of economic planning. Does anyone still think it will actually improve our situation?
The most astonishing part is the fact that pundits are talking about raising the debt ceiling in units of time! It used to be described as an increase of however many billions of dollars. This latest plan will raise the ceiling until “February” or thereabouts, whatever that is supposed to mean. Do you realize the dollar figure isn’t mentioned anymore because it has become so embarrassing that people don’t want to acknowledge it?
I can’t get over how ridiculous the whole thing has become. It’s like if a drug addict was asking me to borrow money and saying, “With this I should be good until Tuesday.” How can a person not conclude that they will in fact be wasting it on more drugs? Yet we keep handing over cash for the next fix like a bunch of ashamed tourists.
Unfortunately, the only rational thing to do is to go cold turkey as soon as possible. Banks are now basically being paid to sit on over $1.8 trillion in “excess reserves” provided by our national borrowing binge. However many more fixes these junkies can score, when equilibrium is finally restored the withdrawal is going to be pretty intense.
What a stupid, pointless debate.
UPDATE: It turns out that the “February” language is not just a media euphemism, it’s actually the letter of the law! America has effectively deemed itself worthy of unlimited credit until the provision expires early next year.
August 19, 2013
One of the nicest things about living in 2013 is the fact that computer hardware is cheap. Cheap enough that buying an extra computer to sit next to your TV or toaster or up in a weather balloon isn’t much of an expense to the average consumer. The Raspberry Pi is among the most popular and dramatic examples of this revolution, but compelling alternatives like the Beaglebone Black have been arriving on the market recently.
I’m interested in these little gadgets because they make electrical engineering and embedded systems a lot of fun. The possibilities are mind-boggling with the available cheap hardware, and working on random electronics projects is teaching me more about electricity than school ever did. Current is just like the amount of water flowing through a pipe, and voltage is like the pressure difference between two sections! Resistance is the diameter of the pipe or something like that. I never liked all the confusing homework problems with those abstract circuit diagrams because it seemed arbitrarily complicated. Now I’m actually learning how to read and write the language because knowing circuit design is necessary in order to build things.
A major in electrical engineering would probably involve quite a lot of lab work, but the mandatory textbook material makes it less accessible than it could otherwise be. I don’t mean to say that there is no use for a rigorous course of education – it obviously minimizes the inevitable gaps in domain knowledge. Still, unless you’re intending to find a salaried job in the field, it’s a lot cheaper and a lot more fun to just order a good soldering iron and pick something to build.