The problem is simple.
given a binary string of X(several megabytes)
it needs to be XORed with binary string Y(the same lenght).
The strings are read(converted) from files,and then results written to third file.After which a shell script is
performed on the third file.
The question is:Which language this problem is best coded in? (best=least code size,and the solution must work on Gigabyte+ files)
>>2
Its not significant.You can read it as ("any operation performed on result file").
Name:
Anonymous2007-03-11 3:03 ID:V0b/AoE6
>>2
If you think .BAT file can XOR binary strings of 2GB files you're way off.
Name:
Anonymous2007-03-11 3:06 ID:TEBb0C0k
>>4
If .BAT is your shell script you’re already fucked.
Name:
Anonymous2007-03-11 3:18 ID:V0b/AoE6
>>5
Of course,the Universal Solution To Every Programming Problem:
Upgrade to Lunix.
Name:
Anonymous2007-03-11 3:27 ID:TPNQZtRW
Durr, if you must ask you truly are a dumbass.
Name:
Anonymous2007-03-11 3:40 ID:V0b/AoE6
>>7
I'm not asking for code.I'm ASKING FOR LANGUAGE NAME.
e.g: i'm not asking you translate to French,just asking which language has
certain word order.
Name:
Anonymous2007-03-11 3:48 ID:TEBb0C0k
>>6
Yes, because under *nix you’d just have two input pipes XORing to one output pipe.
Name:
Anonymous2007-03-11 3:59 ID:rIy/dn7y
c you fags
int main(){FILE *a,*b,*c;int d,e;a=fopen("X","rb");b=fopen("Y","rb");c=fopen("Z","wb");
while((d=getc(a))!=EOF && (e=getc(b))!= EOF) putc(d^e,c);
return 0;
}
>>10
newlines are not a bad thing.
and i agree, C is the best language for something like this. int main(){
FILE *a,*b,*c;
int d,e;
a=fopen("X","rb");
b=fopen("Y","rb");
c=fopen("Z","wb");
while((d=getc(a))!=EOF && (e=getc(b))!= EOF)
putc(d^e,c);
return 0;
}
Name:
Anonymous2007-03-11 4:41 ID:TPNQZtRW
>>8
What I'm saying is you're asking for something really fucking simple leading me to believe you know very little about programming. Anyone who is even remotely familiar with C/C++ should be able to whip up something like that in no time at all, as demonstrated above.
In short read more to prevent people from having to answer your ignorant, dumbass questions.
Name:
Anonymous2007-03-11 6:45 ID:kGtv67xu
C with asm inline (that comes with its horrible AT&T syntax) or you are not a real man.
Name:
Anonymous2007-03-11 7:36 ID:xE2qlGeY
Haskell.
Here's binary or: .|.
I don't know what xor looks like, but I used it a while ago.
>>26
ByteString does quite a bit of unrolling and fusion and all that jazz. I'd worry more about the bit where you don't use "B.putStr" instead of the map thing.
Name:
Anonymous2007-03-13 1:49 ID:RqZVPZqG
>>28
I didn't use that because I didn't find `pack' before.
Fixed: import qualified Data.ByteString as B
import Data.Bits
main = do
x <- B.readFile "file1"
y <- B.readFile "file2"
B.putStr $ B.pack $ B.zipWith xor x y
Name:
Anonymous2009-01-14 13:35
Name:
Anonymous2009-03-06 5:41
like you only have sex with men this year and then I moved with my auntie and uncle in!
Name:
Anonymous2011-01-31 21:34
<-- check em dubz
Name:
Anonymous2011-03-22 23:30
mfw character-at-a-time
learn to use buffers, holy fucking shit!
>>10-11,15-16
You are fucking faggot bottoms because you read byte-by-byte. Lern2read bitches before I take my Aussie Bum pants off and plunge my erect penis into your shaved virgin anii sequentially.