Tuesday, October 23, 2012

Help! I'm becoming a spambot!

It starts with slowly losing your ability to read those capcha things in online forms. Then gradually you send shorter, more frequent emails, which increase in annoyance and spelling errors and decrease in meaningful content. Then you begin feeling a strong urge to look at the Google keyword statistics page every few minutes. You may develop an obsession with collecting vast amounts of valid email addresses. The last step is when you begin writing your blogs in raw HTML and the meta tags contain more data than the blog post itself.

Do any of these symptoms sound familiar? If they do, you may have a severe infection of spambotitis. It is a degenerative disease that slowly morphs you into a spambot until you fade into the world wide web as just another useless email / tweet factory.

Consider this post your guide to survival in a world of targeted ads and social media. Here are some pointers on how you can avoid becoming a spambot!

1. Always use your real name in your email address.

As long as your account is secure, there is really no problem with this. Change your password often, and never use the same password for two or more different accounts. If you have trouble remembering passwords, either write them down near your computer, store them in a password tracker program, or come up with a way to construct them from an idea or a phrase that you can easily memorize. It helps if you use random letters, but can still attach some kind of meaning to them that only you would know - particularly something that relates to that account or website you're creating the password for.

Using your real name will distance you from sockpuppetry, the first step towards becoming a spambot. Spambots can send emails at will because they are completely anonymous, and multiple bots may be controlled by a single person or computer. Even though your real name is more traceable, as long as you don't attach your email address to any real details of where you live or who you are, the chances of an identity theft claiming your personal information are slim to impossible. Just remember that anything you don't post online can't be stolen online!

An added bonus is that it looks much better to have john.smith24@gmail.com on a resume than johnny_baby_margaritas@gmail.com.

FYI - Sockpuppetry is the act of managing multiple accounts on the same website, pretending to be different people (especially on forums or chat boards). It's a bad practice and usually engaged in by trollers or flamers who don't want to be recognized as such by people who have previously banned them. A troller/flamer is someone who goes around the internet looking for a way to start arguments and incite drama, tension, or anger on a forum or chat board. Flame wars are just a fancy name for online arguments, though the name comes from the fact that they can be (and are intended to be) quite heated and antagonistic, usually involving swearing and belittling by both sides. You have to be very, very careful to not buy into these arguments and continue feeding the fire.

2. Remain ignorant of SEO.

The second huge step in becoming a spambot is learning about SEO, or search engine optimization. The less you know about it, the better. SEO is a spambot's world and entire life. They eat, breathe, and sleep SEO, or they aren't good spambots. Steer clear and be free.

3. Don't read or reply to spam email.

Spambots are essentially a network of computers and email servers that churn out emails day and night, generating them on the fly based on SEO, ad targeting, and information stored in each user's browser about what they look at (called cookies). Cookies are harmless little bits of info that a website uses to, say, show you ads that are more relevant to the purchases and product choices you've made in the past, or shown an interest in by remaining on certain pages longer than others. Ignoring spam email puts fellow spambots' hard work into the dumpster where it belongs.

4. Learn to write clean and concise emails/chats/tweets.

Don't skimp on your writing skill online, even for "unimportant" emails. All emails have a potential to be forwarded to someone you might not have intended to read the email. You would be surprised how impressed people can be simply by a well-written email or chat with no spelling or punctuation errors - just think of how rare those are in today's world! Often we communicate more with what we don't say (albeit, via email) than in actual, verbal exchanges. Make sure your writing skill is up to par and doesn't scream "spambot" all by itself. There is no reason not to.

5. Don't waste time on social media.

Spambots are all about wasting time. Don't cultivate a habit of spending hours trudging through tweets and Facebook, and you'll be better off. Just think of all that extra time you'll have to spend actually being productive! I suppose you could make the argument that spambots are quite efficient and productive; however, the endless spam emails they send, and the fact that 95% of them are ignored completely, makes them some of the most inefficient and unproductive programs ever written.

Disclaimer: This post is intended to be humorous, but honestly I've seen some spam emails that looked more intelligently put together than emails I knew were from an actual person. Do yourself a favor and apply some security and discipline to your online communications. You'd be surprised where it might take you!

Disclaimer Disclaimer: On the other hand, instant messaging is a different beast. It's okay to "lol" and omit punctuation in instant messages, though the general principle still applies that neater is always better. In this case I find it is more a matter of personal opinion, Twitter being a close shoe-in to IM/chat. Ironically, Twitter's 140-character limit can actually help with point 4, since you have to learn to say a lot with a little.

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.

Tuesday, July 31, 2012

Wanted: Schrodinger's Cat, Dead AND Alive

I've always been fascinated with the idea of Schrodinger's Cat. For those who don't know what that is, I'll elaborate:

Picture a cat. In a sealed box. A box with an odd-looking machine inside. This machine will randomly dispense poisonous gas, which would instantly kill the cat. Well, not quite randomly. There's a nifty little gadget called a Geiger counter hooked up to the gas chamber. A Geiger counter is a device that detects certain particles passing through it - particles so tiny or volatile they can pass through matter; X-rays, for instance. The idea is that when the box is opened, the cat will be either dead or alive.

However, the interesting bit is that before the box is opened, the cat is said to be both dead and alive. This is because, due to the random nature of the machine, we cannot determine for sure whether the cat is dead or alive without opening the box. But ah - whoops! If we open the box, we may well change the state of the cat, and therefore, still be none the wiser about whether the cat was actually dead or alive before we opened the box.

It can be likened to the Heisenberg Uncertainty Principle, one of the most interesting facets of modern physics and/or science in general. It states that no quantity can be fully measured to perfect accuracy - not only because we have no method of recording a measurement of infinite precision, but also because the act of measuring itself, on such a microscopic scale, changes the quantity being measured.

Insert random Heisenberg joke here:

Heisenberg is out for a drive and is going quite fast, when a cop pulls him over.

"Do you have any idea how fast you were going?" the cop asks him.

Heisenberg replies, "I might have, but blast you, you just had to go and measure it!"

Another conundrum that provides great food for thought is quantum physics. Without going into much detail, the idea is that small packets of matter (the smallest known, in fact) called quanta, are constantly going in and out of existence. This changing state is governed solely by probability, and the act of observing a quanta forces it to collapse into one of its probable states. In other words, until you look directly at something, it may or may not be where you think it is. It's probably reasonably close - but its exact shape and details of its existence (such as viscosity, temperature, and structure - things all determined by its atoms and hence, its subatomic quanta) are not set in stone until you actually observe it. When observed, each particle must collapse into one of the possible states, according to the probability of each.

This probability is identical to, say, rolling a six-sided die. Half of the time, the numbers 4 through 6 will be rolled. One third of the time, the numbers 1 or 2 would be rolled. Lastly, 3 is only rolled one sixth of the time. If these three outcomes have the same probability as the appearance of different states of a certain quantum particle, then one state will occur three times more often as the others - the state that appears half of the time (rolling 4, 5, or 6). The second state, rolling 1 or 2, occurs twice as often as the third state (rolling a 3). So each time you view this quantum particle, you've just rolled the six-sided die, and the particle you see (its location and properties) are determined by rules of probability, much like those discussed here.

Tuesday, July 24, 2012

Premeditated Toxicity

One of the most fascinating paradoxes I've ever come across is that of the poison gambit. For lack of a more standard name, I've chosen that one. Or, if you like, premeditated toxicity. Or perhaps better yet, "Who Wants To Die A Millionaire?"

It's a sort of contest. You will win a million dollars (or pounds or the currency of your choice) if you can simply intend to drink a toxic substance - a poison guaranteed to take your life. Note carefully the specific phrasing used - you don't have to actually drink it. You only have to intend to drink it. The contest might therefore involve some sort of waiver for legal purposes saying that you agree to drink the poison and that if you do, the host company cannot be held liable for the consequences of your own intent and actions based on that intent. The exact details of this are unimportant.

The paradox is, can you intend to drink the poison, collect the money, and then later change your mind and not drink it, thus living on and being able to enjoy your reward? It's a very interesting thought experiment into free will. I believe I've resolved the paradox.

The answer is this: NO. You cannot actually intend to drink the poison, then later, decide not to. If you did this, your intention to drink the poison to begin with would not be valid, and your winnings would be forfeit. On a positive note, you wouldn't have to drink the poison and could continue on happily with your life (one million dollars poorer, nevertheless). Assuming there was a lie detector or that the contest had some other way to verify your real intent, you would be completely unable to "cheat the system" and lie about your intent to drink the poison.

However! It is actually possible to intend to drink the poison, claim the reward, and later, not drink the poison and live on to celebrate it. Yes it is! And this does not contradict what I have said in the previous paragraph. There is a subtle difference. It's true you can't actually decide on your own to not drink the poison, later. To claim the reward, you have to truly intend to drink the poison, and with every fiber of your being, know that you are going to drink it and die from it. However, there are two ways to get out of it - one improbable, and one reliable but dependent on the rules of the contest.

First, the unlikely way: something unforeseen has to happen, something you could not have predicted and that you had no hope of stumbling into. This event must somehow change your mind about whether you wanted to drink the poison or not. For instance, perhaps after going through a divorce, you felt alone and became severely depressed. You thought you could at least give your kids a better future by providing well for them, though you wouldn't live to see it. Then, after the contest is over, but before you drink the poison, along comes a stunning, single woman into your life and you fall in love and are no longer depressed, and you actually don't want to die anymore. You find a reason to keep on living. This would not break the rules of the contest, and your finding love would be a triple bonus: you now have the promise of a happy relationship, a lot of money, and a bright future with no obligation to actually drink the poison. You were sincere in your intent, because you had no idea such a great event would happen to you and so drastically change your outlook on life.

The other method is the cheap shot. This may not be possible depending on the specific rules of the contest, but let's assume that you are not told the specific date on which you must actually drink the poison. When you intend to drink the poison, you must fully and completely agree to drink the poison at some point in your future, barring any event that kills you in another manner. In which case, the winnings would not be forfeit - remember, you only need to intend to drink the poison - the actual drinking is merely an extremely likely consequence of your intent to drink it.

Have you already spotted the loophole in your mind's eye? You can intend to drink the poison, claim your winnings, and then indefinitely postpone the actual drinking of it. You fully intend to drink it, but since the actual date was not specified, you simply intend on drinking it so near the end of your life that its fatal result means almost nothing. Then again, if you wait long enough, you may actually die unexpectedly before you even had a chance to drink the poison. Either way, you're practically scot free. The only real caveat is that you do have to truly intend to drink the poison at some later date!

This loophole makes an interesting question of intent - how do you define an intention? Is it immutable as first conceived in your mind, or are intentions a malleable substance that can be formed and shaped on a whim? Food for thought, or at least for another post.