Read Latex

Tuesday, April 03, 2018

#GTC2018 Sipping from the Firehose



After a protracted absence from the conference scene I got the chance to drink from the firehose at #GTC2018, nVIDIA's annual GPU Technology Conference. As drinks go it was a chocolate malt.




GPU stands for "Graphics Processing Unit" and rhymes with CPU or "Central Processing Unit", the heart of our personal computers. The GPU, a square chunk of silicon shown below measures 1.5 inches on a side, nestled into its graphics card home. You can see my fingerprints on the discard below and honestly it feels like touching a piece of Mars. It is the heart and soul of nVidia's latest offering containing a stunning 9 billion transistors:


nVIDIA has taken 16 of these and glommed them together in their latest offering, the DGX-2 graphics and artificial intelligence supercomputer. It's basically somebody's brain floating in space. At 350+ pounds it's a little heavy to float, but I promised Jensen Huang if he hired me I would put it on a diet and cut its weight in half. After all, this is the kind of things that humans like to fling into space.

The nVIDIA DGX-2 Supercomputer - source: nVidia


The conference in toto, was quite a spectacle, reminiscent of my tours of SIGGRAPH conferences during the heyday of computer graphics innovation. GPU's originally started out as add-on cards to enable 3D computer graphics in personal computers and workstations. Jim Clark deserves mention for getting the ball rolling in this field with Silicon Graphics, but I digress. The SIGGRAPH thrust curve, shown below, is one model. One model that is, for what happens when a disruptive technical change of paradigm comes along. The thirty-year period between 1982 and 2012 shows growth followed by reversion to a baseline of progress. Consider that 15,000 people is an army, 50,000 is a city. It takes a village and all. This year about 8500 people attended #GTC2018, compared to 6500 last year, so we are still inflecting upward.


SIGGRAPH Attendance - source: wikipedia


Market income appears as a three-legged stool for nVIDIA. Those three legs are Cryptocurrencies, Gaming, and Artificial Intelligence (AI) in addition to the core business of enabling computer graphics on PC's and workstations. Below is a historic stock chart and it is clear that things are going gangbusters since 2016.

nVIDIA Stock Price Vs. Time - source: google finance
Cryptocurrencies use GPU's to search for numbers that validate blockchains. These virtual currencies, are not currently backed by any good or service of tangible value but that doesn't seem to stop nVIDIA GPU's from selling like hotcakes.
 
"Look at my pretty prime numbers."

Commoditization of AI 
was, for me, the lasting excitement of #GTC2018. I made my way through a series of lecture sessions, labs and an enormous equipment expo, to get a sense of where things are and refine my own data science and robotic skills. If you are wondering, "What good is AI?", remember that everytime you say, "Hey Google, Hey Siri, Hey Alexa, Hey Cortana you are using AI that is becoming so much a part of our life it is invisible. It is used on Amazon in your every encounter. I don't even go to the store anymore, do you?

Other AI concerns include Autonomous Vehicles, Healthcare, Education, Finance, Robotics, Human Resources, Marketing, Media, Music, News, Customer Service, Personal Assistants, Toys and Games and Aviation. I expect it to follow the SIGGRAPH curve, but over a more compressed time scale due to improvements in telecommunication. For me it's fun to surf big technical waves, because that is what I've done all my life.

My first thesis advisor, Art Hale, a visionary mathematician and engineer, emphasized not getting swept up in the river of change for its own sake, but to remain attentive to first principles that dictate productive change and fundamental directions of endeavor. “It's better to stay up on the bank if you can.” he would say. He would also say, "There are millions of people." for some reason.

Thus, as I sat in the sessions I made notes of key principles that emerged invariant or "here to stay". Here they are in somewhat chronological order biased by my own interests:

AI Accountability Equals Explainability:

The first emergent theme is that AI’s need to explain themselves. At present these magic algorithms are somewhat opaque and difficult to audit when it comes to answer questions like, “How did you get to that answer?” If you were hired or fired by an AI, this is something you might want to know.

There was an entire session devoted to the explainability of AI, but it was paradoxical since the lecturer was a stakeholder in a company that uses proprietary methods to enable AI to explain itself.  AI that explains itself using secret techniques remains unexplainable by definition.

Fortunately there is work being done that pulls the curtain back, such as heatmaps for neural network weights. In the example below, I drew a blobby dot in each corner to see which digit would pop out of the neural net. My sketch classified it as a 1, but most humans would not read that as a one. They might read it as a four. To be fair, the neural net wasn't trained on things that appear on the face of a die. But it should not return an answer as one either. Note that the heatmap of things that this neural net classifies as a 1 doesn’t look anything like a 1, so that is a problem too. I hope to look at this in more detail this year.


Heatmaps for Explainability - source: LRP

To nVIDIA's eternal credit, the technical sessions are posted here which is a plus for addressing this.

Hyperparameter Optimization - this is hot bed of current research. It is also too long a word for a very simple idea. If you go to TensorFlow Playgrounds you can construct your own neural net and run it with various settings like "Learning Rate", or "Amount of Noise", or "Test/Train Split" and other configuration details. These are the Hyperparameters and really should be discovered by a machine rather than a human. By this time next year they will be. In the example below you are watching a computer think. I can't get enough of it.


TensorFlow Playgrounds - Source: Smilkov & Carter

Machine Learning is an Optimal Control Theory Problem. Watching the learning curve evolve over time reminds me of aircraft stability and control. There is a best way to proceed to a given flight configuration and these are knowable sorts of things. Even machine learning (ML) algorithms need autopilots.
Autopilot Design - Source: Open Access Korea
Another idea that emerged in the driverless car world is that marking intersections is really important to let driverless cars know to stop. Since most wrecks occur at intersections this makes sense in the driver-full world also. 
Intersection Risk as Function of Position - Source: Me

So we should expect transportation automation to influence road design and vica versa. Road signs are apparently good reflectors of radar, this causes glint in the sensors due to multipath RF propagation. Road signs made of fiberglass would be better since they reduce RF glint. They would also be better if you happen to run into one. Nature has a funny way of breaking what does not bend, at least that's what Jewel says.







Thursday, February 15, 2018

Sane Public Policy via a Gun Census







I observe. I think. I've thought. The pen is mightier than the AR-15. The AR-15 killing machine will rust and jam, especially if you shoot NATO ammunition. The pen endures forever. I polish this article every-time there is a mass-shooting. It is getting way too polished.

We are at a social Tipping Point. Malcolm Gladwell, in his book by the same name, makes the point of "opt-in" vs "opt-out" when it comes to states enrolling organ donors. States that require DMV applicants to opt-out of organ donation produce more organ donors than those who must opt-in because people are lazy.

Lazy or not, under current law, nearly anyone who is 18 or older, can buy an assault-rifle and bump stock that converts it to fully automatic use. To be denied the right to purchase there must be a glaring red flag in the rubber-stamp background check that kills the purchase. Many mass-shooters are "first-time" offenders, therefore the response, by definition is always too-little, too-late.

Conferring on someone the right to perform mass-execution MUST have a higher barrier to entry than the current one. The burden should be on the applicant to prove that they:
1) are of sound mind
2) the people in their household and circle of trust are of sound mind
3) their killing horsepower need is reasonable

There is a difference between weapons for self-protection and those for mass-execution. When the 2nd amendment was developed, weapons did not confer on any single individual the ability to perform mass-execution. Give me a second while I reload my musket.

There is very good math, and I am a mathematician, that show that proportionality in war is a good idea. Mainly it avoids mass-extinctions. See Robert McNamara in the "Fog of War" for an excellent explanation of this. So let's do some simple math:

If everyone had in their garage, a hydrogen bomb, that they could detonate when they became angry, depressed, despondent or mad at the neighborhood association, one person could destroy a city, a state, or even a nation.

As a democracy, the decision has been made that we do not allow individuals to possess or carry nuclear weapons because there is currently no scenario that would justify this. So now we have an immediate obligation to the constitution:

Imagine if every AR-15 owner had a hydrogen bomb, locked and loaded in their house, maybe under the bed or something. That would make for 3 million H-bombs. If that were the case how often would we read about H-bomb explosions? The suicide rate is currently listed as 13 per 100,000 people. that works out to 390 incidents per year. Not so good for Earth Day festivities. The murder rate is 6 per 100,000 people. Maybe it is comforting that people kill themselves more often than others, show how good people really are. Anyway, that works out to 180 H-bomb explosions per year for a total of 570. Now we are assuming that AR-15/H-bomb owners commit suicide and murder as the same rate as the general population. Prepper be ready.

So we don't allow this and for good reason. Through the miracle of calculus, consider the following limiting arguments. How much killing horsepower should one individual be allowed to possess? I've already shown that a hydrogen bomb is too much. One can similarly reason that an atomic bomb is too much. We can continue to reason to more reasonable scales. Current law does not allow individuals to carry grenades, presumably because that is too much killing horsepower to confer on a single individual. Yet we allow uncredentialed people to purchase assault rifles willy-nilly. This is contradictory.

We can reason from below, as well as from above. We can reason from too little as well as from too much. How much killing horsepower is too little for self-defense? If one is attacked by a single person, you need to have what they have, plus a little bit extra so that you win. If a single attacker can have a hydrogen bomb, then you need two hydrogen bombs, just to make sure. So now we have a paradox. Whatever we allow someone else to have, is all that we are allowed to have! To fix that we must allow ourselves to have anything that they could possible have plus a safety margin and viola - we are in the current impasse enabling mass-shootings at schools, movies, concerts and work.

BUT a group of reasonable people could get together and say, here is how much killing horsepower we are going to confer on any single individual (this has tremendous ramifications for military leaders, but I digress). The killing horsepower that you are certified for depends on: 1) the soundness of your mind and 2) the threats you reasonably expect to confront in your current daily life. This creates a table of permitted killing horsepower. A commander-in-chief I know of, has the killing horsepower of the entire hydrogen-bomb arsenal of the United States. That is probably too much power to confer on one person, who in a moment of questionable judgement, could make a mistake that would destroy the world. Again I digress.

In short, a table of permitted killing horsepower is created and everyone gets a ranking. This table of permitted killing horsepower is created by proper research, debate and due process, while we mourn those lost in the meantime. In the future Artificial Intelligence tools will be used to screen applicants fairly, by quickly applying the wisdom of history and the hive. The model is that of a DMV for killing horsepower. Everybody hates the DMV, even so you can't drive a big truck without a special license and the lawyers come when they run you off the road. We know how to make DMV's. Apple could make them more user-friendly though. Part One Done.

The second part is an inventory, a complete common-sense gun census. An inventory must be made of the location and type of every gun and every round of ammunition. The manufacturers of weapons are required to keep records on how many are made. Many of these can then be tracked down by those records in combination with registration databases and store records.  The location of ALL guns and ammunition repositories must be part of the certification process. If someone tries to cache weapons John Wick style, his killing horsepower privileges are reduced or removed. If you use a gun, that use is going to be audited by the justice system, and the gun census is part of that process. A gun census doesn't take anyone's weapons away that shouldn't have them in the first place.

With a complete inventory, it will be possible to screen for those who are currently in possession of killing horsepower outside the realm of their daily need and their soundness of mind.

Any other approach to this problem will find us lamenting the murder of our children in schools, the murder of our friends at movie theaters, concerts and work. Schools, movies, concerts and work makes life worthwhile. Possession of killing horsepower outside our need or ability to wield it makes life more tragic than it already is.

In conclusion. We must implement these two fixes now. If things don't improve we can implement a sundown clause, a return to crazy town and see how that works. Judging from current events, crazy town isn't working at all.




Thursday, January 21, 2016

Better than Stitches, Fast as Light

From time to time in this glamorous life we all get cuts and scrapes. Kitchen, workshop, you know the drill. Left to themselves these insults usually heal, unless they are exposed to bad environments like the gym, public library, Uber car, mass transit or hospital. Bandages help, but do not eliminate the possibility of infection. Being a clean freak living in the age of MRSA I have long been searching for a better solution.

A while back I tried gluing cuts with superglue. It kinda worked but superglue, also known as methyl methacrylate has some drawbacks.

Methacrylate emits acrid fumes when it cures, usually after an unpredictable duration depending on the age of the batch. In large quantities, especially in contact with cotton, it can exotherm resulting in a serious burn, defeating the purpose of using it. After that it is either a too little or too much situation and the resulting "patch" lifts from the skin fairly quickly. The worse thing is that the dermal repair has a scratchy sandpaper, hard plastic, inflexible sort of feeling. After several repairs with superglue, I have rejected it because it just doesn't feel right.

After that I tried a product called New Skin. New skin smells like bitter acetate film stock or dissolving butyl rubber. Even the tiniest drop fills the house with a chemical aroma that takes at least a half an hour to dissipate. 

I have tried drying it with a hair dryer and even a paint stripper set to low and held at a distnace (NOT recommended) but it is a very slow to evaporate solvent. If that were it, I still might use it. But invariably after it sets and I go back to what I was doing, the repair will delaminate as though my body were trying to reject it. And yes I do all the normal skin cleaning, disinfection and drying before hand to insure a durable bond. I recommend Betadine by the way, but I'm not a doctor, I'm an engineer as you might have already figured out.

Yesterday I was lamenting over the delamination of a recent wound to the very same fingers I am using to type this message. I had used New Skin and thought I had a good repair, but after doing the dishes it came off as usual. The puncture wound was small, it never got infected, but because of the density of nerve endings it was painful to work. I can't afford down time.

Then it hit me, I wanted a smooth liquid plastic that I could somehow apply to the wound to make an artificial blister. When it set I wanted it to still be flexible, but thoroughly bound for the 4 to 6 days it would take the skin to heal by exfoliation and whatever little dermacytes do when they are healing.

For Christmas a friend of mine had given me an ultraviolet 5 second plastic repair kit, used to repair eyeglasses and various things around the house. I noticed when using it as recommended for eyeglasses that the cure was extremely fast, usually in 3 seconds. Since this is about the length of my attention span there was a good fit there. Moreover the plastic was very smooth and slightly flexible, yet it bound inextricably to the substrate, which as you by now have guessed, would inevitably be me.

Now Louis Pasteur inoculated himself with cowpox while he was attempting to cure smallpox. I am not so bold, but at this moment of desperation I was just bold enough to place a tiny drop of liquid plastic on my painful puncture wound and illuminate it with the ultraviolet LED that came with the kit.

Much to my surprise, as I shined the light on it, it stung SHARPLY but briefly the same way the New Skin stung. Now the New Skin sting was chemical in nature due to the ester solvent which takes forever to set. In the 5 second repair case I assume that this was due to the instant heat of polymerization. This means one should proceed very cautiously with the UV light, especially on larger wounds, since burning one's wounds is unfashionable at best. I posit it best to hold the UV LED several feet away and approach slowly until one feels the reaction starting. After a pause, I polished with light at close range, which also sterilizes the wound. Do not look directly at UV light since it is hard on the eyes. I could lecture on UV photons but I won't.

Anyway, that was yesterday, the process worked, and it is holding up very well, without that scratchy feeling. I can palpate the repair with my handy opposable thumb but I don't have the urge to pull or pick at the solid plastic bubble of repair. It is me and I am repaired nearly perfectly by 5 second plastic. 




Tuesday, January 05, 2016

Drugstore Cowboy Rug


When I was growing up there was a saying that went like this, "He's a drugstore cowboy". This referred to people who came by life the easy way, rather than paying their dues as a dusty ranch hand.

True confessions. When it comes to math I am a drugstore cowboy. I use computers to figure things out. I rarely write numbers by hand, and then only on the back of a napkin, usually with mistakes of one sort of another. The sheer boredom makes me yearn for a Colorado Rocky Mountain High sung by John Denver at midnight, a fuel-valve too-hard to turn.


I usually have to see a concept illustrated to truly understand it and for me that is the advantage of computer algebra. There is another advantage to computer algebra. I can do as many calculations in an afternoon as a hot-shot mathematician of the past could do in their lifetime. Proceeding this way enables me to cover more ground than the Lone Ranger on a horse named Silver.



Before I get into the central theme, a couple of things. When we find the area under a curve, it is called integration. A lot of time can be wasted discussing this act of cutting rugs to shape and figuring out what we owe the shopkeeper. Integration is idolized more than it should be in science, mostly because it is used as a gate between the math-haves and math-have-knots like me, the drugstore cowboy.

Being a drugstore cowboy I hate this. If you stay with me I promise to rhinestone your math to another level, but if you believe in reinforcing the cultural divide between knowing and knot-knowing, I bid you a fond farewell.

When we find the area under some curve, we can do it from east to west, from sunrise to sunset. Or we can avoid committing ourselves to such limits and remain indefinite. 

- via http://goo.gl/H6mzVM

Finding the area of a little ole bitty piece of ground it is called the definite integral, meaning, I will definitely tell you where we begin and end, start and finish, floor and ceiling.

Before we get all fancy and change the world let's say I give you a line that rises just as much as it runs. Insiders would say this line is just good ole y = x or even f(x) = x. When we find the area between two stations a and b, it is just the area between the horizon line in front of the fireplace where granny has been knitting the throw rug and the outlaw line y = x whose slope is conveniently how the west was one before we ran out of wood when we were building the shed.



In big city speak someone might say, this is the area under the function y = x between hitchin' post a and hitchin' post b.

Pastor Smirkenthorn preaches, "The place where x equals a is a point." and it is, but that point is on a line where x equals a, so y can be anything so I like to think of it as a line. Not to be confused with, "You're a lyin' sack of pooh".

Someone who doesn't get out of the saloon much, might say that x itself isn't even a point since a point requires an x and a y and they would be right. They would say that x is just the lonesome dove we call a scalar.

- van http://goo.gl/bl9PTg

So here we have been promoting x like snake oil, when it is just the lonesome dove. Yes poor x the scalar acting up like a line too big for its britches! Well listen to the neighbors at the saw-mill. We can even think of x equals a as a plane that flies screaming out of the screen cutting our pretty little world into two half-spaces. Some birds will nest in the left half-space, some in the right half-space and some might perch right on the cutting edge of the blade when the creek water is runnin' low on Thursdays.

- via http://goo.gl/t8Zo0O
Now when some stuffy-minded person writes:

They should be writing:

areaUnderCurve(f(x), x, a, b)

The fancy S looking meathook fiddle-hole thing means son, I mean some, I mean sum, we are adding up little dx slices of f(x) dx from x equals a to x equals b. For me this is a little more self-explanatory and easier to understand. It is also easier for computers so they don't run so hot and boil over.

Now let's apply this so I can get on to what I wanted to talk about.

If we have the line where y = x, we can write that as y is a function of x. We make a deal at the table. You give me a card x and I give you back a card y. If for every card with the number x on it, I just hand you back the same card, it is a pretty slow game. When I draw out what happened, well I go over x and up the same amount in y and we have that same line. But we never did say what the blue area was that drove me to drink in the first place. I mean, that gonna turn my brown eyes blue area was between the line and the x axis..

Finishing with the computer's help, because Lord knows I got bigger cattle to rustle we have:



So to find the area of granny's knit throw rug we just multiply a and b by themselves, divide by two and subtract.

We can also do the less definite, I mean indefinite:

and then evaluate that from a to b.


But forget all that, I told you all that to tell you this. What does it mean when I find the area under one function with respect to another function. I mean instead of with respect to just x. I mean instead of chopping up the poor little x-axis into teeny weeny bits? That is what I really wanted to talk about.

Consider. 

The verb, "integrate" got named wrong by some musician who stared at his violin too long.

Integrate means find the

area-under-the-curve-f-of-x-with-respect-to-x-axis


We might call them names to make them feel special, but they really just accept input functions and produce output functions. Now we even write them with fancy notation, but we can also write them like so:

areaUnderCurve(sin(x),x),
areaUnderCurve(sin(x),x,a,b),

Now the reason I wrote this whole silly thing is because I want to understand what it means to write:

areaUnderCurve(x,sin(x)) or more generally

areaUnderCurve(f(x),g(x)) or more generally


areaUnderCurve(f(x),g(x),h(x),k(x)) or analogously

slopeOfCurve(f(x),x) more generally as

slopeOfCurve(f(x),g(x)) The slope of f with respect to g

and also

limitOfCurve(f(x),x, a) being extended to

limitOfCurve(f(x),g(x),a) being extended to


limitOfCurve(f(x),g(x),h(x))

and that is just for single variable calculations. With multiple variables we can find volumes and masses and even find a quiet moment with inertias.



Saturday, December 12, 2015

Swift Java Boat Adventure: Part 2


Before we begin our programming adventure, there are a couple of things we need to cross off the list. "Articulate the obvious" I always say.



As programmers of (whatever) there are some things to think about. Being a programmer of a computer versus a user of a computer are two different things. Much as being the designer of a boat is different than being the pilot of an boat. 

Developers need CPU performance, cloud storage and screen real-estate to spread out and work. They need chairs and desks that support long hours of sitting, along with exercise and fitbits to improve quality of life.

The developer versus user mindsets are different, although we frequently do both. There is the mobile migration consideration:


Swift can migrate to iOS and
Java can migrate to Android


so we have some excellent symmetry for our Swift Java Boat experiment there.

For our experiment we might require that we be able to develop on more than one H/W and O/S platform, in deference to some degree of platform neutrality. For Swift we will use XCode on the Apple MacOS platform, knowing that it gives us the ability to export our work to iPads and iPhones. For Java we will use Netbeans on a PC or Mac platform knowing that we can then export our work to a host of Android devices, PC and even Mac desktops.



To first order, we have doubled the work necessary to field an app, but we have obtained something worthwhile - platform independence and even language independence. We might wonder if we should write our application in some third meta-language and then simply compile it for the destination language and hardware. 

Let's explore that idea:

One symptom that we are doing something right in the computation process is that the tool we are building is useful for the tool we are building. This kind of self-reference occurs in the real world too. I recently built a shelf out of cubes. I carried the hardware for the shelf of cubes in the cubes, so there is self-reference and utility in the mundane that gives us a clue we are on the right track. 

So in this we have a definition of a possible task, a task that uses itself and solves a problem at the same time. Consider a simple box and arrow system that lets us draw a box with some inputs and outputs, execute that as a program and draw the result on either platform, Swift or Java, Desktop or Mobile, PC or Mac, Apple or Android. Since we can use this to build other apps we have a healthy dose of self-reference. A portion of it should be written in itself!

This BoxAndArrow System will be complete when we can define a simple program like solving the quadratic equation, displaying the inputs and outputs visually with a proper user interface.

Fig. 1: A Simple Boxes and Arrows Application

Figure 1 shows a high level view of the program and how its execution environment would look on the destination device.

The internal structure of the program is illustrating in boxes and arrows graph form below. 

Fig. 2: Quadratic Graph internal Details

Note that it contains primitive operations like unary negation, addition, subtraction, division and, name distribution. But it also contains a composite operation that is a placeholder for blocks of IP that come from other sources. It would be implemented here as simply a chunk of code that executes that portion of the diagram. Note also that exception conditions that must be handled by the caller are provided for as part of wiring the module. These are details that will be "handled in the implementation", the most famous of software excuses ever.

We could market this tool as a simple equation grapher and monitor sales through the Apple and Google monetization portals respectively. This would accomplish the goals enumerated in part one of this series.

One Practical Note:
Building for the Apple platform requires $100 of Apple Developer Network payola. Building Java under the NetBeans and Android platforms is free.






Swift Java Boat Adventure: Part 1



I care a lot about language. I care so much that I make my own rules. I even have to turn grammar checking off while I attempt to express myself... done!

I care about programming language:

  • How it looks on the 'page'.
  • The clarity with which it communicates.
  • The ease with which someone can get the gist of my intention.(That someone could be me in sixth month’s time!)
  • The degree of reuse I might obtain.
  • The scalability of the design approach.
  • The number of people fluent readers.
  • The rapidity of development.
  • The ability to build and monetize applications.
Compiled languages like C require a waiting period before you see the fruits of your labor, while interpreted languages like Lisp give you immediate and nearly constant gratification. I call this dichotomy:

Edit-Compile-Look (ECL), versus,
Interpret-This-Now (ITN).

Barry Schwartz says in his Ted Talk, The Paradox of Choice, that we have too many choices and that this apparent freedom actually ends up limiting us, depriving us of the very thing we sought. That is certainly true in the programming language world.


For many years TIOBE has been keeping track of this choice list as it varies like fashion hemlines from month to month and year to year. Here’s the long term list with the rank of the language by year. Java is currently in first place by a considerable margin with 21% adoption. Next is C with 16% adoption dropping precipitously to C++ at 6% adoption.

I have used six of these languages for production work and I want to say something about each of them, before introducting the current topic, the Java Swift Boat. 'Current' get it? Did you notice the picture at the top?

Java has improved to the point of being a useful language. It is fast enough to do pixel-wise graphics and portable enough to handle many devices, except Apple iOS-based products which we care about. It is properly structured and it is getting past the CLASSPATH and security disasters of years past which complicated doing ordinary and useful things. You can even do Lisp-style lamda functions, the functions of noname. It is among my top choices at this writing, but that is mostly convenience.

I have used 'C' since 1980 or so. Thirty-five years is a long time to endure progress without obsolescence. C is great, my favorite choice for the quick hack to solve problems rapidly. C does not scale particularly well and I have paid the price for that. It forces memory management decisions on the programmer, its principle downfall, but also its principal virtue. Nothing is faster in execution or slower in finding a bug than C. C trumps even assembly language for rapidly and efficiency for large projects. With C you can, with effort, telegraph your intentions properly.

C++ is the spoiled younger sibling of C. Some things are fixed, but at the price of significant and often needless complexity. Strings are safer in C++ and threads, if you care, are supported. I always start in 'C' then translate to C++ to make my code more elegant, compact, or objectified. 

That said, Objective-C is ugly on the page and I refuse to use it for that reason forever. This creates problems developing apps for Apple products since they are a married couple. That will bring us to our timely Swift Java Boat experiment in a minute. 'Timely', get it?

Python is nice on the page, but feels a little old-fashioned and clunky to me so I don't use it much. I've done one-minute videos to express enthusiasm and amusement.

I really like JavaScript. I have done production work with it and it is can excel with clarity. It has been obfuscated somewhat by the advent of new packages which increase capability at the cost of transparency, jQuery comes to mind. But at its base it is a nice prototyping language. You cannot beat the abundance of quality online tutorials for it that show execution real time. It is a little slow for computer graphics, despite monumental efforts, but nothing is better for rendering web pages or just general computation. It is like a blend of C and Lisp, where you can be lazy and not declare your variables. You can pull them out of thin air, willy-nilly and get away with it most of the time. 

I have done some work with Visual Basic .NET. My main objection to VB.Net is that it is a wholly owned subsidiary of Microsoft. The opposite of net-neutrality in the language domain if you will. When I am working in Excel, another wholly-owned M/S I use VB.Net and that's the end of it. It is not an IEEE standard language and I don't like anyone to own the languages I speak or program in if I can possibly help it. Java suffers a taint of this with Larry Ellison's Oracle acquisition of the language from Sun. Swift suffers a taint of this since it is owned by Apple. JavaScript is pure however an ECMA-262 vendor-neutral standard since the days of  the NetScape browser wars.

Perl has gotten a lot of leverage from webmasters and system administrators, but I avoid it for syntactic and historic mashup reasons, perhaps because I am fluent in Linux/Unix text processing tools that are more elegant for my daily grind purposes. I just don't need it.

Fortran was my first date programming language (not counting that fling with the Digi-Comp) and I used Hollerith punched cards to write my first programs on an IBM-360. "All I wanted to do was draw a parabola" properly, a quest  would set the tone for the next 40 years. This was when dinosaurs ruled the earth right before Lady Ada came on the scene.

Speaking of Ada, the Countess of Lovelace really deserved a better language. Ada was designed by committee. Its intended use was flight software and Department of Defense systems that were too important to fail. (Like too big to fail, only with thermonuclear devices.) Ada was slow out of the blocks, and too cumbersome to catch on. A sad story that I fortunately never wasted a moment of my time as it never got past the 'icky detector'. The scary thing is that more than one airplane is flying C code with questionable memory management which is why from time to time they do the nose-up dance at 30,000 feet for no good reason.

There are a couple of languages further down in the list worth mentioning in passing. Haskell is good for people like me who want to make everything a function but I've never bitten the bullet. I fiddled with Prolog because you could ask it questions to see if it really loved you, but our relationship never really went anywhere. My favorite is Lisp which I learned, fortunately, before Fortran corrupted my thinking.

I use wxMaxima for all my mathematics because it is free, in the public-domain, free of taint and pretty close to state-of-the-art, for my purposes anyway. Maxima is written in Lisp and I can solve problems in it, or its lovely base language Common Lisp rapidly. Rarely do I have to venture down to the that level, but when I do, it is pleasant enough to get the job done. It is a symbolic/functional/interpreted language - my favorite - but you cannot truly write deployable applications or do compute-intensive computer graphics with it. You can however solve all the math problems computer graphics and engineering require, but those results must be translated to nVidia, C or Java if you want them to execute rapidly. Yes I know nVidia is a company not a language. But if you're really into it that statement makes sense.

So where does that leave us? Almost ready to board the Swift Java Boat for an experimental voyage. The voyage will be to develop a simple app in both Java and Swift and see which is:
  • fastest to develop in
  • fastest to execute
  • makes the most money per unit time
Before we hop the Swift Java Boat a few words about Operating System (OS), Interactive Development Environment (IDE) and startup process. I hate to be longish or even boring, but this needs to be discussed. A small course correction can make a big difference in where we end up. So drink an honorary cup of Java for finishing this first episode. We will leave those to the next one.


Wednesday, August 12, 2015

My Happy Microbiome: The Glory of Yogurt Homemade

The Dash 1 Quart (1 Liter) Yogurt Maker

Let me start out by saying that I am not a cook. I am a technologist. I delegate the cooking of nearly everything to those who "have the gift" so to speak. I can make toast on occasion, and in a blue moon pizza, but that is pretty much it, except for one thing. I make yogurt. It supports my low effort approach and clean-up is a snap.

Here's why making your own yogurt is so important. You can control what is in it. Do you have variations in mood? Many workers think that gut equilibrium plays an important role in moderating mood and yogurt, hands-down is the safest and best way to establish that equilibrium.

First my recipe:

INGREDIENTS FOR FIRST TIME

1 quart UNOPENED Half-and-Half. Do not use skim milk, or regular milk.

2 oz.  PLAIN LIVE CULTURE yogurt (flavored is okay)
2 oz.  GREEK LIVE CULTURE from another vendor.

Using two vendors insures a safe diversity of yogurt cultures.

PREPARATION

You have to work CLEAN. Use hot water and dishwashing liquid. Pay attention to TOUCH.

1. Wash down all counters, sinks and your hands with hot soapy water.
2. Wash all utensils inside and out with hot soapy water.
3. Wash the UNOPENED half-and-half and yogurt containers. (grocery cooties abound)

PROCEDURE

1. With a CLEAN spoon put 1/2 the PLAIN yogurt at the bottom of the yogurt maker dish.
2. With a CLEAN spoon put 1/2 the GREEK yogurt at the bottom of the yogurt maker dish.
3. OPEN and pour the Half-and-Half into the yogurt maker dish. Do not scald it first.
4. Put the cap on the yogurt maker dish
5. Put the yogurt maker dish into the yogurt incubator.
6. Plug the yogurt maker in and set it for 8 hours.

Here's my trick. When you first make yogurt from live cultures it can take up to 36 hours for the cultures to come alive and go to town. The only way to tell where you are is this:

EVERY EIGHT HOURS  open up the top USING CLEAN PROCEDURE, take a clean teaspoon and nick a sample from the corner of the top. (do not stir). Taste the sample without ever returning the spoon to the batch. If it is zingy and tangy you are tasting the lactic acid and the yogurt is done. If it has a flat cream taste, it must incubate longer. If it tastes like sour milk then spit it out, you did not work clean and you will have to start over.

Fortunately making yogurt is easy and you can make small errors without starting over.

IMPORTANT INGREDIENT FOR SUBSEQUENT BATCHES
I like one quart yogurt makers because that is the right amount for about 3 days. When you are done set aside 4 oz. in a clean container for the next batch and use it like you did above. Always clean everything first - don't reuse the container thinking you can culture from that or you will have unwanted "guests". After a couple of batches any flavors or additives are diluted and you are eating the pure good stuff.

Yogurt has something that will save your life. The right amount of the right kind of bacteria.
Have you ever taken antibiotics? Have you ever had a UTI? Yogurt helps restore your natural equilibrium physically and mentally. Yogurt has lots of protein. It has lots of calcium. This is important for people who want a safe and healthy diet. For people who think. I eat gobs of it.



Monday, July 20, 2015

A Random Note on Sorting



The Verb View

In the landmark 1981 film “Sorting out Sorting” from the University of Toronto Computer Systems Research Group, we see computational sorts placed in three categories by the nature of the operation (the verb) they execute to accomplish the sort. These three categories are:
  • Insertion sorts
  • Exchange sorts
  • Selection sorts
Insertion sorts find an out-of-order member, put it in the correct position, and then reorders the remaining members to account for this. When an array is used to store the entries in the list to be sorted, this reordering requires a quantity of operations whose number is proportional to the original size of the list. In computational complexity speak we say that this reordering requires order n operations, abbreviated O(n).

There are three  parts to every sort:
  • Traversal
  • Comparison
  • Movement
If the comparison step requires a fixed constant number of steps but the movement requires O(n) steps, the complexity of the sort will be at least the complexity of the slowest step, O(n) in the case here.

Sorts that require O(n) steps to compare and O(n) steps to move tend to run in O(n2) time. For large lists we don't like this as it creates a practical upper bound on the size of the list we can sort. It should be noted that when we are sorting just a few items, an O(n^2) sort can be just as fast, both in execution and implementation as a linear time sort. But it is always poor form to use an O(n2) sort on a large list, especially since there are so many excellent and free implementations that run faster.

The Noun View

The complexity analysis enumerated in Sorting out Sorting assumed that the elements of the sort were, at some point, stored in an array. For some sorts, this array is converted into a tree.

Let’s go back to the insertion sort for a moment. Consider a reordered element inserted between Array[i] and Array[i+1]. If the index [j]of the reordered element was greater than [i+1], then Array[i+1]…Array[j] elements must each be scooted over until their place in the ordered list can be determined. On average some linear fraction of the list elements will have to be moved, and if we do this n times for each element in the list we are left with a O(n^2) time complexity, a famous example of which is bubblesort.

But now instead of storing our list as an array, lets say that it is stored as a doubly-linked list. Inserting an item can now be done in constant time, because we do not have to scoot all the remaining items down the line. So an insertion step that requires linear time complexity O(n) using an array data type, requires only constant O(c) time complexity in the linked list case.

The astute reader will note that this speedup has not been obtained for free. A doubly-linked list requires that we not only store the item itself, but we must also store the links to the previous and next items. If our business plan involved sorting integers, we have tripled our storage costs by using a doubly-linked list.

The mental exercise that comes from this redux is to consider the cost of traversal, comparison and movement of list entries using the following structures:

  • Arrays: See Sorting out Sorting
  • Doubly-Linked List: See development above
  • Stacks (Last In First Out = LIFO)
  • Queues (or Lines, First In First Out = FIFO)
  • Bags (non-indexed, non-linked, you reach in and see what you get)
  • Trees (many kinds of trees each with their own properties)
This blog came from a question I asked myself this morning, "Does bubblesort on a stack give you the Towers of Hanoi?"



Cool Demonstrations

This site shows a nice comparison of sorting methods including their sonic signature.



This is an aid to feeling and learning what is happening during the sort. It is also handy if you have ADD because 15 sorting methods are compared in just six minutes.

The site sorting-algorithms.com enables a comparison of various methods and does the sort while you watch.


It does the best job of showing the performance of sorting algorithms on pathological cases, like nearly-sorted lists, reversed-lists and lists whose pivots are pathological.  One sorting algorithm that I like, even though it is not optimal is shellsort. If you had to stop the sort midway, the list is very close to being in the correct order. One might imagine this shellsort being best in situations where the number of items was very large, or where there was some real-time deadline in force that prevented finishing the sort.

If you want to move past the basics, MIT open courseware has some excellent lectures on the computer science fundamentals of sorting, including the mathematics of proofs briefly touched above.



Finally consider if we could use computing machinery to sort hazardous waste into its constituent components. Wouldn't that be useful!








Sunday, June 14, 2015

Recycling Near Miss with a True Rigging Innovation


Ok, I admit it, I recycle everything. It's nuts, but it's a healthy outlet for my obsessive preoccupation that garbage should all be turned around to make new things, rather than rotting away in a landfill somewhere. The only exception to this rule is, "chicken juice drippings", but I digress.

This is a tale of an obsession gone wrong, one two many trips to the bin. There is even a double entendre in there somewhere.

Since the average attention span is now only 7 seconds I am going to shorten this up. Just the facts, Jack Webb style.

Moore's law must be kept intact. Update computers every couple of years, keep them a couple after that, "just in case".

Store in original box away from sunlight and ants that have mutated to eat plastic.

Mac 8500. Not my favorite but there it was in the box, a luxuriously big box with handles and foam liners. It should have its own carrying case.


Recycling a computer here means a trip to Goodwill. The box was placed on the porch.

My wife said, "Someone is going to steal that".

I said, "Let them, it will save a trip to Goodwill."

When I wasn't looking she scooted the big box back in.

Saturday came. It was time to make the trip.

"Just in case", open the box, maybe there are some cables that don't belong to the machine, might need them.

Only there is no computer in the box. Instead a brand new Flexon parachute rig from Rigging Innovations, with my name monogrammed on the left riser, double-wrapped in plastic. It glimmers in the light.

I had never jumped it, but got it to replace my WonderHog.

It almost went to Goodwill.

Now it won't!

I wonder if it still works?

Maybe its time to to find out.


Wednesday, June 10, 2015

"Morgan": The Gift of This Morning's Home Invasion



I woke up this morning hearing the rumblings of an unknown who had entered into our apartment. No door bell. No ding dong. Struggled for consciousness I heard him going from room to room singing, "Morgan", first softer then louder. "Morgan". Who was Morgan and why was he in my house? Why was this guy looking for him? In MY house! Was a timer ticking off my last seconds? He goes into my daughter's room and I'm still waking up thinking, "What am I going to do?", as he then comes down the hall towards my room singing again, "Morgan". I know the names of the maintenance men, JJ, Reggie, Jason. There is no "Morgan". Before he gets to my door I yell out, "What the #$%^& are you doing in my house?" He said, "I knocked on the door". I bellowed, "Get out". He said, "Okay then" with this weird "It's your loss" tone. Did the door shut? I sleep naked. "What do I do?" I can't go running around the house naked to find "Morgan". Then he actually goes into my daughter's room two doors down singing "Morgan". I feel sick. My daughter's name is not "Morgan and I can't be having that. The three of us just moved into this new apartment complex. It had been plagued by fires. We got a good deal on the rent. "They caught the person starting the fires" we were reassured.


When we moved into this new place my wife put a baseball bat by my bedside window. I'm not a baseball player. It has been sitting unused since the last home invasion. The previous home invader stole my daughter's video camera and jewelry. Then he came into my room and saw me sleeping. I must look like Darth Vader with his helmet off. He fled from the front door leaving it wide open. Maybe it was a woman.

On 9/11 I purchased a 9mm pistol. I don't like guns. After 9/11 I didn't know where things were headed so I figured, "just in case whatever". My dad considered guns after Kennedy was shot, now it was my turn. After the first home invasion I learned something. My gun was locked up under the bed. I was dead asleep. They could have done the Psycho dance on me. What if I had shot them somehow? What if they spurted HIV arterial blood all over the carpet? Carpet is hard to clean, but it is quiet and I don't like the clanging of hardwood floors. Who wants a chalk outline of HIV dead person on the carpet? How do you work that into pleasant conversation? "Oh that's just HIV-dead guy outline, you can step over it...".

After practicing martial arts for years I learned, contradictorily, that I don't like hurting people. Its not the fear of being hurt, its the fear of hurting someone else and all the terrible feelings that come. People are precious. I have this glitch.


I don't like people coming into my house without asking when I don't know what their intentions are. So there is huge conflict between the guilt of inflicting lasting damage and avoiding harm. That is a terrible thing to carry around. There is no Undo command for lasting damage. I have a friend in a wheelchair and I think, "How can we undo his lasting damage?" You can't. Wallerian degeneration. Christopher Reeve had that. Dana died of cancer and a broken heart.


I called the property manager. I called my wife. I called my son who created a Silicon Valley security startup after the first home invasion. Then I got a call from the company that provides apnea supplies. The lady let me vent. The guy was gone. I knew my daughter was okay but I needed to sit down and talk to her. She said a man came into her room singing, "Working". She said, "She didn't like it that a man came into her room while she was sleeping". She said he sprayed something in her bathroom and worried it could make her cat sick.

I was concerned too. Last week a bug man sprayed the apartment with a mist that glimmered and hovered as sunlight streamed through the window. I asked, "What's in that?". The bug man said "Delta Dust".

"Delta Dust". My wife had cancer. Her dad died of cancer. My mom and dad died of cancer. My uncle died of cancer. What is "Delta Dust"?

When I called the property manager she said we were, "scheduled to be sprayed" and that they give out keys to everyone who needs them. I must therefore ASSUME that he was singing "ORKIN" as he went from room to room. "ORKIN".



Tuesday, June 02, 2015

Light Unit Testing and the Barely Bloggable


From the annals of the barely bloggable comes today's adventure, the repair of the light that refused to be repaired. Context: I am a unit testing nut. I have a deeply held and mathematically-decidable aesthetic about testing things before they are assembled and then testing them after they are assembled to make sure that they work, the whole work, and nothing but the work so help me God. This little light of mine, I was going to let it shine. It also magnifies and I was going to let it do that too.


Since this is barely bloggable I will hit the high points.

My desktop magnifier light has been on the blink for some time. By "on the blink" if you haven't gotten the fluorescent "air quotes" pun I mean, it would work, then it wouldn't, then it would, in a decidably undecidable way.

Setting it up after a recent move relegated it permanently to the "then it wouldn't" state, so I set out, for the second time in as many years to drill down and get to the dark root of the problem.

There are three main concerns in such a light of mine:
1) the bulb
2) the starter
3) the ballast

I replaced the bulb, assuming that like me, it had "burned out".

I flicked the switch and then "it wouldn't", or rather, "it didn't".

I took the bulb back to the local hardware store. I thought that the floppy plastic thing that completes the donut bulb held fragile wires. I thought these wires had given up the ghost, meaning, that one of them had broken or could conceivably break during reassembly, replacement or testing.

Much to my surprise the local hardware guy fished out a "flourescent bulb and starter tester" and proceeded to demonstrate that both my bulb and ballast were good. No Home Depot and Lowe's that I have ever frequented has ever hauled out such a tester. This alone saved me two trips to the hardware store, possibly saving my life if I had been killed in traffic on either one, but I digress.

I brought home the now-proven bulb and starter. The hardware guy said and I quote, "If it's not those then its the ballast", refering to the small black autotransformer that parks on the wall outlet.

After reassembly, it didn't, so I disassembled the ballast, un-tape-ing it and spilling out its transformer contents as I had done the during the last spelunking adventure with this light. I proved to myself that the transformer and connections inside were good by measuring the resistance of the one coil at 22 Georg Simon Ohms and confirming that the wiring connected to the blades of the plug by setting the voltmeter to the, "sing to me if its okay" setting, a setting which all VOM users will instantly grok.

So now I have a real problem. My three main concerns, bulb, ballast and starter work.

Enter into the, "take apart things that weren't intended to be taken apart" cave of what-have-we-here.

Buried, and I do mean hidden in the starter base were wires just lying there, never soldered by some worker who had to pee, or go on their lunch break or got a call on their phone. So I soldered the wires and reassembled that which isn't to be broken into and behold, my little light shines. I am going to let it shine before you because it is an excellent example of things not working when they actually should work, because some tiny but critical detail is hiding an assumption on which all illumination hinges. Hallelujah.

Tuesday, August 19, 2014

Ice Water and ALS

I've seen a lot of people dumping ice water over their heads, but not a lot of people talking about the underlying die off of motor neurons - the hallmark of ALS. Why just motor neurons and not sensory neurons? What is special about outgoing neurons compared to incoming neurons?



According to OMIM - online mendelian inheritance in man. There are ALS tagged genes on chromosomes 1 2 3 6 7 9 10 12 14 15 16 18 20 21 22. That is over 65% of the chromosomes in the human genome.



This is bad. It could mean this is a complex, multi-factor disease, like cancer which requires suppressor genes (the brakes) to be turned off and accelerator genes (growth or oncogenes) to be turned on in several places for cancer to emerge. Suppose there is a simpler explanation, say that ALS is a motor-neuron specific auto immune disease, say lupus for motor neurons.  What happens if we make a similar query for lupus?


Lupus is on everything!

Then the genes we're seeing just code for motor neuron proteins that are attacked in this auto immune circumstance. The question that we must always ask is, what advantage did ALS confer on its bearers in the evolutionary sense? For example sickle cell anemia confers on its 1 hit bearers (heterozygotes) resistance to the worldwide killer of malaria at the cost of seriously harming its 2 hit bearers (homozygotes). Survival at any cost... It's very important not to confuse a single factor single-point mutation disease like sickle cell with a complex disease like ALS.


What if we ask the question, what chromosomes have BOTH ALS and lupus marked players? Anding the two charts just give us the first one since lupus is everywhere.


Lou Gehrig was a champion baseball player. This means he had very quick reflexes and effective motor execution relative to the population of competitors. Why would a better motor nervous system confer on one a greater likelihood of auto immunity, or a Huntington's chorea-like duplication error? Huntington's looks different, it is a CG repeat disease on the tip of chromosome 4. These repeats cause errors in vital brain proteins sentencing the sufferers to progressive dementia and eventually death.


Maybe there is a clue in the Zeitgeist having to do with cold water. Will cold water protect the motor neurons? Is there a temperature-sensitive component to the mechanism of this disease?