Tuesday, August 28, 2012

Do You Want What You've Got?

Kids want everything. Candy, toys, or anything that appears at first glance to bring happiness and fun. Then when they get home, instead of actually having fun, they fight over the toys. During this fight, one or more of the toys likely breaks, and the real crying begins. Then, if one of the toys was a paddle ball (and it's not one of the broken ones, or the eldest child has cleverly thought to hide it) they all are likely to be swatted with it for misbehaving. At this point, clearly no one has had any fun at all. However, from the kids' point of view, everything would be perfect as an adult since you have your own money and can buy as much candy or toys you want. And as an added bonus, you never get swatted.

Adults want everything. Cars, energy drinks, anything that society claims will lower your monthly payments or make your kids settle down (or preferably, go to sleep) and stop fighting over their toys. So you take out a huge loan on a nice house and a spiffy car. The kids wreck the house fighting over their toys, and the car gets hail damage in a freak ice storm. When everything thaws and you can finally head to the grocery store, you realize that after paying all your bills, the only thing you've got enough money left for are energy drinks. Then, you remember that they're not good for you anyway, so you decide to buy your kids another paddle ball (since the last one is either broken or hidden, and possibly both). Clearly, kids have all the fun. Man, wouldn't it be great to be young again?

There's something lacking in both these pictures, isn't there? It's peace and contentment. Despite innate desires apparently being fulfilled, neither group is happy with what they have. Instead, it's all too easy to continue buying into the lie that obtaining more stuff will bring joy. Since the first thing didn't work, why not try another? There's never an end of new "things" to choose from.

Yet it really doesn't work that way, does it? How many times has a new car, or a piece of candy, ever brought anyone true happiness or contentment? Most candy goes down in a quick gulp, and new cars eventually turn into old ones, which eventually fall apart. No, lasting contentment and peace can be found only in the act of giving, rather than getting. How many times in the past month have you stopped to reflect on what you already have? And more importantly, how grateful are you to have it? The answer to that question is a very good indicator of how happy the next "thing" that comes along will make you once you obtain it.

I will just leave you with a quote:

"Happiness isn't getting what you want, it's wanting what you've got."

-Garth Brooks

Tuesday, August 21, 2012

Taxonomy of Music

As a disclaimer, some of this post is intended to be humorous. Don't take it too seriously and don't take any of this as my personal opinion for or against any of these genres. I've tried (maybe unsuccessfully) to keep my opinion of each genre as separate from this as possible.

This is basically my definition for each of the genres of music. I won't claim to be knowledgeable about this so if I've gotten some wrong, it's because I probably don't listen to that genre very much and/or don't understand completely what it is. Again, some of these are more facetious than realistic.

Alternative - Incorporates such variety or such a wide range of styles that it doesn't fit neatly into any of them. In one word, unique.

Ambient - Atmospheric, ethereal. Few instruments, limited but just interesting enough to keep you listening. In one word, minimalist.

Bluegrass - Like Mardi Gras, but for music, not food. Jazz, but not quite. In one word, indulgent.

Blues - A fairly standard range of chord progressions which are used to evoke sad, melancholy, or depressed emotions, though those are not the only choices, nor are they always the most prominent. They are simply the most common, and hence, the name. In one word, well, blue.

Classical - Instrumental, symphonic music. Solo piano and orchestral are staples of this genre. If it could be described with one word, I would have attempted to come up with one. But it can't.

Country - A good ol' boy's got a dog, a truck, a woman, and some booze, and he sings about them regularly. The story changes from time to time, but not the subjects of his affection. Not to discount female country singers, of course - the only difference is, no dogs or trucks. They only sing about their feelings, men, and their feelings about men. And sometimes booze. In one word, trailer hitch (that's intentionally neither one word, nor an adjective).

Dubstep - Like techno, but even more repetitive; usually one vocal sample from a famous song repeated every 5 to 10 seconds, with some odd electronic/techno noises in the background. Often combined with other genres. In one word, alien.

Easy Listening - Just simple music, quite a wide variety but usually softer instruments. Jazz is often associated with this genre and the two do go hand-in-hand quite well. In one word, cool.

Electronic - Almost no real instruments or real people playing them; mostly synthesized with lots of effects. In one word, futuristic.

Funk - Rock, with a lot more sweat and head-banging. In one word, loud.

Hip-hop - Party/dance music, stuff that instantly makes you want to start jumping up and down or waving your hands in the air. Basic tenets are: an infectious beat; lots of different instruments and sounds happening all at once; and a touch of crazy. In one word, contagious.

Jazz - Swing, a certain vibe and character to the music that can be achieved with very few instruments and even the simplest of melodies. The moods can vary, but the basic idea is smooth, flowing, and glossy. Jazz works well as either fast and energetic, or slow and pensive. In one word, sleek.

Opera - Always singing, commonly with an orchestra. It is an acquired taste (meaning you can't just listen to it the first time and like it, it has to grow on you) but once you "get it" there is nothing better. Singers that can do opera justice have the strongest voices there are. In one word, grandiose.

Pop - Halfway between hip-hop and rock, with a greater variety of sound/instrument choices and more interesting melodies. Usually has a very intense, pulsating drum beat. In one word, sharp.

R&B - Rock & Blues? Reggae & Bluegrass? Your guess is as good as mine. In one word: soul.

Ragtime - Music to work to? Always a lively tune and a catchy melody, but simple, and with an air of light-heartedness. Of course, if you're working, then who's playing the music? And if you're playing the music, then who's working? In one word: funny.

Rap - Poetry with a beat and an attitude; slightly musical poetry delivered in an intense way. Sometimes quite repetitive, and often with darker themes and moods. In one word: happenin'.

Reggae - I haven't the foggiest idea what this is (nor why I've included it).

Rock - The most standard or recognizable type of modern music; usually has guitars, a solid drum beat, and vocals, with a very high-energy vibe. Think guitar hero. In one word, energetic.

Rock & Roll - Like rock but less intense and more dramatic. (The two are very similar)

Techno - Like electronic but a lot less interesting; the whole song is basically the 30-second sample on iTunes, repeated several times, with a minor change here or there to spice things up. In one word: repetitive.

Tuesday, August 14, 2012

A Matter of Taste

Taste is one of the most interesting sensations, because there are so many different flavors and possibilities, which seem to stem from just four basic building blocks: sweet, sour, bitter, and salty. I find it amazing that such variety is possible simply with these four flavors in different amounts.

One common misconception about the tongue is that each flavor sensation is limited to a certain part of the tongue. To the contrary, the myth seems to have sprung up since the sensations are typically more powerful in those areas. Either the tongue sensors in those areas are more developed/sensitive, or there are simply more of them.

A great example of the complexity of flavor is champagne. While made mostly like wine, the primary difference is that many different wines are combined to make a more interesting flavor, and the yeast and and fermentation byproducts are removed, which makes the flavor sweeter. What is so fascinating about this is that there are teams of taste-testers dedicated to ensuring that the new batch of champagne has the exact same flavor as the old one. Why is this necessary? Each crop of grapes will naturally have ever-so-slight variances in flavor, and this is something only such world-class taste-testers would notice!

One pro tip for tasting anything liquid, particularly wine - smell it first with both your mouth and nose open. This imprints the scent and part of the taste (since smell is apparently 70% of the taste anyway) so that when you actually taste it, you get more out of it. In addition, while tasting it, swirl it around and savor it, rather than swallowing immediately. Keeping your nose open here helps as well. Most people tend to unconsciously close their nasal cavity when drinking - it's a reflex designed to prevent you from inhaling instead of imbibing. Just suppress the reflex long enough to get more out of the taste, but only before you swallow. When you swallow, this reflex is a very good thing!

I imagine these tips might also help for solid foods, but are probably not as effective, especially when it comes to drier foods like bread. Scent is transmitted via microscopic particles and/or vapors, and vapor is produced more readily by liquids, especially at higher temperatures. Higher temperature simply means more movement in the atoms and thus a greater chance of particles vaporizing.

Why then does a bakery smell so good, if dry foods don't produce as many particles? An increase in heat causes motion in the air. Heat wants to move and rise up, and this includes air from the oven. As the bread bakes, yeast in the bread produces gas, causing the dough to rise. Some of this gas will escape the bread, and since it is very hot, it will act just like any other hot gas and try to escape the oven, building up pressure if it cannot do so. When it does escape, wind will then carry this hot air, which then brings the smell of baking bread along with it.

Another fascinating mystery in the realm of taste is the compound known simply as miracle berry (literally, as the molecule causing the effect is known as miraculin). Apparently, it changes the flavor of oranges and other citrus fruits when eaten beforehand, making them sweet instead of sour. I've never tried it, but I imagine it would be quite interesting and stimulating. One also wonders at its effect on other foods!

Now, taste gets really interesting when you combine two flavors together, even if you are not experiencing them at the same time. The effect is much stronger in that case, however. For instance, if you take a bite of something, then after you've swallowed that, take a bite of something else, the taste from the first food is still imprinted in your memory. Some of the liquids or particles from that food may still be on your tongue, as well. Either way, upon tasting the second food, you experience both the flavor of the new food, the flavor of the first food, and most importantly, the difference between the flavors. This is what really makes things interesting, as you'll see more of in a minute.

In this case, you've experienced what I like to call a one-way flavor delta. Delta is the Greek character that looks like a triangle, and is used in mathematics to represent change or transition; more specifically, the amount of change. In this case, you have now tasted both flavors at the same time, though a lesser amount of one than the other. Due to this discrepancy (tasting less of the first flavor), this is only a one-way delta, meaning you experience the difference between the flavors in one direction. You taste more of the second flavor, so you can tell more about how that flavor differs from the first, but not vice versa. The first flavor is now all but gone, though for a brief moment both of the tastes were there. After a couple more bites of the second food, the first flavor is wiped out completely, and the taste of the second food becomes far less interesting.

Taste the foods in reverse, and you will understand why I call it a one-way flavor delta. The difference between food A and food B is not the same thing as the difference between food B and food A. You have to experience this personally to know what I'm talking about, but I'm certain that any good taste tester would agree with me here. The second flavor is always stronger (unless you try them both at once) and this creates a discrepancy in which your taste buds must tell you more about one flavor than they can about the other, causing this one-way difference.

When you have two different foods at the same time, that is when things get really magical. Not only are you now tasting flavor A and flavor B at the same time (in roughly equal amounts), but you are also tasting what I call a two-directional delta. You can now taste the complete difference between both flavors, and this is one of those cases where the sum of the parts is greater than the whole. That's why a sandwich tastes so much better than just eating the individual things one at a time, even though the parts are all the same. The average sandwich has (I would estimate) about 10 different flavors in it, so this means you are actually tasting ten flavors as well as C(10,2) two-way flavor deltas! That's an incredible combination of 55 flavors and flavor deltas at once. I bet you never knew that 5 plus 5 on a sandwich equals 55! (Heh, actually if you write '5' on the crust of both pieces of bread and look at it sideways like the spine of a book, 5 plus 5 DOES equal 55!)

For those mathematically-inclined folks, C(n,k) is a combination of n items taken k at a time; in this case we have 10 distinct flavors taken 2 at a time, giving us 45 flavor delta combinations (plus the ten individual flavors themselves for a total of 55). A combination is very similar to a permutation, except order does not matter, similar to a hand of cards, but unlike a race where the racers finish in a certain order.

Tuesday, August 7, 2012

Good Code

No one appreciates good coding, because only coders understand what coding is to begin with. For anyone else, if the thing works then you only did your job - that doesn't make you a good coder. Well, it does, but to anyone who doesn't understand it, computer code that works the first time is just normal, not great. If anything, it only reflects badly on the quality of the testing that was done.

On the other hand, bugs are high visibility and high priority, unlike coding. Only when it's broken do people seem entirely willing to acknowledge that code actually does exist. If you fix a lot of bugs in a few hours (despite it being far simpler than the actual coding, in most cases) then people understand that you've done a great deal of work. Coding nearly always goes unnoticed and unappreciated. If the code works fine, then it's just ignored, like it doesn't even exist.

To get some perspective, apply the same argument to writing in general. Writing software is in many respects very similar to writing prose or poetry. Programming languages have nearly the same semantics and syntax as spoken languages, it's just that their purposes are quite different.

Computers never use programming languages to communicate with us; it's only us communicating to them the instructions that we want performed, the order we want them performed in, and the logic that holds the rules together and the system in place.

With writing, absolutely no one expects you to get the first draft right. What makes you a great writer is being as good at revising (or better) than you are at writing.

The same applies to coding, only the underlying purpose gives the revisions a different purpose as well. In both cases, you are revising in order to make the written medium (words, code) better. Better writing is hard to define, since writing is a little more of an art form than computer programming. Better code, by contrast, is well defined - if it doesn't work, it's not good code. I will now go through some of the differences between good writing and good code, and how the writing systems themselves differ.

Prose writing is more about the context than the actual words, though being a good wordsmith certainly earns you extra points. The context is normally the story elements (plot) which includes character development, something that takes a good deal of time to do outside of the actual writing. The characters must be alive in your head and have their own motives, goals, aspirations, and personality, before you can plug them into the time frame and particular circumstances of your actual story and have it come out sounding realistic. In the case of non-fiction, the context is your particular topic or subject, and the structure of your argument or points. You remember this from high school English class: the first sentence of each paragraph should be the theme or thesis of that paragraph, followed by support, evidence, and further argument about that same point. The first paragraph is normally an introduction and the last is normally a conclusion, with at least three body paragraphs between them.

Poetry, on the other hand, is all about word selection, diction, and imagery. Poetic devices, such as rhyme, alliteration, meter, and various other tools, are of paramount importance. The actual message is usually only a result of the deeper themes and moods created by the specific words and their connotations. I find that rhyme is often a quite underestimated tool, not used as often as you might think in poetry. It can be used to emphasize - the words involved in the rhyme are usually the focal point of the entire phrase or sentence. Thus, it is also important to choose which words are going to rhyme, and as such, this often requires some grammatical flexibility to rearrange the parts of the sentence in a way that doesn't sound archaic or confusing.

Lastly, computer code is like neither. The entire purpose of computer code is logic - that is both its foundation and its end. The building blocks are simply logical constructs, such as a loop that executes a portion of the code over and over (to avoid having to write many instructions that do mostly the same thing). Most logic boils down to conditions - if this, do that, or if this other condition is true, do this other thing. If this condition is false, skip this part of the code. This logic tells computers how, when, and what to do, in a way that bears no interpretation (heh, at least not the kind you're probably thinking!) Here is where we get into the revision.

At this point, I'd like to mention one minor historical anecdote: the first computer bug actually was a bug! A moth had been electrocuted while chewing on some circuitry in one of the first mainframe (room-sized) computers, and was causing a short in the circuitry. What then constituted the 'software' was actually hardware, in the form of vacuum tubes and switches. The switches would be set to input the instructions, and the computer would run through whatever instructions had been set in these switches. A programmer's job back then would have been to manually go to each switch and move it to the right setting, according to a long (and probably quite boring) sheet of numbers. This bug probably took a while to find, as the chances of a programmer losing his focus and mis-setting even a single switch were quite high!

Revising computer code is simple, yet not straightforward. This is because most often, you don't know what specifically is wrong with the code and how the problem is being caused. If you had, you wouldn't have written the wrong code in the first place! The first step is called 'debugging' which means going through the code, one instruction at a time, and watching the computer perform it, then examining the current state of the computer and the resulting output at that point. Once the problem is seen, the instruction last executed is most likely to be the one causing the problem. Now that this is known, it is normally a simple matter to determine where the error in the logic lies, and rewrite the code accordingly. Therefore, until programmers can code perfectly, we are stuck with bugs for the time being.

Now, the existence of bugs is no reason to knock computers themselves! The great thing about computers is that they are seldom at fault for the problems we face. It is normally operator error, either on the programming side or the user side. If the programming is wrong, we call it buggy or glitchy. If the user is wrong, it is known as a PEBKAC (problem exists between keyboard and chair). Computers execute their instructions correctly 99.9 % of the time. Whether those instructions are right or wrong is a different matter. Readers more interested in the subject of computers writing their own instructions should have a look into aspect-oriented programming. It is the newest programming paradigm, a step up from object-oriented (warning for the non-techies: highly advanced technical terms may cause head to explode). See my other post for more information about the different programming paradigms.