codenode

DB<3> x $code

The truth about QuiBids

Posted on July 29th, 2010 by Daniel Nichter

QuiBids is a penny auction website with an irresistible hook: win awesome stuff at bind-blowing prices, like a brand-new Apple iPad 16 GB Wi-Fi for $4! It seems unbelievable but it’s true. It’s also very deceptive.

I spent a little over $300 today and won only some Pyrex contains (I did need them, at least). Before I expose the penny auction machinery let me make clear: I’m not blogging this in a fit of rage over my $300 Pyrex containers. Believe it or not but I don’t care about the money. Also, I intended to spend that much because I was sure no one would out bid me at that price level (I was bidding for an iPad and historically they’re won at far less than $300). My motivation for this blog is simply to lay bare the plain details and facts about how (this) penny auction website works financially, to show and prove to you that, unless you enjoy seeing your money disappear at a fantastic rate whilst participating in the grotesque enrichment of the company to which it went, you should not participate in penny auctions.

I speak of QuiBids because it’s all I know. I can only guess that other penny auction websites operate similarly. If QuiBids objects to this blog post then that’s too bad because I’m protected by free speech and nothing I’m about to say is false to the best of my knowledge. (I will correct any factual inaccuracies pointed out to me.)

Let’s use this auction as an example. At the time of writing, the bid price for that iPad is $157.26. Let’s simplify and call it $150. Now here are some important facts:

  • Users (i.e. you and me) must buy bids; users do not bid with real money.
  • Each bids cost $0.60 (sixty cents). E.g. 75 bids = $45.
  • The price of items, like our example iPad at roughly $150, are bid up in $0.01 (one cent) increments (this varies; sometimes the increment is more).
  • The user who wins can buy the item at its final bid price.

Let me first emphasize the last point. If an item is bid up to $150 and you win it, then you buy it for $150 plus all the money you spent on your own bids, that is, $0.60 times the number of bids you made. So if you made 100 bids then you spent $60 on bids (100 * $0.60). Therefore the real final price for your item is $210: $150 for the bid price + $60 spent on bids.

Obviously you want to place as few bids as possible, but that seems nearly impossible to do if you have any chance of winning a “sexy” item like an iPad because, as our example auction shows, the bidding may drag on for hours. Our example auction began sometime this morning around 11am–I know because I place 278 bids ($166.80). This presents a very high barrier: bid competition. Some auctions end after less than 100 bids, and other auctions require thousands of bids. It’s easy to calculate how many bids an auction has received: for auctions with $0.01 cent increments the number of bids is simply PRICE * 100. So our example is 150 * 100 = 15,000 bids. The math is simple: 1 bid = 1 cent increment in price and there are 100 cents in a dollar so there are 100 bids in each dollar of the price.

Now wrap your mind around this: each bid cost someone $0.60, so if an item, like our example iPad, has received 15,000 bids then that’s 15,000 * $0.60 = $9,000 that QuiBids receives for one iPad.

Someone is going to win that auction, and let’s say it’s someone who comes into the auction late and bids only 100 times, thus costing their self $60 plus whatever the final price of the time is. Right now, since I’ve been typing, the price has increase from $157.26 to $160.78. Let’s be generous and hypothesize that someone won it at $160. So their final price is $160 + $60 = $220. And $160 at 1 cent increments requires 16,000 bids minus the 100 the winner placed meaning that the losers spent $9,540 (15,900 bids) for nothing. I am one such loser.

In their defense, QuiBids let’s you apply the money you spent on bids towards buying the item at what they consider retail price. For me that means I can buy the iPad for their retail price of $699 – the $166.80 I spent on bids, which equals $532.20. With shipping the iPad is $548.19 from QuiBids and $528.94 from Apple, a difference of only $19.25. That’s seems fair, right? No, we’ve been tricked again! When I describe it like that it looks like I’m only paying $19.25 more for my iPad but in reality I’m paying $548.19 to “buy it now” plus the $166.80 I already lost which totals $714.99, or $186.05 more than had I just bough the iPad directly from Apple. I’m still better off just paying direct from Apple and cutting my losses with QuiBids because if I buy from Apple for $528.94 that totals $695.74 with my $166.80 QuiBids loss, or $19.25 less than the “buy it now” option. Sure that’s only $19 but why give QuiBids another $19 when they’ve already raked in over $9,000 for that one iPad?

Even worse, my $300 loss was over two auctions so the amounts cannot be combined to buy an iPad through QuiBids less $300. If that was possible then I probably would not have written this blog. (I intended to play only one auction but technology failed me–that’s a completely different complaint, though.) I think the inability to combine losses verges on unethical because, all told, I gave QuiBids $300 in exchange for $26 worth of Pyrex contains–that’s terribly imbalanced. I’m willing to pay them more than Apple’s retail for an iPad because the extra money would be for giving me and others a chance to win that iPad for a very cheap price. Of course, any way it goes, I’m out money but that’s the price I pay for playing such games.

The bottom line: penny auction websites like QuiBids are a bad idea because countless people will waste countless hours of their lives only to lose thousands of dollars on a single item which costs, at retail, only a few hundred dollars, and all their lost money becomes the sole profit of the company which cleverly masques the dollars-and-cents reality of its game in a shroud of penny-bid lingo.

Parsing SQL WHERE clause

Posted on July 26th, 2010 by Daniel Nichter

Parsing a SQL WHERE clause is really difficult. A number of people have told me, “looks like grammar”, implying that I should use some traditional grammar/rule-based solution like yacc or bison, but I can’t because Maatkit tools (of which this is a part) must have minimal external dependencies. Plus, I don’t want or need to parse SQL fully; I bet only MySQL can really do that. I just need a 90% solution like the rest of my little Perl SQL parser. So I wrote my own SQL WHERE parser in about 100 lines. I’ll just reproduce the code comments here which explain, in general, how it works:


# This is not your traditional parser, but it works for simple to rather
# complex cases, with a few noted and intentional limitations.  First,
# the limitations:
#
#   * probably doesn't handle every possible operator (see $op)
#   * doesn't care about grouping with parentheses
#   * not "fully" tested because the possibilities are infinite
#
# It works in four steps; let's take this WHERE clause as an example:
#
#   i="x and y" or j in ("and", "or") and x is not null or a between 1 and 10 and sz="this 'and' foo"
#
# The first step splits the string on and|or, the only two keywords I'm
# aware of that join the separate predicates.  This step doesn't care if
# and|or is really between two predicates or in a string or something else.
# The second step is done while the first step is being done: check predicate
# "fragments" (from step 1) for operators; save which ones have and don't
# have at least one operator.  So the result of step 1 and 2 is:
#
#   PREDICATE FRAGMENT                OPERATOR
#   ================================  ========
#   i="x                              Y
#   and y"                            N
#   or j in ("                        Y
#   and", "                           N
#   or")                              N
#   and x is not null                 Y
#   or a between 1                    Y
#   and 10                            N
#   and sz="this '                    Y
#   and' foo"                         N
#
# The third step runs through the list of pred frags backwards and joins
# the current frag to the preceding frag if it does not have an operator.
# The result is:
#
#   PREDICATE FRAGMENT                OPERATOR
#   ================================  ========
#   i="x and y"                       Y
#                                     N
#   or j in ("and", "or")             Y
#                                     N
#                                     N
#   and x is not null                 Y
#   or a between 1 and 10             Y
#                                     N
#   and sz="this 'and' foo"           Y
#                                     N
#
# The fourth step is similar but not shown: pred frags with unbalanced ' or "
# are joined to the preceding pred frag.  This fixes cases where a pred frag
# has multiple and|or in a string value; e.g. "foo and bar or dog".
#
# After the pred frags are complete, the parts of these predicates are parsed
# and returned in an arrayref of hashrefs like:
#
#   {
#     predicate => 'and',
#     column    => 'id',
#     operator  => '>=',
#     value     => '42',
#   }
#
# Invalid predicates, or valid ones that we can't parse,  will cause
# the sub to die.

The full code is SQLParser.pm which is part of Maatkit.

I’m not sure if I’m using the term “predicate” correctly so don’t quote me, but that’s a trivial concern next to whether the code works or not (it does; it’s tested).

Real world vs. cyber world

Posted on July 23rd, 2010 by Daniel Nichter

“Cyberscape” is not a term generally used any longer. In fact, it seems to me that no one really speaks of a division between the real world and the cyberworld any longer. Rather, people speak of how close and integrated they are and of technologies and ways to bring them even closer. I think a whole other domain of existence is quietly but rapidly merging with our “natural” existence and unless we are careful the result will not be favorable to humans.

Me and my best friend, both old-school computer geeks (about 20 years of experience; not as old as some but old enough to have began on dial-up bbs rather than the Internet we know today), were at a local chophouse-brewery and we noticed a couple sitting across from one another but also infinitely far apart. Each of them was gazing at a smart phone, jacked in to the cyberworld whilst sitting in a real-world brewery. Then it struck me: all our electronic, connected devices (netbooks, iPads, smart phones, etc.) are windows through which we gaze longingly into the cyberworld.
Salvador Dali - Person at the Window
The Facebook phenomenon perplexes me and my friend. Neither of us have Facebook accounts nor want them. Yet both of us are on Facebook, against our will or wish. What is so alluring to hundreds of millions of people about social networking? I ask my friends and the most common, nearly universal answer is: “It’s a way to keep in touch with people.” That’s a nice sentiment but I argue that “keeping in touch” requires the ability to “touch” the person or something from them that may at least bear lingering signatures of them (i.e. their handwriting). Online social networking–or online anything–gives the impression of individuality, of discrete human beings behind the messages, but the fact is that nothing about the cyberworld uniquely or necessarily links to the real world. Therefore, you@Facebook is not really you; it could just as easily be me: simply give me your username and password. After a few minutes of studying your lexicon and idiomatic tendencies, I can begin masquerading as you in the cyberworld because fonts on screens appear the same when typed by me or anyone else. That is to say: there are no signatures of the human behind the messages. (Unless you’re using PGP or something, but that’s rare to never.) And the argument that handwriting and other real-world traits can be duplicated in a similar manner does not hold water because, sure, you may be able to duplicate my handwriting but you can never duplicate me (unless you have a full Hollywood staff of makeup artists and specialists and just so happen to be over six feet tall).

And so what? So what if the cyberworld connects but loosely and vaguely to the real world? So what if “keeping in touch” via Facebook is categorically different than keeping in touch by meeting a friend at a brewpub or writing a friend a hand-written letter? And so what if we gaze through windows at the cyberworld we’ve created and live semi-alternates lives there where whether I’m happy or not, single or not, “here” or not depends on my “status”? Aren’t two lives better than one? Isn’t it awesome that I can chat and message my friends all over the world, know what my ex is up to, and feel part of something greater when I join the Tupperware party? Perhaps there’s nothing wrong with all this… for the moment.

What I “fear” are the affects of the cyberworld on human aspects of living, like time. The real world has an “arrow” of time, or at least that’s our perception. During the summer, the sun takes about 15 hours to rise and set. A letter takes half an hour to an hour to write, then more time to fold, address, stamp and take to the post office, then days to arrive at its destination. A conversation between me and my friend over beers takes hours. Meeting someone and becoming their friend–a real friend–takes months. But these activities in the cyberworld either don’t happen (sunrise/set) or can happen in seconds or minutes. I think this has adverse affects both psychological and sociological.

Psychologically, we simply cannot handle or make useful use of the information torrent that we incite or invite. I can receive a hundred emails or messages at once, but how or why would a normal person ever receive a hundred letters at once? If one morning you found a hundred letters stuffed in your mailbox you would probably be very surprised and surely overwhelmed if you had to respond to them all in a few days. But most of us regularly receive hundreds (if not thousands) of emails and texts each week and this does not strike anyone as strange, probably because we can and do respond to them all. What is strange, to me at least, is that mass electronic communication does not seem to cause the kind of anxiety that an equal or even fractional amount of physical communication would cause. I emphasize “seem” because I think that the anxiety is actually there but we’re too busy to notice it because the e-flood never ceases and only grows larger as we open more windows to the cyberworld.

“How do the drops of water know themselves to be an ocean?”

Sociologically, I fear that all this “keeping in touch” is actually diminishing real human contact. Why visit people when we already know what they’ve been doing, their relationship status, etc.? For example, I haven’t seen my other best friend in weeks because she’s been swamped with school and work, but we exchanged a few quick texts and scheduled a dinner and drink date tonight. We will meet face-to-face and I’ll catch her up on the mass of changes in my life recently. If I was on Facebook she would probably already know about these changes and our meeting would be a mere recapitulation. But since I’m not on Facebook, she’s very excited to hear about why me and my girlfriend are moving in together. And there it is: “excited to hear”. What the cyberworld and its always-on, tip-of-the-fingers cyber-universe of knowledge denies us is wonder, suspense and excitement. These humans aspects and feelings do not translate between the worlds; they’re uniquely ours, real. Thus my argument is that the cyberworld dilutes the real world, denies us our yeast, so to speak, that gives rise to that unique pleasure of “catching up” with friends, sharing news, learning with shock and awe that after dating for only a month me and my girlfriend have begun to live together and we enjoy it very much.

Do I have a point is all this? Yes; it’s this: less cyber, more real. No matter how sick the latest iPhone may be, no matter how fantastic its apps, how fast or sexy the netbook, how pervasive the 3G coverage, how many people we can stay in “touch” with, we are real people in a real world and lest you become a Borg, this will never change. Instead of up-playing the cyberworld and the gadgets we fabricate to peer into it, we should focus only on how such contrivances enhance our real-world lives. We should think about and look closely at how the cyber affects the real and ask ourselves: is the real benefiting? If not, then the cyber should be turned off, abandoned.

I’m not anti-technology; I’m pro-reality. Technology can help us “stay in touch”, but we must guard against mistaking the electronic sense of “touch” for the real sense of touch. Having more friends online than we ever actually see should be a red flag, not a badge of honor. Feeling that we never need to pen a letter is a loss. If you’ve not tried it recently, I encourage you to. You will find that the mind works very differently at the pace of pen and paper than it does at the pace of T9.

In the final analysis we should all ask ourselves: if we can have and exist in only one of the two worlds, the real or the cyber, which would we choose? I would choose the real for its sunrises and sunsets, its gourmet coffee, its summer rain, its caress of a loved one.

Copyright © 2009 codenode. Theme by THAT Agency powered by WordPress.