The Hawker Squawker
The art of writing is the art of discovering what you believe. -- Gustave Flaubert
Curses, dream scribe! [Permalink]
A few nights ago i put a pad of paper and a pen on the nightstand next to my bed and determined that i would write down some of my dreams so that i could recall them the next day. I can't say for sure, but it seems that they've been rather interesting lately. Maybe they'll give me good ideas for a short story. *shrug*

Well, as the night progressed, i woke up a time or two and scribbled something on the pad of paper - i remember this quite clearly. When morning came, i woke up and picked up the pad of paper - eager to see what my subconscious had dreamed up over the course of the night. What grand adventures had I undertaken?

My wife gave me a curious look as i cursed the paper held in my hands. Then she started to laugh as i showed her my nights efforts: a big fat blank piece of paper. All those scribbled notes were just imagined! Curse you dream scribe!

Posted by shawker on Tuesday, 15 July 2008
Tags:
 Comments (3)
The stinky cow [Permalink]
Ok, this is too good to pass up... I actually think there might be some merit to studying something like this. But wow, the comments had me busting up :) I'll include a few of them here for you. :)

  • Aahahahaha, I love the onion!!...oh, wait....
  • Fart collection, because your worth it
  • Next step: spontaneous cow combustion ?
  • Fatcat1: "Wanna bet £1m that I can get the hippies measuring cow farts, and then blaming the cows?"
    Fatcat2: "I'll have some of that action
  • OK someone needs tell someone else my bag's full and the presser's is building mooo-ouch
  • If we strap one of these to every cow, we could stop their greenhouse emissions and farmers would have a potentially profitable alternative to natural gas.
    Seriously.
    Stop laughing, the tanks don't have to be pink.
  • I've always thought that if Cows produce so much Methane... then why the ***** aren't we tapping that ass for energy ;)
  • And you thought YOUR job sucked.
  • pull my hoof!
  • *waiting for a hybrid cow*
  • Scientist 1: You know, there are millions and millions of cows in farms that could be producing, "gases" if you know what I mean...
    Scientist 2: Great Scott, Scientist 1, you are right! Cows fart so often that they are a crucial factor in this global warming problem!
    Scientist 1: What should we do about these silly cows and their farts?
    Scientist 2: I've got it mate! We'll strap gigantic pink containers to their backs and measure the amount of fart gas that emits from their behindus! However, if the containers aren't the right hue of pink, the results will be devastatingly off.
    Scientist 1: Right oh, mate. I'll start shoving the tubing up their behinduses so we can start extracting the cow farts!
  • What about the modest cows? Nothing screams, "I'm farting into a tank!" better than a giant pink tube on your back.
  • The expression on the cow's face is priceless. "Moo... this is udderly humiliating..."
  • It couldn't possibly be people causing climate change. Then, what could it be? The cows! It must be the cows. Quick, strap pink plastic tanks to their backs and collect fart samples...
Digg Link
Posted by shawker on Friday, 11 July 2008
Tags:
 Comments (0)
Let the games begin! [Permalink]
An article came across my reader yesterday that caught my attention. "All video games to be free". Holy crazy-talk batman. Did you just say that all video games will be free? Considering that the computer gaming industry is a multi-billion dollar a year industry, i was quite skeptical as to how this could be. So i read on...

The article starts out saying that the gaming industry loses a bazillion dollars a year due to pirating. In order to combat this, some companies (mostly in Japan right now) are giving away their games for free. Yes, that's right - you can just go to the website and download the game.

Sounds great for the consumer. And maybe the company is getting gamer good-will, but ... that's not a very good business model. So what's in it for the companies that are doing this? I'll get to that in just a minute. That's the really interesting and innovative part.

But first: the article goes on to say that because some companies are starting this, eventually it will spill over and all companies will HAVE to give their games away for free, because why would you pay $50 for a game when you can get another equally fun game for free? Good point.

Ok, so how can a game company give away games for free and hope to survive? Enter "micropayments". Even though you can play the game for free (or at least part of it), it's all the accessories and extras that you will buy to enhance your experience that will fill the game company coffers. Suppose you're playing a racing game. You want a red car with a super cool flame paint job? $1.00. How about a t-shirt for your character with your face on it? Another $1.00. Walk into the virtual game-store and buy that barbarian character of yours a wicked-cool two-handed longsword of slaying for $1.75. Brilliant! I can totally see this taking off. There's already precedent for this in second life where people sell virtual goods/services for real-world cash.

What do you think - genius or madness?

Posted by shawker on Friday, 11 July 2008
Tags:
 Comments (0)
Apollo moon rocks hold water [Permalink]
According to several blog articles that have come across my reader the last two days, water has been found inside of some of the moon rocks that were returned by the Apollo missions back in the 60's and 70's.

But wait - hasn't NASA plunged a few satellites into the moon in the recent past in order to find water at the moon's poles? Yes, but the results were inconclusive.

Why did it take so long to notice water in the moon rocks? I don't know, but it's pretty cool that people are still studying these rocks 30+ years later and still finding new things.

National Geographic Article
Space.com Article

Posted by shawker on Thursday, 10 July 2008
Tags:
 Comments (0)
Python file upload [Permalink]
Not only am I using C++ at my new job, but i'm also doing some Perl and some Python. I actually have found that I rather like Python. It's a great language for what we're using it for. As an aside that has nothing to do with this blog post, this link shows the most popular programming languages. I am using 7 of the top 20 (as of July 2008) programming languages right now. :)

Anyway, back to the point of this post: I was very surprised to learn that Python 2.5x does not have support for uploading binary files over http (i.e. it can't do file upload). What? That's crazy. I happen to need this functionality for a task i'm working on. After some searching, i was able to pull together a bunch of pieces on the net and get a custom solution working. Many sites had pieces of the puzzle, but nobody had an entire working example all put together. Anyway, here is my solution:

import os, stat, mimetypes, httplib

def post_multipart(host, selector, fields, files):
    """
Post fields and files to an http host as multipart/form-data.
@param host: the hostname of the server to connect to.  For example: www.myserver.com
@param selector: where to go on the host.  For example: cgi-bin/myscript.pl or blog/upload, etc..
@param fields: a sequence of (name, value) elements for regular form fields.  For example:
    [("vals", "16,18,19"), ("foo", "bar")]
@param files: a sequence of (name, file) elements for data to be uploaded as files.  For example:
    [ ("mugshot", open("/images/me.jpg", "rb")) ]
@return: the server's response page.
    """

    content_type, body = _encode_multipart_formdata(fields, files)
    h = httplib.HTTPConnection(host)  
    headers = {
        'User-Agent': 'python_multipart_caller',
        'Content-Type': content_type
        }
    h.request('POST', selector, body, headers)
    res = h.getresponse()
    return res.read() 


def _encode_multipart_formdata(fields, files):
    """
@return: (content_type, body) ready for httplib.HTTP instance
    """
    
    BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'
    CRLF = '\r\n'
    L = []
    for (key, value) in fields:
        L.append('--' + BOUNDARY)
        L.append('Content-Disposition: form-data; name="%s"' % key)
        L.append('')
        L.append(value)
    for (key, fd) in files:
        file_size = os.fstat(fd.fileno())[stat.ST_SIZE]
        filename = fd.name.split('/')[-1]
        contenttype = mimetypes.guess_type(filename)[0] or 'application/octet-stream'
        L.append('--%s' % BOUNDARY)
        L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename))
        L.append('Content-Type: %s' % contenttype)
        fd.seek(0)
        L.append('\r\n' + fd.read())
    L.append('--' + BOUNDARY + '--')
    L.append('')
    body = CRLF.join(L)
    content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
    return content_type, body

if __name__ == '__main__':
    post_multipart("my.server.com", "/cgi-bin/uploadphoto.pl", [("foo", "bar")], [("mugshot", open("/images/me.jpg", "rb"))])
Posted by shawker on Wednesday, 9 July 2008
Tags:
 Comments (0)
My, what a lovely sphere you have [Permalink]
What do metrologists, a lump of platinum in Paris, optical interferometers and crystallographers all have in common right now?

If you answered "How much -- exactly -- does a kilogram weigh?", you are correct!

The kilogram is the only standard weight of measurement that is only defined by one objecft: a lump of platinum in Paris. And for an unknown reason its weight is changing (relative to other copies of itself from around the world). In an effort to officially define a kilogram, a group of engineers has built the world's roundest objects and other scientists are attempting to count the number of atoms in the spheres, which will give an exact measurement of just what a kilogram means going forward.

I'm not exactly sure how they decided how big to make the spheres, but my guess is that they have the same weight as the lump of platinum in Paris, and by counting the number of atoms in the sphere, the lump in Paris will no longer be necessary in case it continues to change its weight or gets lost or stolen, etc.. Find out more here.
Posted by shawker on Tuesday, 1 July 2008
Tags:
 Comments (0)
How to survive the apocalypse [Permalink]
Just read a great article that was full of good tips on how to survive the apocalypse. Be it bombs, aliens, zombies or monsters - these tips have you covered. Original article here

Never Go Through A Tunnel

It seems like a quick and easy way out, but dark and scary passageways usually house bad things that you don't want to bother with in the middle of fleeing for your life. It's simple: tunnels=death, for at least one person in the group. This is a tried and true fact of apocalyptic movies. Take for example the idiot drivers who decided to take the tunnel in Independence Day, toasted via fire ball (except for the ones who had that dog, but more on that later). Also who could forget the night vision moments in Cloverfield walking through New York's subway system. Avoid tunnels at all costs.

Do Not Join A Theme Gang

With the world ending, there will be many sad sacks who will try and recreate a Mad Max road warrior gang. Resist the urge to join anything theme-oriented. Basic rule of thumb: if you look like an idiot with a face tattoo or a fool running around in Medieval garb, you're going to get the sharp end of the death stick. Doomsday spelled this out pretty clearly: everyone who looked ridiculous got a ridiculous ending. Motorcycle gangs count too, don't forget even Romero's Dawn of the Dead leather riders got their just rewards for their hideous outfits and bad attitudes. Stick to the rag-tag refugee look, or lone wolf army motif. If you have to join a gang, stay in the back and never do anything you might later regret — like eat people.

Do Not Go Back For Loved Ones

If the world is ending, you may feel the need to find love ones that are in Princeton, a New York Library or a high rise apartment. This is a bad idea. Let go of your emotions and assume that everyone else in the world is dead, or trying to steal your food supplies. Going after loved ones almost always means your own death or the death of someone in the group. Look at it this way, it your loved one has survived and you meet up with them, bonus for you. But most likely they died from the plague, zombies, earthquake flood or whatever.

Never Be The First

I can't believe this even has to be said but no, do not go exploring in rooms, attic, caves, hallways or apartments where you are the first one in the door. My favorite character from Resident Evil Extinction, L.J., got bit by a zombie lady because he was checking out all the rooms to make sure it was safe. Let someone else do this, get a job as a medic or cook. There is no need for you to be first to go anywhere — let someone else do the exploring. If they find something really good, you can kill them and take it anyway.

Bring Your Pet

If you don't have a pet, I suggest you go to the pet store and steal one, looter style, or take care of your dead neighbors'. You may need this pet to help you keep your sanity or sacrifice its life for you, like in I Am Legend. Either way, animals are good luck when the chips are down for humans. You never know when a pair of love birds will come in handy to calm down a flock of murderous seagulls and crows. The same rule sometimes applies to children, but you will have to feed them considerably more.

Ditch The Biggest Guy In Your Group

They will turn into a zombie or rage machine, it's proven. Kill them before they kill you, or just ditch them at the next pass.

Don't Trust People In Uniform Unless They Have Defected From The System

Never trust the government, especially when the world is ending. It's a terrible idea, they would rather nuke the whole place than deal with people. If you see the military, run the other way or hide. Do not do what they say. The friendly people of Hollywood followed the advice of the government from Right At Your Door, and what happened to them? Same with the people of Raccoon City, from Resident Evil Apocalypse. Granted an ex-military person hell-bent on sticking it to the man can be a wonderful asset during the end of the world, just be sure to know the difference between the two.

Don't Barricade Yourself In

It always seems like a good idea, but 9 times out of 10 whatever you're trying to keep out gets in and now you're trapped. Think of the mess it caused for the cute little family in the beginning of28 Weeks Later and Shaun of the Dead. I say build a sky city in the trees.
Posted by shawker on Thursday, 26 June 2008
Tags:
 Comments (1)
The flute [Permalink]
Wow, I read a really great blog entry today. You know it's going to be a good entry when it starts out mentioning star trek! :) But then to actually use that as a lead-in to a reflection of ones past, relive life-changing events, and draw strength from them is really great.

Unfortunately for most of the rest of the world this is a private blog. It's probably the most consistently well-written and profound blog that i read (and i read a lot of blogs). It's a shame that i can't get an rss feed for it, because i only sporadically check it. I really need to do better and go there more often.

I hope that one day my writing is half so good. Until then, i will continue to read, be inspired, and try to find my flute.

Posted by shawker on Wednesday, 25 June 2008
Tags:
 Comments (0)
The great gas experiment of 2008 [Permalink]
I decided to try a little experiment. I just finished it in fact. The experiement was to drive a little bit slower and see if it had a noticable impact on my gas mileage (and thus on my wallet). Almost all of my driving in my car is on the highway to and from work. I tend to drive just a wee bit fast, so there was plenty of room for me to "slow down" and still not annoy anyone on the highway. :)

I drove my car until it was on fumes. Then I fueled it up. My car has a 12 gallon tank, and i usually get 300 miles out of it (that's 25mpg). At $4.00/gallon for gas, that's $48 to fill up the tank.

Flash forward to about two weeks later. My car is on fumes again and guess what - the trip meter was showing 330 miles. Which means i got a 10% increase in gas mileage. That's 27mpg. Or another way to look at it is that at $4.00/gallon, i just saved $0.40 per gallon of gas, effectively giving me me gas at $3.60.

Let's look at it another way. I drive approxmiately 20 miles each way to work, or 40 miles round trip. Assume that i drive in to work around 200 days a year (sounds about right after you factor in weekends, holidays, working from home, etc..). That's 8000 miles. At $4.00/gallon on my old gas mileage (25mpg), that would be 320 gallons of gas, or $1,280. Assuming the new gas mileage (27mpg), that would be 296 gallons of gas, or $1,184. Giving me a total savings of: $96.00.

So the question becomes: Is it worth it for me to drive agonizingly slow every day, adding about 5 minutes to my commute each way in order to save $100/year?

Posted by shawker on Friday, 20 June 2008
Tags:
 Comments (1)
A perfect circle [Permalink]
Whoever did this crop circle is a genius. The circle is actually the first 10 digits of PI. No, seriously. See if you can figure it out, and then read the article which explains it. Very cool stuff.
Posted by shawker on Thursday, 19 June 2008
Tags:
 Comments (1)