Posts tagged "python"

Caesar's Cipher in Python (AVW ZLJYLA!)

Aol Ffily-Vtlsslaal Growing up I was always fascinated by hidden messages, secret codes, ancient languages, and all manner of disguised communication. As I started learning math and computer science, that interest strangely faded. This was likely because modern cryptography seemed so complicated I didn't think I'd be able to make...

Haunted Home Automation

Halloween is one of my favourite holidays of the year. One reason for this is that it's totally optional and low stress. People can get exactly as in to it as they want. I'm also really intrigued by the perseverance of belief that there are supernatural forces at work. No...

Automated Plant Watering with a Raspberry Pi

This post starts with two facts: 1\. I have a penchant for killing plants. 2\. People in Holland grow things really well indoors. After reading about how well things can grow indoors, I started thinking that maybe automation was my path to healthy plants. So I decided to build the...

Am I Hearing this Right?

The Lyrics Repetition Analyzer I have just returned from a two week vacation, which contained a sizeable amount of road tripping. And with every great road trip comes great tunes! One of the albums I was excited to be listening to was The Arcade Fire's newest release, called Everything Now....

Detecting Reddit Vote Manipulation

I'll start this post with a disclaimer. This project has not produced conclusive results. But I'm optimistic! In fact, I've got a couple hurdles that maybe some of the people reading this can help with (which is what I'm hoping for). So let me describe what I have been working...

N-Body Orbit Simulation with Runge-Kutta

In a previous post I introduced a simple orbital simulation program written in python. In that post we simulated orbits by simply taking the location, and velocities of a set of masses, and computed the force on each body. Then we calculated where all the bodies would end up under...

Markov Chains: The Imitation Game

In this post we're going to build a Markov Chain to generate some realistic sounding sentences impersonating a source text. This is one of my favourite computer science examples because the concept is so absurdly simple and and the payoff is large. This will be done using python, and your...

Intro to Python: Hello World! (Part 1 /2)

Many of the projects on this site use a programming language called python. Python is a great language for beginners, because it is designed to be very readable, but it's also very powerful. It is powerful because there are a lot of powerful libraries and APIs that are easy to...

Intro to Python: Containers, Functions, and Loops (Part 2 /2)

This is the second post in a series. If you're just getting started, see Part 1. In the previous post, you got python installed, and ran a simple program. In this section we will use some language features to store data, and re-use code. These are important concepts for all...

Python N-body Orbit Simulation

Do you ever find yourself thinking "I wish I could do more recreational physics"? If so, today is your lucky day! We're going simulate our very own solar system. At the end of this tutorial, you should be able to define a hypothetical gravitational system, and graph the paths of...

Reddit Data Mining with Python: Are Canadians Really Sorry?

Internationally, Canadians have a reputation for being a sorry lot. In fact, we've even passed a law called "The Apology Act" stating that saying "sorry" does not count as an admission of guilt. A very sensible law indeed. Is this stereotype true? We're going to test it in this tutorial,...

Simple Python Twitter Bot

Twitter Bots Twitter has some amazing bot personalities; from celebrity impersonators, to genuinely useful automated announcements. It is also probably the first place anyone was exposed to bots and interacted with them. Some of my favourites are BIGBEN and CaptainMarkov. It is also very easy to make a simple bot,...

Vice City: Python Automated Sports Betting

Automated Sports Betting Everyone knows gambling is a great way to make money (/s). I myself formed this conclusion after hearing bookies will sometimes pay out before an event even happens, which planted a betting strategy in my mind that required a bot. This very successfully and slowly lost me...