Holy shit. I'm doing two blogs… in a row… over the course of two days? Well, that's pretty damn awesome. Anyways, I don't have much to say, as always, but I do have this as filler.
Earlier, during my off-period in computer science, instead of playing games or anything like that, I was working with C++, and I came up with a hexdumper out of my boredom. So I came home, and I rewrote it, with a few modifications, and then I rewrote it again into PERL. Now, assuming you want them, I'm going to post them both. If they don't run properly, I'm sorry. I can't error-check on this computer, because I can't take the time to install a compiler on it.C++:#include <fstream>
#include <iostream>
using namespace std;
int main(int argv, char* argc[]) {
if(argv==1) {
cout << "You forgot to put a filename.";
cout << endl << "Usage: hexdump <filename>
";
return 0;
}
else {
istream f(argv[1]);
if(!f.fail()) {
int i = 0;
int d = 0;
while(!f.eof()) {
if(i==16) {
cout < "
" << hex << 16*d << ": ";
i = 0;
d++;
}
if(!f.eof()) {
c = f.getc();
cout << c << " ";
i++;
}
}
}
}
return 0;
}
if($ARGV[0] eq undef) {
die("Error: You forgot to put a filename.
Usage: perl hexdump.pl <filename>
");
}
else {
print "
";
if(-f $ARGV[0]) {
local $/;
$f = open F,$ARGV[0];
$x = <F>;
$i = 0;
$d = 0;
print " ";
for($dd=0;$dd<=15;$dd++) {
printf("%2X ",$dd);
}
print "
";
for($dd=0;$dd<=56;$dd++) {
print "-";
}
foreach $g (split(//,$x)) {
if($i == 0) {
printf("
%06X: ",16*$d);
$i = 16;
$d++;
}
printf("%02X ",ord($g));
$i--;
}
print "
";
for($dd=0;$dd<=56;$dd++) {
print "-";
}
}
else { die "Sorry, that is not a file.";}
}
Burn in hell.
I wish so bad I could take a programming class here. They offer javascript. Woo.WELCOME TO BUM FUCK OHIO:POPULATION: 17.67354 (hardly anyone is all there.)I'm playing Ikachan,they're rambling of pearls…But that doesn't matter
You're code has STDs.I don't have STDs.Do you have STDs?You should of been ruder with the mishap of filename error messageSerprex, you should have seen it earlier. I considered sending a terminate signal to the main system and saying, "You messed up, therefore I shut you off!"
As per you, J@D, hey, I'm supposed to be the one pissed off at everyone else.NUHUH
Ima be pissed off at joo about being pissed offI R TEH PIZDSpecially with those period ended BtitlesI'll keep that in mind, Serprex.
But pizd is teh Offs?Where areth thou?