Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Spectere

Pages: 1 ... 9 10 [11] 12 13 14
151
Random Chat / Four day at the wheel of a hydrogen powered car
« on: June 19, 2008, 02:29:14 AM »
Here's an interesting article written by someone who was given a hydrogen-powered Chevy Equinox to drive around in: http://www.reuters.com/article/newsOne/idUSB55933020080618

It's a pretty good read; I recommend it.

Edit: And here's a video of something even more badass: http://www.reuters.com/news/video?videoId=84561

IT'S A WATER-POWERED CAR.

152
Computing / Perl brainfuck Interpreter (sans input)
« on: June 16, 2008, 02:34:55 AM »
This is my first-ever Perl program.  I even forewent the "HELLO WHIRLED" nonsense and skipped right onto the good stuff.

I wrote this while my laptop was churning through Lunicks updates:

Code: [Select]
#!/usr/bin/perl

# I'm loves my switch()
use Switch;

# variabledeclarationsectionstuff
my $prog; # program storage thingie
my $ip = -1; # instruction pointer
my $ramptr = 0; # memory pointer
my $ram; # the actual memory storage
my $maxram = 9999; # 10k oughta be enough for anyone...
my $maxint = (2**8)-1; # set the highest number per memory position (normally (2^8)-2 -- 8-bit precision)
my $loopip; # where do each of the loops start
my $loopptr = -1; # how deeply nested are we?
my $nestlvl = 0; # used to traverse loops for '['
my $proglen; # holds program length

# open file
open my $bffile, $ARGV[0] or die "Could not open $ARGV[0]: $!";

# read file to memory
$prog   .= <$bffile> until eof($bffile);
$proglen = length($prog);

# initialize the memory
$ram[$ramptr] = 0 until ($ramptr++ == $max_ram);

# close file
close $prog;

# start interpremacating
while($ip++ < $proglen) {
switch(substr($prog,$ip,1)) {
case '+' { if(++$ram[$ramptr] > $maxint) { $ram[$ramptr] = 0; } }
case '-' { if(--$ram[$ramptr] < 0) { $ram[$ramptr] = $maxint; } }
case '>' { if(++$ramptr > $maxram) { $ramptr = 0; } }
case '<' { if(--$ramptr < 0) { $ramptr = $maxram; } }
case '.' { if($ram[$ramptr] == 10) { print "\n" } else { print sprintf("%c",$ram[$ramptr]); } }  #make sure this gets printed as a character
case ',' { print "Input not yet implemented!\n"; }
case '[' { unless($ram[$ramptr] == 0) { $loopip[++$loopptr] = $ip; }
           else { $nestlvl++; until($nestlvl == 0) {
           switch(substr($prog,++$ip,1)) {
           case '[' { $nestlvl++; }
           case ']' { $nestlvl--; } } } } }
case ']' { unless($ram[$ramptr] == 0) { $ip = $loopip[$loopptr]; } else { $loopptr--; } }
}
}

# be nice and print a trailing newline
print "\n";

I looked around for approximately three minutes and didn't find any good way of pulling input from the console without requiring the user to hit enter, so I just left it out.  Most brainfuck programs are just people showing off anyway, so it probably doesn't matter all that much.

It's very quick and dirty.  Like I said, first Perl program and done while my system installed updates (WRITTEN COMPLETELY IN A CLI ENVIRONMENT USING nano GASP OH NO).  It's exceedingly slow -- the three quines that I threw at it took between five and ten seconds to run on my laptop (Pentium M 1.73GHz) while my C# interpreter dealt with them very quickly.  My best guess would be that my method for pulling characters out of strings is highly inefficient (probably not helped by the fact that you don't declare variable types in Perl), but I was on a time budget with this so I kept research to a minimum and just stuck with methods that I was familiar with.

I have to say, I LOVE the post-statement evaluations that Perl has, not to mention the fun "OR DIE" clause.

I also find it amusing that the meat of the interpreter is small enough to fit inside of the "new message" textbox.  Yay, brainfuck!

153
News / BERNARD DEATHRAGE NEEDS YOUR HELP
« on: June 14, 2008, 03:40:41 AM »
Into The Inferno is not at first place on Bemanistyle.  This, obviously, is a problem.

If you can, go to the simfile page (http://www.bemanistyle.com/sims/simfile.php?id=9814) and throw a few dollars down.  WE SHALL ONE DAY PASS THAT "STAY WITH ME" BS.

YEAAAAAAAAAAAAAAAAHHHHHH!!!!!!!!!!!!!!!!!!!!!!

154
Media / [Web Comic] SUPER EFFECTIVE
« on: June 12, 2008, 03:38:33 AM »
If you guys haven't checked out Scott Ramsoomair's (creator of VG Cats) SUPER EFFECTIVE comic yet, do it:

http://www.vgcats.com/super/

It's made of awesome.

155
Computing / To a petaflop and beyond!
« on: June 11, 2008, 01:28:19 AM »
So IBM recently pushed a supercomputer to the petaflop mark: http://en.wikipedia.org/wiki/IBM_Roadrunner

Holy. Shit.

156
/ itt [font=impact][size=69pt][b][i]text[/i][/b][/size][/font]
« on: June 10, 2008, 07:22:24 AM »
wut

158
Computing / C# brainfuck Interpreter
« on: June 07, 2008, 05:27:37 AM »
hay guyz

I just wrote a horrible brainfuck interpreter in C#:

Code: [Select]
/* Quick and Dirty C# Brainfuck interpreter, by Spectere.
 *
 * Written in Microsoft Visual C# 2008 Express Edition (lawl).
 * Designed to target .NET Framework v2.0...should work with v1.0/1.1 without much modification (most likely).
 *
 * By the way, you probably shouldn't be looking at this terrible code, let alone thinking about compiling it.
 * I'm dead serious.
 * This isn't robust, so don't do anything silly.
 * ...
 * Yes, that means you, Bobbias.
 */

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace BFSharp {
    class Program {
        const int MAX_RAM = 10000;
        const int MAX_LOOP = 1000;

        static void Main(string[] args) {
            if(args.Length < 1) {
                Console.WriteLine("usage: bfsharp.exe <filename>");
                return;
            }

            // We'll just use a string to hold the entire program...
            string bfProgram = null;

            // BrainRAM
            byte[] ramData = new byte[MAX_RAM];
            int ramPtr = 0;

            // loop stack
            int[] loopPos = new int[MAX_LOOP];
            int loopPtr = -1;
            int skipNum = 0;

            // instruction pointer and current instruction
            int bfIP = -1; // since you never know when you're going to run into a 2GB BF program!
            char inst = '\0'; // I don't feel like messing with character conversions, so here ya go -- more blatant inefficiency

            // file stream GET
            try {
                FileStream fstream = new FileStream(args[0], FileMode.Open, FileAccess.Read, FileShare.Read);
                StreamReader sreader = new StreamReader(fstream);

                // YA GOTTA OPERATE DA E-Z WAY
                bfProgram = sreader.ReadToEnd();

                // clean up file handles
                sreader.Close();
                fstream.Close();
            } catch {
                Console.WriteLine("Error opening file! :(");
                return;
            };

            // parse dat shit
            while(bfIP < bfProgram.Length-1) {
                inst = Convert.ToChar(bfProgram.Substring(++bfIP, 1));

                switch(inst) {
                    case '+':
                        if(ramData[ramPtr]==255) ramData[ramPtr]=0;
                        else ramData[ramPtr]++;
                        break;
                    case '-':
                        if(ramData[ramPtr]==0) ramData[ramPtr]=255;
                        else ramData[ramPtr]--;
                        break;
                    case '>':
                        if(++ramPtr==MAX_RAM-1) ramPtr=0;
                        break;
                    case '<':
                        if(--ramPtr==-1) ramPtr=MAX_RAM-1;
                        break;
                    case '.':
                        if(ramData[ramPtr]==10) Console.Write("\n");
                        else Console.Write((char)ramData[ramPtr]);
                        break;
                    case ',':
                        ramData[ramPtr]=(byte)Console.ReadKey(true).KeyChar;
                        break;
                    case '[':
                        if(ramData[ramPtr]!=0) loopPos[++loopPtr]=bfIP;
                        else { skipNum++;
                            while(skipNum>0) {
                                switch(bfProgram.Substring(++bfIP,1)) {
                                    case "[":
                                        skipNum++;
                                        break;
                                    case "]":
                                        skipNum--;
                                        break;
                                }
                            }
                        }
                        break;
                    case ']':
                        if(ramData[ramPtr]!=0) bfIP=loopPos[loopPtr];
                        else loopPtr--;
                        break;
                }
            }
        }
    }
}

I consider it proof that you can write some pretty nasty shit in C#.  I think my personal favorite statement is this: "switch(bfProgram.Substring(++bfIP,1))".  There's so much wrong with that I don't even know where to begin.

This should work without a hitch (well, aside from the code being a horrible abomination) in Visual Studio 2003 and above.  I wrote it with VC# 2008 Express Edition, so it should work on just about anything.  It'll probably compile on .NET 1.0/1.1 but I dunno; I don't feel like installing VS.NET 2002 to find out.

But enough about that...enjoy!

159
Media / The Random Lyrics Thread
« on: June 07, 2008, 01:40:12 AM »
Punch up a few lines (or, hell, a whole song if you want) and the artist/album/track name and stuff (feel free to steal my table if BBCode if you like...might want to avoid it if tangled BBCode makes your head hurt, though :S).

I shall start.

Quote
We've died a million times
But we are not the walking dead
So fucking far from gone
We jump around and bang our heads

Artist:
Machinae Supremacy
Album:
Overworld
Title:
Overworld

I love this CD.  I love this CD.  I love this CD.  I love this CD.  Everybody buy it now.

160
/ The Enthusiastic Replies Thread
« on: June 04, 2008, 04:00:21 AM »
OMG OMG OMG OMG OMG OMG OMG

You guys make me so happy!  It's been a hell of a ride and all, running this community and shit, but you guys make it so totally worth it!

In this thread we should openly discuss things!  Oh man, I'm excited over the possibilities!  I could grope every single one of you right now (even Bobbias), you guys have noooooo idea LOL!  Man, this is better than getting molested!

161
Gaming / s.net GTA4 Smack-Muh-Bitch-athon for Xbox 360
« on: May 27, 2008, 12:06:46 AM »
I want to play GTA4 with you guys.

Who's down for a meet-up on Sunday at 6PM EST?

163
News / Current Ban List
« on: May 25, 2008, 03:38:23 AM »
Unstuck'd. The list of bans is waaaaayyy larger now, so trying to keep this thread accurate would be a bit difficult.

REVAMP'D.

Here's the ever-expanding list of spam bot IP, hostnames, and e-mail addresses:

Banned entityHits
IP: 79.*.*.*31
IP: 62.*.*.*12
IP: 194.165.42.*23
Hostname: *.xninet.*5
Hostname: *.internetserviceteam.*54
IP: 78.110.175.*19
IP: 95.24-31.*.*20
Hostname: *.ubiquityservers.*36
IP: 87.118.96-127.*48
IP: 91-95.*.*.*169
Hostname: *.ee3
Hostname: *.ru78
IP: 194.8.74-75.*80
Hostname: *.celerys.*6
Hostname: *.your-server.de2
IP: 117.24-31.*.*80
Hostname: *.webair.com47
Hostname: *.pk29
Hostname: *.cn73
Hostname: *.inNew!
Email: *@*.ru307

164
Computing / hay Windows users, try something plz
« on: May 24, 2008, 04:40:42 AM »
I, uh, accidentally discovered something.  I think it might be a Vista thing, but I dunno.  It works both with and without DWM (i.e. full Aero) enabled for what it's worth.  All of you, try it nao (since my XP install's head asploded for no apparent reason)...it'll only take a second.

Press CTRL+WIN+any arrow key.  If the window fills up half of the screen in the direction you picked (i.e. CTRL+WIN+Left would fill the left half of the screen with the current window) then it works.  If it does work, please post what OS version and service release level you're using*.

The main reason I ask is because I did this accidentally (I tried to CTRL+Left to go back a word and wound up hitting CTRL+WIN+Left by accident) and it doesn't seem to be officially documented anywhere, strangely enough.

*Vista Ultimate 64-bit with Service Pack 1 for me's.


Hi, I'm an idiot.  Solution below.

Pages: 1 ... 9 10 [11] 12 13 14