Subscribe to Martyr2's Programming Underground        RSS Feed
* * * * -

The Comma Operator in C++

Icon Leave Comment
When we think of the comma character we often think of it as a separator. It separates values in an CSV file, it separates items in lists, it may separate index values in multidimensional arrays (in other languages) and more. But in C++ an obscure way of using them was as an operator. The reason it never made it big as an operator and into the...
- - - - -

Applying Enchantments for PHP RPG Games - One Approach

Icon Leave Comment
So you want to build a PHP game and are just now learning how to do it. You fired up your browser and began searching for various game articles and perhaps you have found very little. What you did find might not explain a flexible way to apply magical spells to units you create. After all, what is an RPG game without enchantments you can cast on...
- - - - -

Reflective N-bit Binary Gray Code Using Ruby

Icon Leave Comment
So what is behind the theory of binary gray code? It was named after Frank Gray and is a numerical system where each successive value differs from the one before it by one bit value. It is like counting in binary, but in binary counting a step may require changing two bits. For instance going from 1 (01) to 2 (10) would involve changing the most...
- - - - -

Slot Machine Example in C++

Icon 3 Comments
I was bored and that can be a dangerous thing. Like doodling on the phone book while you are talking on the phone, I doodle code while answering questions on DIC. Yeah, it means I have no life and yes it means I was born a coder. During this little doodle I decided to make a slot machine. But not your standard slot machine per say, but one...
* * * * *

Bit.ly Class for shortening URLs in VB.NET and C#

Icon 2 Comments
So I was tinkering around with some code and thought "Hey, wouldn't it be great to create a class that could be used to tie into bit.ly's API for shortening URLs?" After having this thought I also thought "I am hungry" so went to get some lunch. Then when I came back, I got to work putting together a quick class that a...
- - - - -

Interfaces and Drawing in Java, Hurray!

Icon 3 Comments
So I am cruising around the boards when I stumble across an interesting post about creating a shapes tool for a graphics Java program. If you are unfamiliar with the shapes tool, the idea is that you click a button, select a shape and then draw the shape onto some window of the program. Select a square, an ellipse or some fancy star and...
- - - - -

Picking Colors Out of a Picture with VC++.NET

Icon Leave Comment
Ever wonder how they make those nifty color pickers on graphics programs like Adobe Photoshop? Typically they have a formula that generates the colors of the spectrum and makes it into one of those colorful swatches. You may have the swatch but perhaps you want to know how you can go about giving your users the ability to mouse over the swatch and...
- - - - -

Page Scraping Links with Ruby

Icon Leave Comment
Tinkering around with Ruby I figured I would write up a project that involved a little of everything a common Ruby program might have. A little sockets, a little class creation, array handling etc. The only thing I didn't include was a module but you could easily build one in if you like. The result was a nice little project which scrapes...
- - - - -

Enumerating Through Dream.In.Code in C#

Icon 12 Comments
The year is 2056 and governments have fallen. Anarchy reigns across the land and humanity has plunged into eternal darkness. People have turned on one another to survive and the streets are owned by the ruthless warlords with their armies of n00bs. No one is safe from the plaguing questions of "How do I read a textfile in VB.NET?",...
- - - - -

Finding a Loan Balance in PHP

Icon Leave Comment
"Yes sir, I will take that 10,000 dollar loan. If I pay 100 dollars a month that will be $1200 dollars right there after my first year." Not so fast the bank teller tells you. You still owe us $9383 and some change, not $8800. You have to remember interest and at your monthly compoundings, it adds up! Damn that...

  • (2 Pages)
  • +
  • 1
  • 2

April 2014

S M T W T F S
  12345
6789101112
13141516171819
20 212223242526
27282930