Hi,
I found some code earlier which creates a Matrix Code style display in the Command Prompt, pretty cool if you are into that sorta thing.
Thanks goes out to Nifke over at http://blogs.ict-blue.be/nifke/2007/11/09/teh-m7tr1x/
Anyways, i copied the code into Visual Studio creating a Console Application and it didnt work, so i tweaked it a little:
Here is the updated code:
namespace m7tr1x
{
class Program
{
static void Main(string[] args)
{
Console.Title = "tH3 M7tr1x 3ff3";
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WindowLeft = Console.WindowTop = 0;
Console.WindowHeight = Console.BufferHeight = Console.LargestWindowHeight;
Console.WindowWidth = Console.BufferWidth = Console.LargestWindowWidth;
#if readkey
Console.WriteLine("H1T 7NY K3Y T0 C0NT1NU3 =/");
Console.ReadKey();
#endif
Console.CursorVisible = false;
int width, height;
int[] y;
int[] l;
Initialize(out width, out height, out y, out l);
int ms;
while (true)
{
DateTime t1 = DateTime.Now;
MatrixStep(width, height, y, l);
ms = 10 – (int)((TimeSpan)(DateTime.Now – t1)).TotalMilliseconds;
if (ms > 0)
System.Threading.Thread.Sleep(ms);
if (Console.KeyAvailable)
if (Console.ReadKey().Key == ConsoleKey.F5)
Initialize(out width, out height, out y, out l);
}
}
static bool thistime = false;
private static void MatrixStep(int width, int height, int[] y, int[] l)
{
int x;
thistime = !thistime;
for (x = 0; x < width; ++x)
{
if (x % 11 == 10)
{
if (!thistime)
continue;
Console.ForegroundColor = ConsoleColor.White;
}
else
{
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.SetCursorPosition(x, inBoxY(y[x] – 2 – (l[x] / 40 * 2), height));
Console.Write(R);
Console.ForegroundColor = ConsoleColor.Green;
}
Console.SetCursorPosition(x, y[x]);
Console.Write(R);
y[x] = inBoxY(y[x] + 1, height);
Console.SetCursorPosition(x, inBoxY(y[x] – l[x], height));
Console.Write(‘ ‘);
}
}
private static void Initialize(out int width, out int height, out int[] y, out int[] l)
{
int h1;
int h2 = (h1 = (height = Console.WindowHeight) / 2) / 2;
width = Console.WindowWidth – 1;
y = new int[width];
l = new int[width];
int x;
Console.Clear();
for (x = 0; x < width; ++x)
{
y[x] = r.Next(height);
l[x] = r.Next(h2 * ((x % 11 != 10) ? 2 : 1), h1 * ((x % 11 != 10) ? 2 : 1));
}
}
static Random r = new Random();
static char R
{
get
{
int t = r.Next(10);
if (t <= 2)
return (char)(‘0′ + r.Next(10));
else if (t <= 4)
return (char)(‘a’ + r.Next(27));
else if (t <= 6)
return (char)(‘A’ + r.Next(27));
else
return (char)(r.Next(32, 255));
}
}
public static int inBoxY(int n, int height)
{
n = n % height;
if (n < 0)
return n + height;
else
return n;
}
}
}
Enjoy!
Screenshot

Here is a link to the app.
I found this at the top of Reddit
Yes you read it right…! 5 lines of code
I know its hard to believe but this has to be one of the simplest implementation of Captcha, mainly because i can’t find any easier ones.
So here goes, this is how it works:
At the top of the page with the form you want to Captcha protect add these 3 lines of code, this generates the Captcha and adds it all to a nice variable to print out later:
$captcha = new Captcha;
$captchaImage = $captcha->create();
Then in your form where you want the Captcha, usually at the bottom, just above the submit button add this line, enclosed in php tags of course, this adds the captcha elements to the form:
So that is the form part done, now we just need to verify what the user has put in. For this i am going to assume that you are verifying atleast one part of the users input, so we need to add this line into it:
This would probably fit into your current checking like so:
Of course we have to add these 2 lines at the top of this processing page aswell (these are not included in the ‘5′ because they have already been added.
$captcha = new Captcha;
And thats it, the class handles everything else, well you have to put the files on your web-server, create a new directory to store the images and make it writeable, but thats a one-shot 10 second job!
Now for a screenshot:

Now for demo and the code:
AutoCompleter Tutorial
As always, links to a demo and ZIP at the bottom, Enjoy!
I thought i would write this tutorial because most of the auto completer applications i have seen just dump the code into a zip and tell you how to use it rather than how and why it works, knowing about this enables you to customise it a lot more (this has been demonstrated with the other apps i have written here)!
Can you imagine working for a company that has a little more than 500 employees and has the following statistics:
- 29 have been accused of spousal abuse
- 7 have been arrested for fraud
- 19 have been accused of writing bad checks
- 117 have directly or indirectly bankrupted at least 2 businesses
- 3 have done time for assault
- 71 cannot get a credit card due to bad credit
- 14 have been arrested on drug-related charges
- 8 have been arrested for shoplifting
- 21 are currently defendants in lawsuits
- 84 have been arrested for drunk driving in the last year
Can you guess which organization this is?
Give up yet?
It’s the 535 members of the United States Congress. The same group that cranks out hundreds of new laws each year designed to keep the rest of us in line.
Ha, they must be the happiest couple in the world!
After popular demand i have added the ability to change the month names into other languages..
Here is how it is done!
Inside ‘rpc.php’ (line 45) there is an Array with month names in English…
Just change the month names to your language – keep them in the same order or it’ll make you look pretty stupid!
The download links have all been changed to the new version!
Jamie.
I finally got my first bill from AT&T in a cardboard box containing 300 pages of it. Apparently, they give you a detail transaction of every text message sent and received. Completely unnecessary.
read more | digg story
The funniest and easiest way to learn HTML
read more | digg story