Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

i accidentally the whole file

Name: Anonymous 2009-01-31 5:01

ok, so i wanted a simple way to run do a crc32 on files and i found someones python script to do it and it works pretty nicely. but since i like ruby a lot i decided to rewrite it in ruby. my version works (lol zlib does all the work) but i'm not convinced i'm doing it in the best way possible. basically i'm concerned there might be lots of places where if something fucks up i'm not handling it properly. one thing i've noticed is that ctrl+c'ing while the script is calculating the crc does not make the script stop cleanly. if this was c++ i would know how to handle all the dumb things that can happen with files. i do most of my ruby programming on rails so working with files is something i rarely have to do.

tl;dr any ruby programmers see dumb mistakes in my code?
http://pastebin.com/m5636859f

Name: Anonymous 2009-01-31 6:29

Ruby
Slow as fuck, that's you are problem.

Name: Anonymous 2009-01-31 8:05

Why not just use cksum?

Name: Anonymous 2009-01-31 8:22

too easy.

Name: Anonymous 2009-01-31 13:17

Alls I see is end end end end end end end end end end end end.

Name: Anonymous 2009-01-31 13:31

do
do
do
do
do
do
do
do
do
do
do
do
do
do
do
do
do
do
do
Anus.hax(my[:anus])
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end

Name: Anonymous 2009-02-01 0:20

<?php for ($i = 1; $i < count($argv); $i++) echo crc32(fread(fopen($argv[$i], "r"), filesize($argv[$i]))), " ", $argv[$i], "\n"; ?>

Name: Anonymous 2009-02-01 1:14

>>7
php is the best language to this in, Its so easy to leran you don't even have to programming.

Name: Anonymous 2009-02-01 1:25

>>7
>fread(fopen($argv[$i], "r"), filesize($argv[$i]))
file_get_contents($argv[$i])

Name: Anonymous 2009-02-01 17:11

>>9
Rule #8234 of PHP programming:
Whatever you're doing, there is a function in the standard library for it. Even if "something" is really damn stupid.

Name: Anonymous 2009-02-01 17:40

>>10
I can't find a fib or fact function in the standard library.

Name: Anonymous 2009-02-01 17:47

>>11
And even if there were such a function in the standard library, it would invariably do something stupid like printing it to stdout instead of returning the number, making it almost, but not entirely, useless.

Oh, wait, that's wordpress I'm thinking of.

Name: Anonymous 2009-02-01 19:56

>>12
void var_dump ( mixed $expression [, mixed $expression [, $... ]] )

This function displays structured information about one or more expressions that includes its type and value. Arrays and objects are explored recursively with values indented to show structure.

In PHP 5 all public, private and protected properties of objects will be returned in the output.

    Tip
As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of this function, and save it in a string (for example).

Name: Anonymous 2009-02-01 21:54

the output-control functions can be used to capture the output of this function, and save it in a string
We have all been trolled combinatorially.

Name: Anonymous 2010-12-17 1:33

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2011-02-03 1:28

Name: Anonymous 2011-02-03 8:05

Don't change these.
Name: Email:
Entire Thread Thread List