Posts

Python Snippet - Random Numbers


Posted in:

Programming, the final frontier......ok, so maybe programming is not really the "final" frontier, but it sure is close. Final frontiers aside, a couple weeks ago we had our second installment into pygame. It was fun, and we added some cool new features. However, after looking over what I wanted to add for the third installment, I decided to go over something in python itself.

Read More Icon Read More

Pygame Primer, Mark 2 - Movement


Posted in:

A long time ago, in a tutorial far away... Ok, so maybe it hasn't been that long since our last foray into the world of programming, but it sure seems like it sometimes. On a more serious note, however, a while back we did go over some very basic things involving Python and a library known as Pygame. Today my friends, we will be continuing on this path, and adding to what we build that fateful December day.

Read More Icon Read More

Flex Datagrid Percentage Width Columns


Posted in:

I have a multitude of tutorials on the Flex Datagrid here at Switch On The Code and none of them show you how to use percentage widths in your Datagrid. Now at the surface this seems really easy, but the way they implemented it in Flex is very unintuitive. So, today I am going to show you how to quickly get percentage based columns in your datagrid.

Read More Icon Read More

C# Tutorial - Using the BackgroundWorker Class


Posted in:

It's a rule that should never be forgotten - don't ever perform work that takes a non-trivial amount of time on the UI thread. Of course you're now wondering, "Where do I perform tasks that take a non-trivial amount of time?". The answer is simple - on a different thread. There are lots of ways to get your work onto another thread, which can include directly creating a Thread or using the ThreadPool.

Read More Icon Read More

Python and Pygame - A Primer


Posted in:

So you're sitting around, playing some simple game on your computer, and you finally realize that as a developer, you can make games too. After a little research you come across this "python" thing that is fairly popular among the dev crowd, but also has a nice 2D game library. Using the Pygame library with Python you finally can realize your quick and simple games. So it's time to get started.

Read More Icon Read More

Using Shark to Performance Tune Your iPhone App


Posted in:

Here was the problem: we were working on an OpenGL iPhone game and for some reason the frame rates were unusually low - especially for what little action was happening on the screen at the time. My first plan of attack was to begin commenting out chunks of the system in an attempt to see what module was causing the problem. I removed the physics, the logic updates, and some of the things being rendered. Nothing I did, however, seemed to create a noticeable improvement in performance.

Read More Icon Read More

C++ & Lua - Function Arguments


Posted in:

As we have been realizing here at SOTC, using Lua with C++ is really the only way to make Lua work for you. Lua itself is really not that useful, but used in conjunction with other languages, it can be quite powerful. It past tutorials, we have gone over how to use Lua with C++. However, we have yet to go over how to pass arguments back and forth between the two. This is what we will cover today.

Read More Icon Read More

C++ & Lua - Functions


Posted in:

So in our last Lua tutorial, we went over a basic way to get information from lua and use it inside C++ code. This time, we are going to use the same principals to run a lua function from C++ and a C++ function from lua. This opens up endless possibilities for communication between the two. So, how about we get started then.

Read More Icon Read More

Lua & C++ - The Basics


Posted in:

With Lua, almost anything is possible. It is akin to JS, but in some ways it is so much more powerful. With World of Warcraft incorporating Lua right into its core, you have to wonder how powerful you can actually make it. One of the things that make Lua so powerful is its easy integration into C++ and C. With this integration, you can accomplish just about anything. Today, we are going to go through the steps to get some basic interaction between C++ and Lua.

Read More Icon Read More

Creating a REST Client using WCF


Posted in:

A couple of weeks ago we received an email about consuming a REST service in WCF. Well, this tutorial should answer that email. Today we're going to build a simple client for Twitter's REST API using WCF.

Since it doesn't look like WCF natively support OAuth authentication, the client we're going to write will do one simple thing - request the latest status updates for a specific user. I'm going to write a command line application that asks for a username and then prints a bunch of status updates along with information about the user. Below is some example output.

Read More Icon Read More

In The News

Tutorials Around The Web