Shutting Down For The Holidays
December 19th, 2007This blog is going dooown for the holidays. I mean, it’ll still be here but I won’t be posting nothin’. I’ll see you all next year, sports-fans!
This blog is going dooown for the holidays. I mean, it’ll still be here but I won’t be posting nothin’. I’ll see you all next year, sports-fans!
Okay, I’m getting started on a new project, here- in between my witty (incoherent) ramblings, I’m going to try to toss in the occasional useful tutorial on a variety of topics that have already been covered over and over again on the internet.
Today? Getting started with Python. As a quick intro to what the hell I’m talking about, Python is a very popular and powerful scripting language. Thanks to the fact that Python is a slim, concise language, with a huge community supporting it and a lot of libraries, it’s a great choice for a first programming language.
So, at the beginning of a CS degree, you’re going to get bombarded with a bunch of boring hocus-pocus about algorithms and pseudocode. Now, of course, this is all important stuff… but it’s all boring, so let’s get right into the meat and bones of programming.
Which, of course, requires that you have Python installed on your computer. Let’s get you started. First of all, let’s determine what operating system you’re running. Look at your screen- is it bright blue, with various error messages? You’re using Windows. Look again- Do you suddenly feel like you’re not nearly trendy enough, and that you should probably buy a scarf and beret? You’re using a Mac. Finally, if you’re looking at your screen and you are filled with waves of disdain for the entire human race, you’re probably using some flavor of Linux.
For Mac users, well, I can’t help you. I don’t have a Mac. Should you require a more comprehensive tutorial, please pony up the $1200 required for me to get my grubby hands on a MacBook. Edit: Okay, I bought myself a MacBook. Good news, everyone- Python comes pre-installed on your Mac. To get started, open a Terminal (you’ll find it in /Applications/Utilities) and type in the word “python”.
For Ubuntu Linux users (i.e., Ubuntu users), you’re.. well, you’re all set. Python is automatically part of every Ubuntu installation. Good on you! To get started, open a Terminal and type in the word “python”.
For Other Linux Users .. well, you’re running Linux on your own. I’m going to assume that you’ve got your shit together.
For Windows users, the process is quite simple- go to python.org and grab the Python 2.5.1 Windows Installer. Don’t go to python.net, that’s not what you’re looking for. Especially don’t go to python.com- that’s just porn, the chewy caramel core of the internet. If the Windows Installer has a higher number than 2.5.1 (For example: “2.5.2″), raise your arms in the air and cheer thusly: “Woo”.
Having installed Python, you now have a “Python” group in your Start Menu, with a variety of links- IDLE (Python GUI), Module Docs, Python (Command Line), Python Manuals, and Uninstall Python. The next step is to uninstall Python. (No, it’s not, I’m full of lies.)
What you’re going to be using is IDLE- a lightwieght Integrated Development Environment. An IDE is a tool to make programming a little easier.. and Python was inspired by Monty Python.. one of whom is Eric Idle.. so.. yeah. There you go. I have yet to see anything in the Python world named after John Cleese, but only time will tell.
So, you’ve started IDLE and you’re faced with some version information, some unwanted license information, and a warning about personal firewall software, followed by some more version information and finally the handy command prompt. “>>>”, it goes. “>>>”. Just.. taunting you. Quickly, man, you need to show it who’s boss! Tell it who’s boss!
Now you’re at a Python command line.
Hm.. that didn’t work. It threw a Syntax Error.. and what is a Syntax Error, anyways? Well, it means that you did something that Python didn’t understand. So, uh, stop it, or Python will be very very angry with you. Let’s tell it to print a seven.
See, that’s some quality output. A seven! Think of all the things that you can do with that! You could .. um.. okay, it’s useless. How about we do some math.
Okay, so now your $2000 computer is roughly as useful as a $1 calculator. Clearly, we’re getting places, here. Now, traditionally the first thing anybody learns to do in any programming language is print the words “Hello World”, so let’s take a go at that.
Oh no! We’ve failed again!
There we go. You need to add quotes around the words that you want to print. Good stuff, good stuff. On top of that, you can do math with the words, too.
Of course, you can’t subtract or divide letters, because Python doesn’t want to go to all of the trouble of displaying half of an “L”. That would be a pain in the ass!
Wow, that’s a painful error message. It’s a long and roundabout way of saying that you can’t ‘-’ a ’str’ and a ’str’. – Translated into English, you can’t subtract a word from a word- at least not that way.
If you’re using IDLE in windows, you get something that the Ubuntu users don’t- you get colours. Colours are good, they make code easier to read. If the Ubuntu users in the crowd are jealous of the colourful world of IDLE, you can always pick it up in Ubuntu’s “Add/Remove Programs” area, easy as pie.
Okay, now let’s write a program.
Okay, quick, let’s write a python program and run it, in python. The process for doing this is different for Mac/Ubuntu and Windows users.
Mac/Ubuntu
print "Hello World" man, cd and ls commands are your friends. ) Windows
I’m .. er.. not at my Windows computer right now, and I can’t remember how this goes. Ner… I’ll get back to this a bit later.
Good luck for now and I’ll see you again next time for more explanatory goodness!
Comics fall into a lot of different categories- funny, funny and beautiful, funny and surreal, funny and story-based, or funny for countless other reasons.
Except Garfield, which manages to fail in every single category. Well, unless you start to mix it up randomly, then it starts to get funny again.
But that pales in comparison with the sheer hilariousness of this- Garfield with all of Garfield’s comments removed.. I laughed so hard.
I found this classy little nugget in the codebase for a tool that I’m maintaining. I laughed, and laughed, and then called my coworkers over, and they laughed, and then got permission to post it on my blog.
It even has a funny punch-line at the end!
My website is getting pounded at CommandShift3.
If you’re a redditor, you’ve probably already seen this. CommandShift3 is like a Hot Or Not for websites- you submit your website title, it takes a picture, and your website is run against others in a series of one-on-one preference tests.
I thought I’d toss in this site and chownow.ca for good measure, to see how my design skills stack up. It came in about as I’d expected- not great, but better than absolutely abysmal. I like to think that I’m improving over time- chownow.ca is more attractive than this site, and my next site (theoryBox.net when it goes up) will be even more attractive still. Or not.
Oh, as a bonus- my site looks much uglier in Safari and Internet Explorer. I can chalk that one up to laziness- whenever faced with a strange IE display bug, it was just easier to make the offending element disappear (no search for you, Internet Explorers!).
Thing is, I don’t want to take the easy way out and just toss lots of gloss, sans-serif, rounded corners, and drop shadows on my site. It’s like decorating your house with stainless steel and dark woods – it’s popular now because it’s faddish, and it looks pretty good even if you don’t know anything about design, but it just seems like a lazy solution. Great designs are the ones that do strange things but still end up being visually balanced, well-laid-out and interesting.
On a side note, CommandShift3 is clearly doing the “Agile Web Company” thing, as evidenced by the fact that the site’s either exhibited bugs or broken bits at least five times since I stumbled upon it.
Here’s something strange I found.
Here’s a video from Livevideo, and one from YouTube. You don’t actually have to watch the videos- they’re just more of the generic inane videos that you’ll find everywhere on internet.
What you’ll notice looking at the two pages is that they’re .. well, almost exactly the same. Now, I’m placing the blame squarely on Livevideo, here. The question is, why?
I mean, how did this get made? Did someone actually go to venture capitalists and angel investors pitching the genius idea, “Let’s just make YouTube”? Were they planning something better, but just failed to put it together right? Did someone actually imagine that just flat-out copying YouTube was a great idea that would make tonnes of money?
I mean, this one’s so painfully obvious, I don’t even think it’s necessary to point out Rule #6 of Ries & Trout’s “22 Laws Of Marketing”.
This is almost a Zango level of stupid.
If companies like this are getting venture capital, I’m curious how long web developers are going to be working in Aeron chairs before we’re back to flipping burgers.
Hey Curtis, I am not sure why, but I have struck an interest in what you do for schooling? I know it is all high tech computer stuff, but I am interested in what you do? Help me out here, will ya? lol Thanks pal!
I’m taking Computing Science at Simon Fraser University- it started as basic programming and then slowly became an in-depth look at how computers do the magic that they do, from the microchips to operating systems, and then a lot of more specialized topics, like compilers, graphics, sound, and tonnes of painful, painful math. Last semester, I took courses on User Interface Design (i.e. the parts of the program that you see), Networking, Data Structures & Algorithms, and next semester, I’m taking a course on Statistics, one on Technical Writing, and a third on Symbolic Computing.
Now an important part of all that is – while it helps you understand computers, the internet, how it all works and why – it doesn’t necessarily make you any better at working with those things- it’s just kind of a base to work from.
We’re expected to learn all of the *practical* stuff about computers on our own- how to program, how to develop software, how to do all of the myriad stuff that needs to get done to develop software well, how to set up websites, how to set up networks and keep our computers in pristine condition, everything. BCIT is known for teaching the practical stuff a lot more thoroughly, and sometimes I’m jealous of the BCIT students (but then again, I met Kristen at SFU, so no complaints there.)
The people who don’t amass enough practical knowledge to go into development go to grad school where they are paid peanuts to hyperspecialize in certain inconsequential computing tasks. Some people go to large companies where they are paid good money to hyperspecialize in certain less-inconsequential computing tasks – For example, I’m pretty sure there’s a person at Electronic Arts, whose entire job, day-in-and-day-out, is to find more efficient ways to render grass. Years of working as faceless, replaceable cogs in exchange for job security tend to melt souls, but on the other hand, it can pay really obscenely well.
Not only are we expected to pick up all of the practical stuff on our own, we are expected to specialize in certain skills and activities- some in C++/C#/VB/.NET/Windows programming, other people in C/C++/Python/Linux, some people become IT Guys or Quality Assurance Testers or System Administrators. Some poor bastards specialize in Java, but because it’s the language that everybody learns by default in University, Java programmers tend to be a very common, poorly-treated bunch. I got my start in Web Programming setting up my own website at curtis.lassam.net – simple, maybe, but the more I learn about web programming, the more it seems like I have a lot of learning ahead of me.
Once you know the basics, learning enough about a domain to get a job with other people in that domain takes merely weeks. Becoming good, though, learning the ins-and-outs of the industry, takes years, and thanks to the ever-marching-field of technology if you don’t stay up-to-date you become obsolete.
Some people go on to design computer-innards, but usually not us CS students- that’s more for electrical engineers and computer engineers. There’s way more math- and engineering degrees reduce people to boring, weeping lumps of humanity.
Through some combination of hookery and crookery, I’ve somehow managed to pick up (on my own time) enough salable skills in the area of web-programming to get a job in the industry, programming things. Right now I’m at Research In Motion, working on software that makes certain boring administrative tasks faster. This is another thing about programming that they don’t tell you- only the best programmers get to work on software that people actually get to use- everybody else ends up working on custom-one-company internal software.
So.. uh.. CS! Constantly changing, constantly challenging, tonnes of options. Some good, some bad.
That’s what I do. (That and write essay-length answers to short questions)