Blake O'Hare .com

Tag: Programming

PyGame Tips & Tricks
Posted 4.9 years ago.
PyWeek 15 starts in one week. So here's a few tips and tricks for a more lovely pygame coding experi...
JavaScript Tutorial, Part 5 - Interacting with HTML
Posted 5.6 years ago.
What good is JavaScript if you can't interact with the HTML page? Modify your index.html to look li...
JavaScript Tutorial, Part 4 - Strings
Posted 5.6 years ago.
So far in all the examples, everything has dealt with numbers and math. One of the other primary dat...
JavaScript Tutorial, Part 3 - Using the Magical Debugger
Posted 5.7 years ago.
If something breaks and you don't immediately know what's wrong with your code, then you have to use...
Beginner's JavaScript Tutorial, Part 2 - Math, Functions, and Variables
Posted 5.7 years ago.
Getting Set UpCreate a new folder somewhere. Create a file called index.html and a file called code....
Beginner's JavaScript Tutorial, Part 1 - Intro
Posted 5.7 years ago.
Welcome to the horrible world of JavaScript. The rumors. They are true. But with a solid understand...
Modifying a WAVE File using Python
Posted 5.7 years ago.
You may find the Python snippet at the end of this post useful for simple sound editing and effects....
How to convert a UI Control in WPF/Silverlight/WinForms into a Bitmap
Posted 5.7 years ago.
Sometimes you just need to convert a FrameworkElement/Control into a bitmap even though the control ...
How to Parse Mathematical Expressions
Posted 5.7 years ago.
Update: This script is now hosted on GitHub and maintained by Louis Fisch and includes new features....
How to Programmatically Draw a Polygon
Posted 5.7 years ago.
For some reason you find yourself needing to draw a polygon on a pixel surface given a set of points...
Differences Between Various SQL Joins
Posted 5.7 years ago.
In a simple SELECT query, you gather information from one table. However, this is rarely enough info...
PyGame Tutorial Part 6 - More on Input
Posted 5.7 years ago.
There are two basic ways to get the state of any input device. Those are checking the event queue or...
Python Script to Detect a Repeating Decimal
Posted 5.7 years ago.
Remember doing long division as a 2nd grader? And if you found that the decimal started to repeat, y...
PyGame Tutorial Part 5 - Fonts and Text
Posted 5.7 years ago.
If you're looking for the quick answer on how to render text, here it is: But of course, there'...
Creating an Auto-updating Application in .NET/C#
Posted 5.7 years ago.
Many applications nowadays automatically update themselves to the latest version when you launch the...
PyGame Tutorial Part 4 - Geometric Drawing
Posted 5.8 years ago.
Just like the mixer module, the drawing API is fairly straightforward with a few examples. Therefore...
PyGame Tutorial Part 3 - Music and Sound Effects
Posted 5.8 years ago.
The sound and music API's are fairly simple. I feel funny basically going through the documentation ...
PyGame Tutorial Part 1 - Getting Started
Posted 5.8 years ago.
So you want to make a game? You have choices. But basically, your choices are determined by three co...
Gamelight Tutorial: Part 5 - Sprite Sheet Magic
Posted 5.8 years ago.
One of the more tedious parts of making 2D sprite-based games is dealing with sprite cropping and al...
Gamelight Tutorial: Part 4 - Sound and Music
Posted 5.8 years ago.
The next major component of games after interactivity and graphics is sound. Luckily, sounds and mus...
Gamelight Tutorial: Part 3 - Images
Posted 5.8 years ago.
This tutorial continues on with the codebase of the previous tutorials. Images are relatively simp...
Gamelight Tutorial: Part 2 - Getting User Input
Posted 5.8 years ago.
In the last installment, I showed you how to set up a Silverlight project with a basic Gamelight gam...
Gamelight Tutorial: Part 1 - The Basic Game Loop
Posted 5.8 years ago.
Gamelight is a free game programming library for Silverlight I created some time back. Recently in S...
PHP Tutorial Part 8 - GET and POST
Posted 5.9 years ago.
Getting information from the user via a form is usually at the core of any PHP based website. I also...
PHP Tutorial Part 7 - Interacting with a Database
Posted 5.9 years ago.
There are very few websites left that don't utilize a database of some sort anymore. Luckily, PHP is...
PHP Tutorial Part 6 - Using Multiple PHP Files
Posted 5.9 years ago.
It's hard to tell from these simple examples I've been giving throughout this tutorial series, but a...
PHP Tutorial Part 5 - Arrays
Posted 5.9 years ago.
So far we've talked about storing numbers and strings into variables. There's another data type that...
PHP Tutorial Part 4 - Quick String Overview
Posted 5.9 years ago.
"String" is just a fancy name for text. HTML code is just one big string. So this topic is kinda imp...
How to Blit Images With Transparency at Lower Opacity in PyGame
Posted 5.9 years ago.
PyWeek started today. So I'll take a little detour from the regularly scheduled PHP tutorial and giv...
PHP Tutorial Part 3 - Manipulating Variables and Program Flow
Posted 5.9 years ago.
Variables aren't only defined by passing parameters to the URL. You can define them within your code...
PHP Tutorial Part 2 - Input & Output
Posted 5.9 years ago.
What's the point of a program if you can't have input or output? In the case of PHP, the output of t...
PHP Tutorial Part 1 - Overview
Posted 5.9 years ago.
Welcome to the world of PHP. This tutorial is written for users new to programming in general. Altho...
Getting the Position of the Mouse in JavaScript
Posted 5.9 years ago.
Nothing makes me pull my hair out more than the browser-specific nuances of JavaScript. Even more an...
What is .NET? Microsoft Buzzwords Demystified.
Posted 5.9 years ago.
There are many things Microsoft has released that are very clear by their name. Internet Explorer. P...
IronPython Shell In Your Browser
Posted 6 years ago.
This is not a complete implementation. I created it for debugging purposes in another Silverlight/Ir...
IronPython in Silverlight 2.0 and Higher
Posted 6 years ago.
IronPython was introduced to Silverlight back in the Silverlight 1.0 days. For the first time, peopl...
Blake's C# Style Guidelines
Posted 6 years ago.
Since I will be leaving the world of C# fairly soon, I figured I'd store my knowledge in a time-caps...
Editing Images in WPF / C# / .NET
Posted 6.5 years ago.
For some reason it's so hard to find a simple, to-the-point reference on how to edit regular 32-bit ...
4 Minute Python Crash Course
Posted 6.5 years ago.
This is a crash course on steroids. It assumes you already know another language...or two...and buil...
Accepting Command Line Arguments in Python Scripts
Posted 6.5 years ago.
Since it's not quite as obvious as it is in other languages like Java and C# where the main function...
10 PHP Tips and Tricks
Posted 6.5 years ago.
Here are a few things worth mentioning that I've figured out during my years of writing PHP-based we...
.exe Compilers for Traditionally Non-Compiled Languages
Posted 6.5 years ago.
Ever want to make your own .exe program but don't have the right tools or know-how? Wait no longer!...
EOF exceptions with raw_input and stdin in Python
Posted 6.5 years ago.
If you've tried to take in input by piping a file into a python script and reading it via raw_input,...
Validation vs. PHPSESSID
Posted 6.5 years ago.
So you want to write a validating page in PHP with sessions? Good for you. But there's one problem. ...
Creating and Editing Images in PHP
Posted 6.5 years ago.
Sometimes using image files for images on your website doesn't always cut it. If you want to create ...
.NET/Java-Style Collections for JavaScript
Posted 6.5 years ago.
Let's face it, arrays in JavaScript are just willy nilly and I feel a cold chill each time I'm force...
Learn SQL in Under 4 Minutes
Posted 6.5 years ago.
This tutorial assumes you have a database set up and ready to go, and you know how to write queries ...
Switch Statements and Ternary Expressions in Python
Posted 6.5 years ago.
Switch Statementselif's got you down? It's ok, I feel your pain. Python has extremely flexible synta...
Configuring the Joystick in PyGame
Posted 6.5 years ago.
One annoying thing about PyGame is the joystick API doesn't really give you much high level flexibil...
Saving an Image in Silverlight to File
Posted 6.5 years ago.
I created a nifty drawing program in Silverlight. Unfortunately there doesn't seem to be any native ...
Background Worker in C#
Posted 6.5 years ago.
There are lots of factors you have to consider when creating a multi-threaded program in .NET. Going...
Python Imaging Library (PIL) Pixel Editing Crash Course
Posted 6.5 years ago.
I always seem to have trouble finding a reference that just cuts to the chase and tells me how to re...
How to Make a Screensaver for Windows
Posted 6.5 years ago.
So anyone's who's poked around their C:\Windows folder has probably seen those .scr files. So what i...
A Fully Function PHP Forum in 964 Bytes of Code
Posted 6.5 years ago.
Someone in the IRC room spoke of a forum that was once written in under 2 KB of code. A simple minim...
Writing Long Python Scripts in One Line
Posted 6.5 years ago.
Before you comment on this article: I know this article has absolutely no practical application. It...