Binary is the basis of all systems. The only language that computers know is binary, a two-base numerical system; consisting of only 1s and 0s. For example, here's the number 105 in binary:
1101001
Wait, what?
I'm sure you were thinking that, so let me explain.
A great way to interprete binary is using the "bowl" method. Say you have an infinite line of bowls. Starting with the first one on the left. The first bowl has a value of 1, and each bowl to the left has a value of double of the previous bowl. Next, you have some stones. You can only hold a single stone in each bowl. Your total value is added by the stones in the bowls. Here's an example:
[512] [256] [128] [64] [32] [16] [8] [4] [2] [1]
The bowls in BOLD contain stones.
You'll see that the first bowl that contains a stone is bowl "64". Your total number is 64. The next bowl to contain a stone is bowl "32". Your total is now 86. Next is bowl "8" (104), and finally bowl "1" (105).
Simple, right?
But... View In Full
After coding through this for about 4 hours, I felt like I should share this
A hits counter is a counter that will display how many times your website (or a specified page) has been viewed. To start, open up a fresh text document and place the following code in:
Page Hits PHP Script
<?php
$counter = 0;
$write = false;
$filename = "link/to/file/hits.txt";
$ip = $_SERVER['REMOTE_ADDR'];
$file = fopen($filename, 'r');
$content = file_get_contents($filename);
$file_content = explode(" ", $content);
fclose($file);
for ($i = 1; $i < count($file_content); $i++) {
if ($file_content[$i] != $ip) {
$write = true;
} else {
$write = false;
break;
}
}
$file = fopen($filename, 'w');
if ($write) {
fwrite($file, $content . " " . $ip . " -");
} else {
fwrite($file, $content);
}
fclose($file);
$file = fopen($filename, 'r');
for ($i = 1; $i < count($file_content); $i++) {
if ($file_content[$i] == '-') {
$counter++;
}
}
fclose($file... View In Full
Events are the heart of Actionscript. Without them, you are pretty much completly rendered helpless when creating, pretty much anything, in Flash. Events are basically different actions that if performed, follow through with a block of code.
For example:
function onMouseDown() {
trace("Mouse Pressed");
}
What this code does is it places the mouseDown() event into a function and traces (outputs) the text "Mouse Pressed" when the user clicks the mouse.
There are three different ways to use events... On movieclips, on buttons (now depreciated since Actionscript 3.0 and Adobe Flash CS3) and on frames.
When placing events on buttons, the syntax is quite simple:
on (event) {
//code
}
Example:
on (press) {
trace("Mouse Pressed");
}
The same method goes for the same with movieclips.
Placing events on frames is a little bit different... You can access them in a few ways:
function onMouseDown() {
//code
}
onMouseDown = funct... View In Full
An updated version of my memory heap joke. Now this will run silently run in the background and constantly update a text file with gigabytes of random data, causing most of the user's hard drive space
Pulled yet another all-nighter (HA Cinjection!) to get this done. Gathers binary numbers from user input and translates it into ASCII symbols and displays them. I worked my ass off copying and pasting
Every time I learn a new language I like to make a number guessing game to test out all I currently know. It's a good starting point for me because you have to use a lot of different techniques in ord