What i'm working on…
Currently I’m working on a multiplayer connect 4 game using C# and Lidgren. It uses the System.Drawing library for the graphics because I wasn’t allowed to use a graphics library such as SFML or XNA.
The code is a little messy but that’s partly due to the fact that this was more of an experiment to see if I could do it.
The system I used for transmitting data across the clients is simple however I don’t think it’s the most efficient/fastest way of doing it.
I got the coordinates of where the players click and converted them into a string which has the format “x:y” and then sent them as a string through Lidgren.
When the other client receives your coordinates it’s plotted on the board and sent through checks such as winning/losing.
This was an OK way of doing things but it got kind of confusing at points and next time I create a multiplayer program I know how to design and program it better!
Open Broadcaster Software
Shameless plug for an awesome open source live streaming/recording software.
CampFire Spotify App
Introducing a whole new Spotify experience with the CampFire app, letting you listen to songs with your friends.
With CampFire a room can be created and then shared to anyone, once they have joined the room, songs can be played by typing a song URI/URL into the chat. The song will be played to everyone inside the room at the same time.
Some uses i’ve already had for this have been able to set up some speakers and then remotely control what’s playing by logging into the app.
This app is still in early development and is not official, hopefully if I can generate enough interest in CampFire before we submit it to Spotify for review it might help us getting accepted.
Originally this started as a small C# .exe which did exactly the same thing however it required the .exe to be running in the background. After much debate I decided the best solution of cutting the C# .exe out is to make it a fully fledged Spotify App.
What actually is programming?
Programming isn’t just syntax and compilers, it’s a whole logical thought process that shares the same process of building a home. You must have a great foundation of what computing is, how pieces work and how to really think abstractly.
Programming is great because there is never the “best” solution to a problem, Yeah you can get that algorithm down to O(1) but you always strive to do it better, faster, larger scale then before even if before was the best.
Programming teaches you how to think differently. It teaches you to think abstractly and more of the how does this work, and the big why does it work this way. Your total thought process becomes a puzzle that you are constantly trying to solve.
Programming also teaches you patience, Programming is one of the most stressful and aggravating things you can ever do. Some people try it once and think what the fuck! I can’t do this! then give up. Others will excel at the theories behind computer science but during implementation time, they become overwhelmed and let their code “run-away” from them. (Run-away means you lose the complete picture of what you are trying to create and solve)
Example: yeah you need to create that round-robin scheduling algorithm? Okay what is that? You look it up and say okay cool easy to do, a less experienced programmer will Google what it is, then try to implement it, normally they will not end up getting the problem the 1st compile, that’s okay! we are suppose to do incremental testing anyway! They try to see what the error or unexpected output is. Yeah, you can figure out where you’re missing that } or ;, but what happens when your program gives you 5 instead of the 3 you were looking for?
Most unskilled programmers become frustrated, start doubting yourself then you just become flushed and become scouring google for more examples until you just try to copy and paste code into your program. This is your code getting away from you, you now have no clue what is what, where is this method? This is where most programmers give up, they can’t figure it out.
A skilled and experienced programmer knows how to let there mind run free, they don’t let problems and code run-away from them. They understand the complete picture and knows the what and how of a FIFO Queue, Stack, Binary Tree, Linked List. How arrays work, what datatypes are best, what looping structures are better.
This is something that comes with experience, not one day of googling and understanding that.
Everyone can become a “programmer”. Syntax and algorithms will come with time, but patience and your thirst for success must be something you stride for.
Choices on future payment methods.
While doing my daily stumbling around the internet I often come across many different way on receiving/creating payments. Normally for anything to do with money and the web i instantly default to PayPal, it’s easy and everyone has it. But recently there have been a lot of talk about bitcoins and they have seriously become a much more powerful force in the world of web payments and I think that in years to come it will only get bigger.
Even though i’m still a novice i’ve already decided that if i ever want to sell a product, for example a game, i will almost certainly provide a option to purchase it with bitcoins too. I feel that it would be my little way to contribute to the whole system and that’s… pretty… cool! Mt.Gox provide a beautiful and simple way to charge people so that helps too.
Quick C# factorial code.
Here’s a simple function which returns the factorial for the number:
static int Factorial(int n)
for (int i = n-1; i >= 1; i–) // we start at n-1 because we don’t want to do n*n at the start.
n *= i;
** This is for reference **
How to begin hacking with the Kinect.
This will only work for OS X, if i get any response i’ll create one for windows or linux.
This is a full guide for how to program the Kinect using Processing.
- Go to the SimpleOpenNI Google Code site (http://code.google.com/p/ simple-openni/wiki/Installation).
- Find the Mac OS X installation section. Click to download the installer.
- Double-click on the .zip file you just downloaded to unarchive it. A direc-tory named OpenNI_NITE_Installer-OSX will appear.
- Launch the Terminal from the Finder by going to Applications→Utilities→Terminal.
- Change directory to the downloaded folder. To do this, type cd (for change directory) followed by a space, and then drag the folder you just unzipped from the Finder into Terminal. This will paste the correct path to that folder into your prompt. Hit return.
- Run the installer with the command: sudo ./install.sh. Type your pass- word when asked. (You must be logged in as a user with administrative privileges to do this.)
Installing the Processing Library
Once you’ve gotten OpenNI installed (including the NITE middleware and the SensorKinect driver), it’s time to install the Processing library. Thankfully, this is dramatically easier than installing OpenNI and pretty much the same for all platforms. Here are the steps:
- Visit the downloads page (http://code.google.com/p/simple-openni/ downloads/list) on the SimpleOpenNI Google Code site.
- Select the version of SimpleOpenNI that is appropriate for your operating system and download it.
- Unzip the downloaded file (this may happen automatically depending on your browser configuration).
- Locate your Processing libraries folder. If you don’t already know where that is, you can find out by looking at the Processing Preferences window. The Processing Preferences window allows you to select your “Sketchbook location.” In my case, that location was /Users/ greg/Documents/Processing. Yours may differ based on your operating sys- tem and where you installed Processing. Your libraries folder will be lo- cated inside of this sketchbook folder. For me, it is /Users/greg/Documents/ Processing/libraries. If the libraries folder does not exist, create it.
- Drag the unzipped SimpleOpenNI directory to your Processing libraries folder.
- Quit and restart Processing.
- SimpleOpenNI should now show up in Processing’s list of installed libraries. You can confirm this by looking for it under the Sketch→Import Library menu.
Hello and welcome to my blog, i’ll be posting anything and everything here and i hope you’ll enjoy some if not all of it!
Feel free to drop a comment or an email at email@example.com.
See you soon!