Pages

Saturday, February 27, 2010

The Ultimate Computer Utility

Learning to program even a little is the ultimate computer utility.  I've been reminded of that many times recently. Just a few days ago a it occurred to me the right way to finally right the clipboard enhancing tool I've been dreaming of for years.  I'm calling it "DeepClip" I plan over the weekend to post it here with complete source code and hopefully a full line by line walk through of how it works.

Some friends of mine at work have been asking for me to come up with some more AutoIt tutorials. I think "DeepClip" will end up being the first of them.

But for now I thought I would post a super simple little 10 line snippet that was for a game I was playing last week where clicking quickly was needed.

The statement numbers aren't part of the code
1. Sleep(2000) 
2. HotKeySet("{esc}", "_exit")

3. While 1
        MouseClick("Left")
    WEnd

4. Func _exit()
         Exit
    EndFunc

1. First I needed a way to run this script then get to the window with the game in it before it started clicking madly.

2. HotKeySet() is a built in function in AutoIt function that registers a hotkey with windows and binds that to a function. The list of hotkeys is in the AutoIt help file.

3. A basic loop type called while, when a while loop starts it checks the argument to the right of the "while". As long as that statment returns "True" meaning a non-zero number it continues. While 1 is a way to loop forever. While looping forever we want to click the left mouse button. Then WEnd ends the while statement.

4. Here we setup the exit function we bound to the escape key since we wont be able to click our way out of this script we need a way to get out easily.
    Anyhow there you go this is the sort of thing AutoIt does in just a few lines very well that other languages would have to mill around a bit longer to accomplish.

    You can download AutoIt from their download page located here. Its a great starter language and (despite what others may say) a great language for medium to large windows utilities.

    Friday, February 19, 2010

    Always Ask Stupid Questions

    What do you mean always ask?

    The basic gist of this rule to live by is if you don't understand what someone is saying, ask.  Most people will allow other people to use words or phrases they don't understand without ever asking.

    By forcing yourself to always ask the stupid questions you will be surprised at how much you will learn.

    How do you apply this to your life?

    Living a self taught life is not just about reading books and leaning obscure factoids.  Sometimes its about just asking the simple questions.

    I work for a large company in a technical job.  That means we have acronyms for everything, whenever a new system is made our naming practice is basically to come up with a sentence that describes it, then make that into an acronym.

    Sometimes its about being honest...

    It is intellectually dishonest to not challenge something someone tells you if you do not understand it.

    When someone says something complicated or uses words you don't know if you don't ask it is assumed you understood them.  As a long time tech guy I have experienced this far too often, a co-worker will tell me "First shift checked this and that but we need to make sure the connections coming from the ABC cabinet have continuity.".  I then ask "Where is the ABC cabinet?" and they don't know.

    But what if I look stupid!

    This is going to happen; you will sometimes look stupid for asking what something means.  A hazard of being self taught is asking allot of questions.  My practice of always asking is so well known people expect it.  When someone is explaining a new process or system and they says something that no one understands my peers often look to me to be the one to ask.  This has helped to foster an environment of more open communication and honesty.

    You will end up getting more respect from your co-workers when they understand this is how you operate.  When someone tells me to do something at work and I agree to do it, they know I understand how it is done.  If I don't ask any questions they know I fully understood what they meant.  This is a good feeling, the impact of this minor behavioral change can improve your entire team.

    Your not the only one who doesn't know this stuff.

    You're not the only one in the dark, I assure you.  People use words and acronyms they don't know more then you may think.  Several acronyms at my work had been used for years without anyone asking what they mean.  In a few cases no one knew what they meant; it was just something they said.  Don't let this happen to you!  Let hearing something you don't know be a chance to learn, not a reason to feel bad about not knowing it.

    Thursday, February 18, 2010

    A baseline on AutoIt

    I have been a big fan of the programming language AutoIt for several years now and wanted to set a baseline to build on explaining why I feel it is an invaluable tool for any Windows user and why I will surely be talking about it and posting code in the the future.


    AutoIt's Strong Points
    • Simple easy to use BASIC like syntax.
    • Easy to read straight forward help file.
    • Compiles to a single executable no run-time environment to install.
    • A healthy community of enthusiastic contributors.
    Reasons not to use AutoIt
    • It's not cross platform, Windows only.
    • It's not main stream so it may not look as good on a resume as another popular language.
    From time to time AutoIt solves all sorts of small problems for me I'm sure I will post some of them or some AutoIt examples in the future.

    AutoIt started life as user interface manipulation system designed for instillation automation. It quickly gained a some use from the community for other user interface manipulation tasks like game bots.

    A video of a (not necessarily well executed) minesweeper bot.




    Another fun example of AutoIt playing a game.



    AutoIt is good for much more then game bots, I use it daily at work for all sorts of tasks.

    Programming today is too easy for everyone not to do it.  

    Please leave a comment!

    Sunday, February 14, 2010

    Ben Goldacre - The Placebo Effect

    A fun little tidbit found on Pharyngula. Ben Goldacre is a British doctor and journalist, and the author of the The Guardian newspaper's weekly Bad Science column. I have to admit I had never read Bad Science before but its now part of my daily feed. In under 5 minutes he teaches us some really interesting things about drug trials and the placebo effect.

    Check it out...

    Friday, February 12, 2010

    Books: Neil Shubin's - "Your Inner Fish"

    Paleontologist, biologist and pop science writer Neil Shubin famed co-leader of the party that found Tiktaalik
     in 2004 has really written a book I wish I had read sooner "Your Inner Fish: A Journey into the 3.5-Billion-Year-History of the Human Body". Tiktaalik is an extremely interesting and important fossil because it so beautifully fists as an intermediate. Yes, its true all living things are intermediates but Tiktaalik is fun because it happens to be an intermediate between two huge groups of life those with limbs and those without. It seems obvious after reading "Your Inner Fish" that we (and all others with limbs) are descendants from Tiktaalik or a cousin of him.

    I couldn't have been happier with this book, it takes some time to get going but is full of fun and useful information about the history of life.

    Fun points in the book...
    • Among the most mind blowing points of this book in my opinion is that based on the fossil record and an understanding of biology Shubin and his team where able to narrow their search for Tiktaalik to the devonian period and hit pay dirt. We don't see any limbed animals in the pre-devonian fossil record and we see many after this is a huge over simplification of the explanation of Shubin's choice but it gets to the heart of it. It is always exciting a scientific prediction hashes out so well. They expected to find a link between fish and tetrapods here and they did.
    • Conodonts are another fun topic discussed in the book. These animals where long known only for (or as) their teeth. For a very long time we didn't know these eel like creatures existed and classified the teeth themselves as conodonts. We now classify them in the phylum Chordata.
    • Near the end of the book Shubin helps us understand several common human maladies in the context of evolutionary biology including...

      • Obesity
      • Heart disease
      • Hemorrhoids
      • Sleep apnea
      • Hiccups
      • Hernias
      • Mitochondrial diseases

      Super fun stuff!

    Check out this video a great interview with Shubin given to us by UC Berkeley several stories in this video are taken directly from the book.

    A great quote from the video that is not found in the book is at around 44:20.
     "If you look at the Nobel prize in medicine or physiology the last, what 17 years who have they gone to?  Well they have gone to people working on flies, people working on worms, people working on sea urchins, yeasts uhh, sea slugs, corn umm and all these are work on other creatures to provide in sites about human health. So I would like to think as we discover cures or treatments for things that ail us like Alzheimer's, and various types of cancers those treatments and cures will ultimately be derived from work done on flies and worms and yeast and sea urchins can you imagine a more powerful way to state our deep connection to the rest of life then that?"

    Please leave a comment!

    Schedule and Other Opening Words

    I have set a goal for myself to have something to post at least every week. So I will attempt to have something new in my adventures in learning at least every Friday. I have set the bar pretty low knowing myself to be an under achiever with a short attention span.

    Though this is a personal blog mostly intended to be a learning journal to look back on personally I would gladly accept submissions. If you want to talk about your adventures in self teaching in any arena feel free to contact me I'm sure you can figure out what an e-mail address for Jon here at SelfTaughtLife dot com might be. Some day I hope my boys will look back at this and other writings of mine to help understand who I was at a particular time in life.

    Any comment on any post would be greatly appreciated.