Thursday, December 1, 2011

Add Some Keys to Those Clicks

This is the same mouse test as before, but I've also added some keyboard behavior. Pressing the number keys displays a number in the corresponding box. (The numeric keypad keys do not, just the ones in the top row of the keyboard.) The different shape of the grid is intentional. The appearance of the boxes, and consequently the mouse hit detection, gets computed from the width and height of the canvas as described in the HTML rather than being defined on the JavaScript side. This is a minor little example of separating appearance and functionality.

Sorry, you browser does not support the canvas element, you will not be able to see this demo.

Bachelor Chow: Corp. Joe's Chicken

Today's experiment in turning a bunch of mostly pre-made ingredients into something greater than the sum of their parts went quite well. For future reference, I present Corporal Joe's Chicken.

  • Shake and bake chicken, hot and spicy style, prepared as nuggets (cooks faster that way too).
  • Veggie fried rice consisting of frozen "stir fry" vegetable medley of your choice, stir fried with a touch of ginger powder, adding cooked instant rice and a light amount of soy when the veggies are done.
  • Mix 50/50 soy sauce and hoisin sauce, heat for a couple of seconds in the microwave so they will blend, drizzle over chicken to taste. Optionally add red pepper flakes and onion flakes or chopped fresh green onions to better emulate Tso chicken's flavor.

Wednesday, November 30, 2011

There's Another Wave on the Horizon

Sometimes new technology catches you by surprise, but often you can see it coming if you know where to look (or just get lucky). I first learned about the devices referred to as three-dimensional printers during my time at Clemson in the mid-90s. Basically, they work by building objects up out of 2D slices. Think of how medical imaging such as MRIs work, and then use those as blueprints. Indeed that is exactly what they were researching when I was given the tour: using medical data as inputs to create custom prostheses. Cost and limits in resolution and usable materials have restricted applications, so far. But the idea of a device that can build anything (of a certain size or below) sounds like another one of those Star Trek dreams that is destined for reality. Now I read that costs for 3D printers are now below what laser printers cost in the mid-80s, and there are companies starting to use the devices in a more consumer facing way, including one that will allow you to order custom built ceramic-esque robots. (Incidentally, to dovetail my own recent posts, the software used to customize the robots also serves as an example of using cutting edge of web programming tools too.)

Imagine a world thirty years from now when anything smaller than, say, a soccer ball can be designed and produced in your home. Imagine a world where designs are shared on web pages and/or in design stores that mirror today's mobile application stores. Of course, the real trick will be imagining what the manufacturing sector looks like after that comes to pass...

Monday, November 28, 2011

A Delve into Some Details

My last programming post was a bit of an upbeat ramble in response to a question about the previous post which was a bit of a grumpy gripe. I would like to revisit that gripe one last time. Javascript DOM event handling started me down the road to Crankyville, so allow me to reflect on some of the minute straws my camel was carrying that day.

When learning languages and programming interfaces, I naturally tend to use Google as my easiest reference when poking around with new things. Unfortunately Google is like high school: it confuses popularity with authoritativeness. The number one link when searching on the topic of JavaScript event handlers shows an example that looks essentially like this:
thing.eventHandler = function (eventData) {
  var local1, local2;
  if (!eventData){
    var eventData = window.event;
  //The magic happens.
I want to be clear up front, this works and turns out to be perfectly correct, but it still bothered me. Being a professional programmer cultivates a certain amount of anal retentiveness in you. Computer code does exactly what you tell it to, not what you meant it to. Plus, not all languages are strict about checking whether you are making sense or telling it gibberish before going off and potentially wrecking things. In this case, a couple things set my programmer sense off, and they are both related to that if statement above.

First, the reason you have to have the if statement in the first place: WebKit browsers pass event data as a parameter to the event handler function, but Gecko browsers store event data in the window object's event property. The if statement checks to see if there is data in the parameter, and if not attempts to retrieve it from the window property. I have not bothered to look up whether this comes about because of competing standards or too-permissive specifications, but either way the situation has to be handled. And it has to be handled every single time. Compatibility issues of this sort are certainly nothing new, but they do nothing but add code. Picking one style over the other does not break the old code because both cases are covered, so why not declare one the winner and move forward without needing the additional testing. (Note to browser vendors: pick the parameter form. I suspect using the global window.event will interfere with any potential attempts at parallel processing events. Not to mention using globals is just bad form.)

The second issue is much more subtle, and much more just me being a jerk about these sorts of things. The function has a formal parameter called eventData. The function declares a variable eventData. Thus eventData appears to have two different definitions in the same place. Programmers refer to visibility of things as the "scope" of those things. JavaScript has two types of scopes, visible to everything everywhere (global scope) and visible only within the function where it is declared (function scope). When I see two different definitions of something in the same scope it get an ache behind the eyes. Thankfully, it turned out I was not alone in that assessment. I mentioned Douglas Crockford's JSLint tool previously in passing, and indeed it flags eventData in the code above as being re-declared. The question then became: why this is flagged as bad style but not actually an error. JavaScript, I learned, allows the redefinition of things within the same scope; the second definition is essentially ignored and the system uses the thing already given that name. In this code, it is not a problem. In long, complicated functions written by people used to different rules from different languages, I can see this causing subtle defects. And so could Mr. Crockford. Having someone backup your gut feelings is always nice.
thing.eventHandler = function (eventData) {
  var local1, local2;
  if (!eventData){
    eventData = window.event;
  //The magic happens.
In the end we get the above code, with one problem solved, and one problem not. The change is quite subtle, but it makes those aches in my head go away. As for the piece not solved, well, what can I say? Learning to cope with things you can't change is just as much a part of being a programmer as in any other aspect of life.

Saturday, November 26, 2011

Music I'm Stuck On

I post music that catches my attention from time to time, but it occurs to me that I have never posted the bands that have grabbed the lion's share of my listening time for the past several years. My problem now is narrowing down the song list to just a couple, because I sincerely love large swaths of both bands' catalogs. These choices are not necessarily representative, but simply ones I listen to over and over.

The Finnish band Nightwish combined power metal with classical influences and operatic female vocals to become one of the primary archetypes of symphonic metal.

The Dutch band Within Temptation came from the gothic metal side of the coin around the same time and again features a stellar female lead.

Monday, November 21, 2011

Sometimes a Little Wrong is Totally All Right

Responding to my previous grousing over the irritations of basic web programming, reader Lee asked, "Do you think these tools/standards developed in relative isolation from each other? Or at least lacked active cross-talk among those developing them?" Interestingly enough, exactly the opposite is the case. HTML, CSS, and JavaScript evolved together, with massive feedback from people actually using them. So how did we get into a situation where people in the industry consider JavaScript broken and CSS a huge mess? I think I have a theory, which comes in two parts.

Theory Part the First: Redefining Explosive Growth
One could make a case that the Internet as a Thing with a capital 'T' has redefined our lives in fundamental ways. People call it "The Information Age," but I don't know that we really stop to think about just how young Web technology is. Tim Berners-Lee created the first HTML specification and browser in 1990. The JavaScript programming language, created by Brendan Eich in less than two weeks, first appeared in Netscape's browser in late 1995. Of the three core Web content technologies only CSS emerged out of a committee, being partially chosen from and partially created out of competing style sheet standards by the World Wide Web Consortium in the late 90s. In less than twenty-five years we have gone from particle physicists cross-referencing papers to "social media."

I'm no history expert, but I suspect that rate of technology adoption is completely unprecedented. Throughout the brief history of the Internet, people have wanted to use it for more than it was intended. Designers used to want their pages to look like magazines and newspapers, now the requirements are beyond that. We want our phone- and tablet-enabled web pages to behave like interactive movies, respond to our desires and even our voices, and do things that used to be the solely in the realm of highly-optimized, stand-alone applications.

Of course, the extreme pace comes with a consequence: the standards have a hard time evolving fast enough to keep up. Even today the big three browser back-ends, Microsoft's Internet Explorer, the Open Source Webkit engine (used in Google's Chrome and Apple's Safari among others), and Mozilla's Gecko, each support different features, often in slightly different ways. Many of these features are already in use, like the canvas demos I have been doing here. Those canvas demos do not work in IE because the canvas's HTML element and JavaScript programming interface are emerging additions to the standard. Under such conditions, it should come as no surprise that some of the t's are not quite crossed and a few i's have not been dotted.

Theory Part the Second: Which do you Prefer, Better or Working?
In addition to the technological problems associated with the explosive growth of the Web, there is a second consequence. There are, at any given time, millions if not billions of pages on the Internet using now outdated technology and tons of users using outdated browser software. This brings in the old debate over preserving backward compatibility versus breaking the old stuff to improve things going forward. Way back last century, Joel Spolsky wrote about this problem as it pertained to everyone's favorite example of a giant computer company, Microsoft. The sheer size of the Internet gives it tremendous technical inertia, making it very difficult indeed to make wholesale changes. For example, XHTML tried to improve the HTML standard, but ultimately became a useful failure that was absorbed back as an option in the broader HTML spec.

The expansion of the role of the Web is a testament to the soundness of the underlying designs, but nothing can be improved forever. Inevitably old technology accretes changes until it reaches a point of no return where it becomes more costly to modify/repair the existing system than to replace it. The trick is figuring exactly when you have hit that point. Google is hedging its bets with its Dart programming language while continuing to support improvements to JavaScript. Microsoft is betting that HTML5/CSS3/JavaScript are the way forward by using them as the UI tools for Windows 8 (in the process invoking the same dilemma with developers using their existing APIs). The W3C itself has pretty much given up, declaring HTML a "living standard" which fights to converge working implementations rather than hand down the specification to the browser vendors and web developers.

Caught between rapid innovation and massive uptake, the tools that were chosen were the tools that were available. HTML, JavaScript, and CSS were there for us when we needed them, and there are too many fields being plowed to allow the workhorses back in the barn. Web programming was cursed by astounding success.

And what a success it has been. This stuff may be the most visible raw innovation ever. Anyone with a computer can open a text editor and write code to run in a browser. Thousands of people around the world have changed their lives by doing just that, and it has only just begun. The browser is a development environment that exists in literally every computer shipped today. As more and more companies converge on the Web, the standards will continue to improve and the standards will continue to be left behind. And the programmers? Well, we will continue to be faced with stupid edge cases, ugly work-arounds, odd incompatibilities, and the abiding satisfaction we get when things actually work.

Post Script
Lee also asked about resources I have used learning what little I know of web programming, so I'd like to add a bit of a link-dump here at the end.

Of course, I'm willing to attempt to answer questions as well, though if you go through all of that, you will probably know a fair bit more on the subject than I do.

Sunday, November 20, 2011

Quote of the Moment

"Hope is a decision we make, a choice to believe that God can take the adversity, the disappointment, the heartache, and the pain of our journeys and use these to accomplish his purposes."  —Adam Hamilton, The Journey: Walking the Road to Bethlehem.

Thursday, November 17, 2011

Clicking and Wrapping

Your browser does not support the canvas element, so this example will not function.

Another day, another JavaScript/canvas experiment.  This time around it's all about clicking squares with your mouse. Go ahead, click the squares. In general, this tiny example of hit detection using mouse events would not be worth even posting, much less talking about, but it illustrates some of my issues with the development world moving in the direction of HTML5/CSS3/JavaScript interfaces for everything.

I will leave the debate over the worthiness of JavaScript to people more knowledgeable than myself. Instead, I will gripe about using DOM events. In my little example here, if I want to let the canvas element handle mouse clicks, I just attach a mouse click event handler to it and I'm off to the races, right? Naturally, it isn't that simple. First, there is no standard way for the event's information to be passed into the event handling function.  Mozilla does it one way, Webkit another. Once you work your way past that with some boilerplate code that has to be repeated every time, you get to the bit that really made me tired. The event data for the mouse click, though attached to a particular element of the page, does not actually have any relationship to the element. Click a mouse on the canvas, and you have your choice of receiving coordinates for that event in  relation to the browser window or the browser client area, neither of which is actually useful for figuring out where in the canvas the mouse click happened. The example I got working walks from the canvas element up the DOM tree until it finds the body element, adding up the coordinate offsets as it goes, then adds the browser window padding to get the location of the canvas in window coordinates, which in turn are used to calculate the click position relative to the canvas's coordinates. Sigh.

Presumably, this lack of local coordinates has something to do with the event bubbling mechanism in the DOM. Or perhaps it is just laziness in the implementation that forces the programmer to manually calculate an element-relative mouse position rather than having the library do it. My ignorance about why this behavior would be desirable is an ever-present third possibility. In any case, the DOM and CSS are filled with these little oddities and incompatibilities.

People's answer for such irritants remains the same everywhere I've seen it: create utility functions/libraries/frameworks that overlay the standard interfaces. To be clear, I don't mean extensions that add functionality, or even things that simplify for specific purposes, but rather things that seek to provide exactly the same functionality in an "easier" or "better" way. Generally, I take a proliferation of such "utility" wrappers to mean that folks are hiding problems that might be better off fixed in the standards themselves.

Most of the time, programmers or even groups of programmers do not have the capacity to update the standards. We can't all be part of the W3C, for instance, and nothing would get done if we were. That said, judging by the number of available wrappers I'm seeing in my brush with web development, I suspect the debate over the future path (or death) of JavaScript may be even more important than people realize.

Tuesday, November 15, 2011

Keeps on Ticking

My experimentation with HTML5's canvas element and Javascript continues with this analog-style clock. I don't have much to say about the code save that I treated the canvas as a plain raster device and there may be easier, or at least different, ways to generate the clock face using rotations. If there is anything about it you would like to know, feel free to ask in the comments. For another analog clock example that does not use canvas at all, see the timing events page of the W3C's Javascript tutorial.

Your browser does not support the canvas element. This post will not display correctly

Wednesday, November 9, 2011

Quote of the Moment

The woods would be very silent if no birds sang except those that sang best.  --Henry Van Dyke

Tuesday, November 8, 2011

LEDs and Solar Power, like Chocolate and Peanutbutter

ArsTechnica's look at the LED lighting landscape includes some nice tidbits on the current state of florescent lighting as well and is well worth a read, if only because it gives a glimpse into how the next generation might be decorating their houses.  Judging by the product lists available at the big box home improvement stores, we still aren't quite there yet, but the selection is getting better slowly.  LED lighting just makes sense, even if it does cost more at the moment.

The Navy's recent experiments into more energy efficient forward base designs noted the combination of LED lighting and integrated solar cells dramatically reduced both the power footprint and soldiers' battery use.  The general upward trend of fuel costs and the global economic slowing appear to be combining to encourage alternative energy sources.  The business opportunities surrounding alternative power generation seem to be taking hold, enough so that Slashdot featured a roundup of sources demonstrating a quickly growing US solar power industry.  Even Google wants to get into the game, by owning and subsidizing consumer solar installations, essentially turning themselves into a distributed utility.  Politics play a part as well, and several potential examples of shady political dealings have not stopped the government from continuing to push solar subsidies.

Lower power draw lighting solutions fit naturally into the futurist vision of ubiquitous photovoltaic power generation, and slowly economic and political forces are beginning to line up to make the changes happen.

Monday, October 31, 2011

A Little Something Scary for Halloween

Zombies, vampires, ghosts.  These are the fodder for the usual Halloween stories.  But there are some stories that people don't want to tell on this night.  Stories that could shake the very foundations of your reality.  You already know where to look to find these stories, but you avoid it.  You watch your Real Jersey Shore Housewife Wipeouts and smile, because the specter that is too horrible to contemplate looms ever just over your shoulder.  Oh yes, you can't escape it.  It's... it's... the news.  Duh duh duuuuuuuuh!

Obviously, there are bad things afoot in the economy, the worst seen in quite a while.  But I was surprised to see some comparing the current economic conditions to the failure of communism in eastern Europe.  Opinions vary, from it's alive, just not for us to my personal favorite about the myth of eternal growth, and the debate is nowhere close to being finished.

Perhaps you are an optimist about the economy or just find the whole debate a bit abstract.  Well what if I told you that a magma pocket under a volcano in Bolivia is filling at the rate of 27 cubic feet per second.  And that volcano is part of a cluster of volcanoes that form a potential super-volcano.  This particular super volcano last erupted about 300,000 years ago, spewing out a thousand times more material than the famous Mt. St. Helens eruption.  Also, the super volcano erupts on average about once every 300,000 years.  Should a super-eruption happen, it would be a natural disaster on a scale that literally has not happened since before the dawn of mankind.

OK, you've had enough of the scary stuff.  I get it.  Tomorrow's just Tuesday.  Here, have a listen to the world's most relaxing music, at least according to UK scientists.

Thursday, October 20, 2011

Reaching for the Stars

While it is quite true that every journey in life begins with a single step, sometimes when you want to reach the stars...

Sorry, your browser does not support the canvas element, so you are not seeing the thing that's supposed to be here.

taking a second one can make all the difference.

Sorry, your browser does not support the canvas element, so you are not seeing the thing that's supposed to be here.
For posterity, here's the parallax star field code:
    Hi! This is also a canvas:<br />
    <canvas id="canvas2" width="320" height="240">
    <script type="text/javascript">
      var sf = {};//short for starfield, used as a namespace/pseudoclass.
      sf.numStars = 50;
      sf.brightStars = [];
      sf.midStars = [];
      sf.dimStars = [];
      sf.canvas = document.getElementById("canvas2");
      sf.context = sf.canvas.getContext("2d");

      sf.initStars = function(){
        var canvas = document.getElementById("canvas2");
        var i = 0;

        for (i=0; i<sf.numStars; i++){
          sf.brightStars[i] = {
            x: Math.floor(Math.random()*sf.canvas.width),
            y: Math.floor(Math.random()*sf.canvas.height)
          sf.midStars[i] = {
            x: Math.floor(Math.random()*sf.canvas.width),
            y: Math.floor(Math.random()*sf.canvas.height)
          sf.dimStars[i] = {
            x: Math.floor(Math.random()*sf.canvas.width),
            y: Math.floor(Math.random()*sf.canvas.height)

      sf.moveStars = function(){
        var i = 0;

        for (i=0; i<sf.numStars; i++){
          sf.brightStars[i].x = (sf.brightStars[i].x + 4) % sf.canvas.width;
          sf.midStars[i].x = (sf.midStars[i].x + 2) % sf.canvas.width;
          sf.dimStars[i].x = (sf.dimStars[i].x + 1) % sf.canvas.width;

      sf.clearCanvas = function(){
        sf.context.fillStyle = "#000000";
        sf.context.fillRect(0, 0, sf.canvas.width, sf.canvas.height);

      sf.drawStars = function(){
        var i = 0;

        //Draw the stars.
        sf.context.fillStyle = "#aaaaff";
        for (i=0; i<sf.numStars; i++){
          sf.context.fillRect(sf.brightStars[i].x, sf.brightStars[i].y, 1, 1);
        sf.context.fillStyle = "#aaaaaa";
        for (i=0; i<sf.numStars; i++){
          sf.context.fillRect(sf.midStars[i].x, sf.midStars[i].y, 1, 1);
        sf.context.fillStyle = "#aa7777";
        for (i=0; i<sf.numStars; i++){
          sf.context.fillRect(sf.dimStars[i].x, sf.dimStars[i].y, 1, 1);

      sf.drawFrame = function(){
        setTimeout(sf.drawFrame, 60);

      //setInterval(sf.drawFrame, 250);

Tuesday, October 18, 2011

It's Finally That Time of Year Again

Fall arrived in fits and starts this year, but it appears that it is going to finally take hold this week.  As usual, when Halloween begins creeping closer on the calendar, the desire to walk paths a little off the beaten track kicks in.  This year, I present a couple of looks back to the last century.

If you are the sort who enjoyed Luke Skywalker's or Indiana Jones's adventures, recognize the name Flash Gordon, or doesn't picture a fiber overdose when you hear the phrase "pulp serial adventure" you might just enjoy the web series The Mercury Men.  In 1975 mysterious, hostile beings appear in an office building; what nefarious plot have they hatched?  Only the dashing guy in the flight jacket with the fancy pistol can save the day, but he can't do it alone...  The series attempts to evoke the vibe of the old movie serials, and it pretty well knocks it out of the park, complete with the dodgy pacing and somewhat stiff acting.  I suspect at least part of that is on purpose.  Given the tiny budget for the series, the villains are exceptionally well done, and there are some real classic sci-fi moments in the series.  And hey, at less than ten minutes per episode, if you don't like it you won't have to wait long to find out.

If pulp fiction isn't your cup of tea, how about a dose of what once passed for reality?  Visiting topics from the RAND corporation, to drugs, suburbs, flying saucers, and nuclear war, writer Ken Hollings's Welcome to Mars provides a twisting trip through science, science fiction, and culture in the early years of the cold war.  I recommend using iTunes for ease for access, but they are also available via a link on the author's blog.  It really makes one wonder what people fifty years from now will see when they look back on the first decade of this century.  Did I mention there is theremin music?

Saturday, October 1, 2011

Video Interlude: Things That Wouldn't Have Been

I wonder if the scientists and engineers that created the Internet really ever suspected it would provide a new outlet for creative people to be creative in the ways we are seeing now.  Thankfully, it did.  Whether by coincidence or rising demand, the digital film revolution happened alongside the growth of computer storage and connectivity.  All of this together has made becoming a competent amateur at all manner of things far easier than it was in the days when knowledge was less motile.  And for professionals and weekenders alike, the tools are getting ever cheaper.  So today I have a trio of videos that wouldn't have been nearly as easy to create a decade ago.  They are all very different from one another, and they are all very, very awesome.

First up we have "LOSSES", a short action film by the folks who do Revision 3's Film Riot show.  (Itself a source of knowledge for those interested in film making.)

Second, SanguinDrake's haunting "Brand New Truth".

And an upbeat note to take us out, "it tastes like heaven, but it looks like..." The Bacon Song.

Saturday, September 3, 2011

Vaccine Worries and Hopes

Vaccines are miracles of modern medicine, but like all medicine not everyone reacts to them the same way.  As the number of recommended or required vaccines have increased, so too has resistance to them.  Unfortunately, vaccines can only be truly effective if they are administered comprehensively.  When only part of the population is protected, the diseases have the chance to survive and adapt.  Indeed, the claims against the MMR vaccine have apparently resulted in outbreaks of measles this year.

Even when vaccines are effective, they aren't always effective for long.  The flu vaccine, famously, must be refreshed every year to combat the rapidly changing virus.  In the wake of the "bird flu" pandemic, there was some evidence that people exposed may have developed broad flu immunity.  Scientists have now isolated an antibody which targets a protein found on a broad variety of flu viruses.  There is some hope this will lead to a broad-spectrum vaccine in the future.  If nothing else, this should provide some storylines to conspiracy theorists all over the internet.

Saturday, August 27, 2011

Different Sources, Similar Wisdom

Have you ever encountered something multiple times in a short period of time? I've had one of those weeks. In this case, the topic was how to be happy. At the Bible study I attend, one of the folks chose Philippians 4:4-9, which among other things is an admonishment to focus on the positive, and how practicing can help reinforce such behavior. And then today, I ran across this:

So, an old source and a new source. I suspect I may need to take the hint.

Thursday, August 25, 2011

Quote of the Moment

"But it’s a disservice to constantly put things in this radical new light — that it’s going to change everything. Things don’t have to change the world to be important." --Steve Jobs, Wired February 1996.

Since Mr. Jobs stepped down as CEO of Apple Computers yesterday, it seems only fitting to quote him. No matter your opinion on him or Apple, you must acknowledge his central role in creating the personal computing market we know today.

Friday, July 8, 2011

The End of the Shuttle Era

The final launch in the merely thirty year old Space Shuttle program happened earlier today. Though the program certainly has its detractors, for me at least the real legacy of the Shuttle is one of imagination. Starblazers, Battlestar Galactica, Star Wars, and Star Trek were all things I watched as a young boy, and the Shuttle made them all seem possible. Back then I had never made a budget or studied Physics, I was just someone looking up into the sky and wondering what new wonders we would find.

Somehow it seems fitting that the final Shuttle mission belongs to Atlantis. We have gone from Enterprise envisioning the future of space travel and carrying the proud name and legacy of American engineering with her, to a legend that has sunk from our sight. The greatest achievement of the Shuttle program may be that launches stopped being a big deal. I'm still not sure what societal forces make such a thing possible. Sending people into space has lost none of its impact on me. It's incredible, dangerous, audacious, expensive, and utterly astounding.

Upon the completion of mission STS-135, the U.S. government will be out of the manned space flight game for the foreseeable future. You can't really blame them at a time when there are real issues that require attention, and yes, money. It will be left to the private companies to try and create viable businesses out of space flight. It's even possible they will succeed, and I certainly wish them well. With the Constellation program dead and the James Webb telescope in danger, NASA's direction remains unclear. My increasingly hypothetical children will have no Apollo program, no shuttle launches, and maybe even no Hubble-like photos of the cosmos to inspire them. And then what?

Let's face it, the vast majority of people will not even notice, let alone care. The Shuttle will become a part of history. Less expensive robots will carry on with the science. Space isn't going anywhere. Perhaps the names Enterprise, Challenger, Columbia, Discovery, Atlantis, and Endeavour will represent a unique time in human history. But maybe someone will look back at the Space Shuttle and see not the past, but an example of the way to the future. You can cut funding, you can end a program, but you can't kill an idea. The Shuttles, the scientists, engineers, pilots, and countless others that made them real, leave behind an inspiring legacy. And what has been done once can be done again, even better, if you have a little imagination.

Wednesday, July 6, 2011

Monday, July 4, 2011

Quick Hits to Catch Up

I've had several things sitting in the potentially-interesting queue for far too long. In the name of catching up, here comes the dreaded link-post!

In the category of Watching the Watchers we have:
From the land of programming:
  • A nice little screed on process killing passion. This one also generates a decent Quote of the Moment with, "A project where you decide before you start a product cycle the features that must be in the product, the ship date, and the assigned resources is a waterfall project." The comments are fairly reasonable too.
  • An opinion piece on why the current practices regarding foreign workers in the science and engineering industries hurts, and more importantly discourages, American workers.
Over in green tech:
  • Scientists at MIT are working on a catalyst that can split water into hydrogen and oxygen simply by being exposed to sunlight. The resulting hydrogen can then be used as a power source via burning or a fuel cell.
  • Others are working on creating batteries with charging profiles more like supercapacitors, that is to say really quick. Since I'm more interested in going the other way to supercapacitors that can replace batteries, I'll note that the basic premise of the improvement in that article sounds quite similar to research going into graphine supercapacitors talked about in this article and this one.
  • Before leaving the land of the supercapacitor, here's one more article about combining material types to try and gain the best properties of each.
Yes, I realize I had enough material there for three full posts. But hey, it's a holiday.
[caption retained out of respect for the source site, with which I have no affiliation]

Sunday, July 3, 2011

Watching the Watchers: In Which I Change My Position On Fission

For a long time, I have supported nuclear fission as the best of a bad group of choices for large scale power generation. It doesn't depend on geography the way solar, wind, hydro, and geothermal power does. It doesn't produce airborne pollution. And, costs remain competitive with fossil fuels. (Though the costs are going up across the board, enough so that in some areas wind power is now competitive with nuclear.) Of course, the little matter of radioactive waste remains. For the most part, I trusted that proper safety and disposal was in the best interests of the nuclear power industry, in spite of the failure of the Yucca Mountain national nuclear waste repository.

In recent years, we have seen government fail over and over to address pressing long term issues, including the aforementioned waste disposal. The Fukushima disaster highlights the dangers of stored nuclear waste, and the US has been without a comprehensive plan for decades. The BP oil spill in the Gulf of Mexico shined a light on the all-too-cozy relationship between industry regulators and the industry they are supposed to police. And now the AP's Jeff Donn gives us a massive article showing that the nuclear industry, favoring continued operation of its aging reactors, and the profit compared to new infrastructure, over safety. I know it's a lengthy read, but I think it's well worth the time.

In light of the influence industry now holds over government, trusting that altruism will win out over the Darwinian game of growth and profits that the stock market imposes on the deregulated utility companies appears to be putting our faith in a very fragile, possibly already broken, system. And so, I live and learn. As of now, I'm completely off the nuclear bandwagon. Alternative, renewable energy sources continue to improve every year. Putting the investment into the infrastructure needed for those technologies instead of a new generation of nuclear reactors seems to make complete sense. The time has come to stop thinking of the best of a bad set of solutions and start thinking about some that can actually be good.

Sunday, June 19, 2011

It's the Worst Parody... in the World

Hello, and welcome to tonight's episode of Top Gear.  I'm Jeremy Clarkson, and what a show we have for you. You may remember last series when we took a look at the Empire's top line Twin Ion Engine patrol fighter and decided it was something of a death trap.  Well this year, the Empire has a new model, and we sent our resident Jawa, Richard Hammod to take a look.

Yeah, thanks for that Jeremy.  As you can see, the Empire has drastically altered the lines of the craft, and boy what an improvement over the original.  The openings in the solar wings allow for greater pilot visibility, and the engines are even more efficient, allowing the whole thing to be lighter and faster even with added structural support.  And those engines also provide power for four laser cannons rather than the original's two.  They moved the cannons out into the wings to give a greater coverage area, increasing their chances of hitting an evasive target.  Let's take 'er out and see how she does on our flight track.

Right, I'm suited up and ready to go.  As you can see, this model uses the same hanger system as last year's model.    And the cockpit is... well, it's just as cramped as the original.  Very utilitarian.  Let's fire it up, and see what it feels like.  Ooooh my goodness!  This one has a kick!  Wow!  It's even more nimble than the TIE, so I can make easy work of the turns.  Woah, it's almost too maneuverable; you really have to watch out for over-steer.  Goodness.  I think pod racers might be right at home in one of these babies.  Woohoo!  It is just a dream to fly!

Richard, you sound awfully enthusiastic about this fighter.
Yeah, James, it really is a rush to fly.  Faster, more maneuverable, and just better than the original.
Right, the TIE felt great too, but we had some real issues with what it left out.  For instance, you can't actually land it, can you?
Well no, the Bothan boffins say that landing gear and such are just so much dead weight in space.
No, but you don't need those when you can't land, right.
Um, No.  Well, again that's a massive amount of added weight isn't it.
Shield generators?
Yeah, no.

So it's another death trap.
Well, I mean... yeah, yeah it is.  And it's a shame really, I mean it is such a riot to fly, but if you make the slightest mistake, it'll disintegrate.  There is just zero margin of error.
It is much better looking and wickedly fast, but I wouldn't have it.
Nor I.
Me neither, but I'll tell you what I would have... later in the show.  But first we have to really see how the Interceptor performs, and that means turning it over to our tame Sith pilot.  People claim that he's more machine now than man.  Some even say he's Richard Hammond's father.
(Oh now, that's not true.  That's just impossible.)
All we know is he's called Darth Stig.
And around the first corner, very neat.  Through the hammerhead, I don't think I've ever seen something this smooth, it's going to be a very quick time.  Coming up on the final corner now, really flying.  And across the line.  I've got the time here, and the TIE Interceptor has made the Top Gear Run in an astonishing point seven five of a parsec!  Just incredible.  Too bad you'd die if you tried to use it every day.

And now it's time to put a star in our reasonably priced speeder.  Please put you applause appendages together for singing sensation Sy Snootles...

[Apologies to George Lucas, and the cast of Top Gear.]

Saturday, June 11, 2011

A New Round of OS Wars Signals a New Era for Personal Computing

My primary computer is rapidly approaching its fourth anniversary, and as aging computers tend to do, it developed some... personality quirks.  The network port on the motherboard has died.  A run-time exception often pops when logging off or shutting down.  Being a Windows XP machine, it needed a hard drive wipe and re-install a year ago to clean out the accumulated cruft (which I still haven't done).  Basically what I'm saying here is that within the next year and a half to two years, I'm probably going to be in the market for a new computer again.  Normally this wouldn't give me pause.  The default path for me goes like this: take a budget of 1k dollars, hit up the usual web sites to do my parts research and head over to newegg.  Some assembly required, but you get a solid "enthusiast" class Windows PC with pretty much unmatchable value for price.  But in the wake of recent announcements from both Microsoft and Apple, that choice is no longer the no-brainer it would have been even a few months ago.

For the first time in quite a while, there are interesting things afoot in the land of computer operating systems, and you can thank the so-called smart phones for it.  Say what you will about Apple, you have to admit the iPhone kicked off a real revolution.  Apple's iOS interface opened up a new world of computing to a vastly larger audience than we have seen before.  Add to that the ease of use of integrated application purchasing, throw in a dose of network storage, and you can begin to see that we are about to enter a new era of personal computing.  And the choice of OS is going to be more important than ever, because once you choose, you are going to be well and truly stuck because of the vendor lock-in all that fancy cloud-marketed convenience is designed to generate.

"We've introduced a new platform based on standard Web technologies." -Microsoft "Building Windows 8" promotional video

I'm generally platform agnostic; I can find stuff I hate about every operating system I've ever encountered.  But if the choice is as important as I think it might be, it's worth taking a look at what's coming.  So what kinds of OSes are we going to have?  Well, Google's Chrome OS comes off as an experiment in seeing if dumb terminals can make a comeback using wireless instead of wired networking and the Internet instead of a mainframe.  I think we can safely skip that one.  Its long history shows us that Linux in its legion of forms will remain both pervasive around the Internet and virtually invisible to normal consumers.  That leaves us with just the dinosaur in the room and it's scrappy, arty mammal competitor.

In lifting the curtain a bit on Windows 8, Microsoft showed they are indeed working on taking their mobile interface to the tablet space and bringing it to PCs.  They have also hinted at an integrated software store.  At the same time they set of a minor firestorm of developer ire with the promise of yet another new API for programmers to learn.  The more incremental changes in OS X Lion (and the previous Snow Leopard) have already put Apple far down the path toward an integrated user experience.  The developer community also remains much more lively on the Mac, which can also use its Unix underpinnings to leverage the vast resources of open source software far more easily than Windows.

"We're going to demote the PC and the Mac to just be a device." -Steve Jobs in the WWDC 2011 keynote

Apple has the momentum right now in the consumer (i.e. not the "enterprise") space.  Even in the gaming world, Apple is benefiting from the renaissance in indy titles built in Flash, HTML 5, and Java.  iOS games are massively outselling gaming console titles.  Blizzard and Valve both support Windows and Mac via their digital distribution infrastructures.  Digital distribution of software is generally driving down prices and empowering the small developer again.  While Microsoft offers the "Express" versions of its Visual Studio apps, they don't have their response to the app store up yet, and the fully functional development tools cost an arm and a leg.  Apple's XCode appears to be a capable response at a much lower entry price.

Speaking of entry prices, I can't help but mention that Apple still has a fairly significant brand tax in place.  Still, given Apple's momentum and Microsoft's clumsy responses, the choice between a custom-built Windows machine and an any-color-so-long-as-its-black Mac may not come down just to price anymore.  As a user, and as a developer, I don't think I can ignore the ecosystems building up around computers anymore.  The maturation of speedy networking and portable computing devices means that your PC isn't going to be your sole computing mechanism, but one option of many.  If those many can't interoperate smoothly, the whole system will suffer in comparison. That, in turn, means that we are moving into the next era of computing, and things are about to get a whole lot more complicated.

"Apple and Google will compete like crazy for our data because once they have it we'll be their customers forever." -Robert X. Cringely

Sunday, June 5, 2011

People Being Awsome

Some people look at the hugely popular Facebook-hosted game Farmville and think of all the time wasted.  Others see the shady business practices.  Still others see the huge profit potential from a new and largely untapped market.  Forget those folks, because there are some who saw an opportunity to educate and reconnect the public with farming.  Thus was born the idea of having a real life farm with major decisions made by subscribers from the internet.  It is an odd idea, based largely on a football (soccer) team run using the same methods.  I have no idea how they will be providing the people who subscribe with the information needed to make educated decisions, and I have no idea how they will make things fun, but they get major points for thinking outside the box and trying to give a glimpse of the bigger system surrounding and supporting us.

Speaking of bigger systems, the Space Shuttle program is drawing to a relatively quiet close.  Astronauts aboard the Endeavor completed the final shuttle space walk late last month, adding the last U.S. built module to the International Space Station.  The thirty year old Shuttle program covered the majority of my life, and I expect I will have more to say after the completion of the final mission next month.

So we have a cool educational idea and the historic final Shuttle space walk.  A pair of wildly different stories that share only the theme that people have awesome ideas and can turn them into awesome realities.  One more story along those lines closes us out today.

Anyone who follows the news knows it has been a bad year for natural disasters.  Chief among the recent ones was the earthquake, tsunami, and subsequent meltdowns of the Fukushima power plant.  The radiation danger makes cleanup of the plant much harder, as it puts the workers at risk.  Yasutero Yamada, a retired engineer, offers a unique solution.  He is attempting to go back to work.  "I am 72 and on average I probably have 13 to 15 years left to live.  Even if I were exposed to radiation, cancer could take 20 or 30 years or longer to develop."  He has already gathered a group of more than 200 volunteers, all over the age of 60.

Sometimes, when things are hard, in your life, around you, for those you know, or even for strangers you will never meet, it's worth remembering that as banal, crazy, callous, and fallen as people can be, they can also be really and truly awesome.

Tuesday, May 31, 2011

A Bit of Anti-Planning

The temperature here broke ninety degrees today, ushering in an early beginning to summer to go along with our early spring.  And so a programmer's thoughts turn to summer projects.  Here's a sampling of some of the things I want to be doing with my free time over the next few months just in the realm of programming:

  • Install Xubuntu on my primary computer (after verifying that the wireless works) and get my development environment reasonably up to date.
  • Learn how to use the Eclipse IDE framework, starting with basic Java development.
  • Bring myself up to speed on the delta between where I left Java back in the 1.4 days and the current version.
  • Learn some SQLLite.
  • Try to make a basic Android app.
  • Continue learning Javascript.
  • Play around with WebGL, or at least the Canvas widget.
Sounds great to me!  Well, there is one little problem.  No, actually, there's two.  Time is the first issue, which Scott Adams neatly summarized in a post on his Dilbert blog.  Time is not something I can fight, so I have to press on against the second issue: energy.  I'm not talking just about the energy to get up and move around, but rather that energy that allows me to focus and create.

At this point in my life, my job uses up pretty much all the creative energy I have in me.  Now, doing any of the things on the list above, even something as relatively simple as getting Linux running on my box, would actually help energize me.  But over the past couple of years I've discovered that attempting to generate energy this way is sort of like playing the stock market.  It's easier to generate more energy if you have energy to spend in the first place, and if you are running short on energy the risk vs. return ratio is much less favorable.  And that, in turn, leads to something of a solution.  I'm not going to worry about doing any of the stuff I've listed.

Of course, I won't stop thinking about programming, and I'll try not to stop writing about it either.  (Especially since I'm barely squeezing in this month's entry...)  The way my life is at this particular moment, it's much more important for me to focus my mental and physical energy where it will give the most return.  I'm not going to set any artificial goals this year and beat myself up over failing to achieve them.  I'll keep going to that Bible study and my other church activities.  I'll keep playing games with my friends (digital and analog).  Maybe I will pick up the pencil and start drawing again to see if I can get past the plateau I was on.  Maybe I'll just watch Top Gear reruns via Netflix all summer.

That's not to say that nothing on the list will be attempted, but anything I accomplish in my relatively tiny hobby time is just icing on the cake that is my life.  And while cake is better with good icing, failing to enjoy the cake because you don't have time to make the icing is just silly.

Sunday, May 22, 2011

Technology in the News

Today we're going to look at some stories about technology, from the high to the low.  Starting off,  NASA, continues to seek solutions to the complications of human space flight, even as the Shuttle program comes to a close.  With the navy already working on laser weaponry, NASA is seeking the other half of a sci-fi kid's dream: energy shields.  OK, it's really just electromagnetic radiation shielding which could protect astronauts in the same manner that the Earth's magnetic field protects the rest of us.  Right now, it's an item on a wish-list, but you never know what the future will bring.

On the in-production side, one of the big headline makers from a certain recent special forces operation in Pakistan was a strange helicopter tail rotor.  Speculation indicates there may have been one or more helicopters involved in the raid with stealthy modifications, possibly to a Blackhawk transport.  Perhaps something came out of the cancelled Comanche program after all.

Once upon a time, back in a distant, cell-phone-less time known as "the eighties," digital watches were how many kids kept time.  One particular style, of which I had several versions back in the day, now comes under scrutiny from the government.  Apparently inexpensive Casio digital watches are a bad thing to wear in Gitmo.  Relatively simple, reliable, thirty year old timepiece technology, in the hands of terrorists becomes a simple, reliable bomb timer.  Jerks.  Of course, having reliable items becomes a big deal when bombs are involved.  After all, having someone blow you up via text message is embarrassing.  Or possibly poetic justice, depending on your point of view.

Monday, April 25, 2011

The Joy of Spring

Pollen season came early this year, and with all the wind, even the periodic rain has not been able to clear the air.  It acts as a force multiplier for all the other annoyances that occur in a normal day.  I say this, not to complain, but rather to provide some context for this image, which amuses me.

(Picture caption retained out of courtesy to the hosting site, with which I have no affiliation.)

Nanotech A-Go-Go

Here are a couple of wildly different stories that show a potential future benefits as our ability to examine and manipulate matter at microscopic scales improves.

The first involves plastic made not from petroleum, but from plant fibers.  Plastics made from "nano-cellulose" fibers can be several times stronger than similar plastics while being around a third lighter.  Potentially even more importantly, in addition to being totally renewable the plant based substance is biodegradable.  Though the researchers are currently targeting automotive applications, it isn't too big a leap to imagine a world where you throw your spent drink bottle into the mulch pile rather than the recycle bin.

Second, a potential weapon in the quest to replace increasingly ineffective antibiotics.  Now biology isn't my field, but if I'm reading this correctly, researchers are working on substances that can attack bacterial cells physically rather than chemically (though at the scales we are talking that distinction is a blurry one) which should be much harder for the bacteria to develop a resistance toward.  In other words, our poisons are beginning to stop working, so we are switching to knives.  They have designed synthetic, charged polymers which can break open the cell walls of bacteria, killing them.  So far the compounds are showing promise against several forms of antibiotic resistant bacteria, including the current media darling methicillin resistant staph (MRSA).

Sunday, April 17, 2011

Guitar + Harmony = Awsome

One man, one woman, one guitar, one mesmerizing song.  This is the studio version, the live ones are well worth checking out too, as is the entire album.  This might even be a decent excuse for me to finally try out the drop D tuning.

Sunday, April 10, 2011

Solving the Programming Professional Name Debate

Science is to Computer Science as Hydrodynamics is to Plumbing
unattributed aphorism from the Fortune program which I first saw in the mid 90s.

People who have devoted their lives, or at least their professional lives, to writing computer programs seem to be caught up in a continual debate about how to express what we do for a living.  Everyone seems to have their favorite analogy about what our field actually involves.  Are we best described as engineersdeveloperscraftsmenartistsarchitects? writers? farmers? oysters accreting software pearls? construction workers?1  Frankly, I'm tired of it all.  Like so many other political debates going on right now, the debaters are telling you more about what they want than the reality of the issue.  People who say creating software is an engineering discipline are actually saying they want creating software to be an engineering discipline.  It is high time we stop defining ourselves based on the models for other professions.

Naturally, you will want to know how my method for describing people who write software differs from every other person's.  It's simple.  I'm dropping the analogies.  They clearly don't work.  Computer science isn't science, and software engineering isn't engineering.  That's not to say that we can't take lessons from both science and engineering methods, I certainly do so every day, whether it's isolating variables during debugging like I did back in lab class or doing stress/load testing like a materials engineer.  The lessons are freely available to us without needing to take their roles and titles as well.

If we are to stop defining programmers by what we aren't, we have to examine what we are.  When you sit down to design and implement software, no matter the domain, platform, or language, the basis remains the same: algebra, Boolean logic, and symbolic logic.  All computer programs are nothing more than numbers being manipulated.  All those grand designs, all those layers of abstraction, they are just there to allow us to give context and meaning to those numbers.

Now, maybe you are feeling a frisson of fear.  Deep in your hind-brain the instinct for fight of flight is building up.  You know deep down what I'm about to say, and you really don't want to hear it.  But it's there.  People who write software are... mathematicians.  Wait, don't go!  It's applied math!

Yes, I am being overly dramatic to make the point, but when you sit down and seriously think about it, can you really argue against programmers being first and foremost mathematicians?  But it really starts to become interesting when you think about what being mathematicians implies.  Could changing the titles we use in our jobs away from the ones used now help us as a group?  If the code is all just math, how does that make us look at the different roles within the profession?  Would the attitudes of managers change if they had a department of mathematicians writing software rather than a department of engineers?  What about HR departments and recruiters?  If software is written by mathematicians rather than engineers, what does that say about the need for, or the processes of, designing professional credentials and/or certifications?  Does acknowledging that it's all math allow us to come up with better methods and/or processes for our work?

Defining ourselves by analogy really is a perfectly natural thing for software people to do.  After all, we spend all our days writing programs that model other domains, other jobs, other tasks.  But I really do wonder if there would be a benefit to moving beyond defining programming by comparison to other things.

[1] The last four analogies are from chapter 2 of my favorite book about programming, Code Complete 2 by Steve McConnell.

Growth Isn't Everything, Are People are Beginning to Notice?

Mike Taylor over on The Reinvigorated Programmer posted his thoughts on one of my favorite issues, how growth driven markets aren't necessarily a good thing.  I will not say any more on the subject today, mainly because I don't want to ruin my good mood, but also since I've been on this soapbox since at least 2006.  Happily, the more people that start writing about this stuff, the more brains will be applied to coming up with a solution.

Saturday, March 26, 2011

Jedi at Play

Oh After Effects, your users do provide me some fun moments.  Ladies and Gentlemen, Badminton Jedi:

Saturday, March 12, 2011

Small Scale Big Changes

Interesting things happen when new technology addresses a market that traditional technologies don't.  Case in point, the New York Times looks at African mud huts charging cell phones and LED lights from small solar cells.  The subtle changes in the lifestyle that this allows have the potential to improve things for people well beyond the reach of the traditional power company model.  And frankly, I'd like to see that sort of thing happening more often in America too.

Speaking of LED lights, development continues apace on them.  Hopefully the massive improvements in cost and brightness that companies continue to promise will show up in the marketplace.

A Certain Kind of Philosophy

What do you get when you combine comics, the Dungeons & Dragons alignment axes, and... a John Wesley quote?  This.

For those not really familiar with D&D's method of representing character philosophy, the same site has quite a few attempts to explain.  The Deep Space 9 one works well for the nerdy, but the one that really explains it all involves Muppets.

Saturday, February 19, 2011

Watching the Watchers: Hardcore Computer Ownage, Government Style

The ongoing results of the dust-up between a computer security contractor and a "hacktivist" group which I shall not name have resulted in a fascinating look at the workings of computer espionage in the Internet age.  Seriously, if you haven't seen this story, set aside some time and hit up the whole list of articles in the inset block. It's a pretty astounding story.  And then sit back and ponder that the two forces at work both believe they are the good guys.

China Military on the Rise, the U.S. Military Gets All Sci-Fi

Breaking news! ... From a month and a half ago.  (Hey, I've been busy, you get what you pay for.)  Anyway, it seems the Chinese are working on a new stealth fighter.  If only they had some sort of maverick pilot to help speed along its development.  In all seriousness, Chinese military power is on the rise and the U.S. military recently renewed diplomatic communications with them.  There are quite a few reasons why the rise of China as the world's premier super-power could be pretty much inevitable at this point.  (The current super power mortgaged itself to China, for one.)

Whether a more powerful China is a factor or not, the U.S. remains a country that loves its toys.  For one thing, the U.S. Navy is working hard on laser weapons, and has successfully tested a free electron laser in the 14 kilowatt range, with an eye toward eventual anti-missile and -aircraft use.  For another, the U.S. Navy's premier carriers, the Nimitz class vessels have been in production since 1975.  With the 2009 commissioning of the latest one, the Navy decided it was time to create a new design using modern technology.  Technology such as using electromagnetic rail guns to catapult aircraft rather than steam catapults.

High powered lasers and fighters launching via electromagnetics...  I think I've seen that somewhere before.  Oh yeah, Battlestar Galactica.  Perhaps you think that's a stretch?  Well guess what, we're building our own cylon raiders too.  Sure, we call it the X-47B unmanned bomber, but really, just look at the picture, that thing's a cylon.