


World's Shortest P2P App: 15 Lines 443
soren.harward writes "The New Scientist has an article about TinyP2P, the world's smallest P2P app. It's 15 lines of Python code brought to us by Edward Felten, CS Professor at Princeton and outspoken supporter of the digital rights the Slashdot community holds so dear. He wrote the program as a proof-of-concept that P2P apps are really easy to write, don't have to be complicated, and thus banning them (a la the INDUCE Act) is pointless and silly."
Why TinyP2P when you have MoleSter (Score:3, Interesting)
MoleSter [sooke.bc.ca]
466 bytes (Score:1, Interesting)
$/=$_;$,=shift;$w=$a=shift;$k{+shift}=1;socket S,2,1,6;bind S,for(listen
S,5;$SIG{ALRM}=\m! (\S+) ([e-i])([^/]*)/!s&&($k{$w=$1}=$,eq$`)&&&$2){alarm
9;(accept(C,S),alarm 0)?read C,$_,1e6:($_="$, $a f".shift)}sub i{}sub t{socket
C,2,1,6;$k{$w}&&=(connect C,&a)?print C"$, ".pop:0;close C}sub h{t"$_ i/"for
keys%k}sub a{$w=~/:/;pack'CxnC4x8',2,$',split'\.',$`}sub f{$w=$_,t"$1 $3/"for
keys%k}sub e{open C,'>',$3;print C $'}sub g{open(C,';&h}
http://ansuz.sooke.bc.ca/software/molester/ [sooke.bc.ca]
Re:Easier = should be legal? (Score:2, Interesting)
However, that said, the same can often be said of viruses, worms, and other malicious software. The only difference I think is the complexity involved, but not being a virus writer I can't really speak to that :P.
Re:Reported last month (Score:5, Interesting)
Re:bet i could write a 15 line (Score:2, Interesting)
Interesting implementations (Score:5, Interesting)
Of course, there are other interesting implementations out there. IIRC, there used to be a web server that was written entirely in Postscript. Although not written in Postscript, one of the early rivals to X - InterViews - used Postscript as the graphics language.
The winner of the 50th Anniversary of the Manchester Mk. 1 programming contest was a program written in something like 20 words of assembly a programmable timer for chicken soup. (When you consider that the assembly language for the MM1 had 8 instructions, no add operation, and no real-time clock, that's not bad going.)
466 bytes, no outside libraries (Score:3, Interesting)
When will this code be on a T-shirt? (Score:1, Interesting)
I can see P2P becoming the next DeCSS in the eyes of the courts and receiving similar treatment.
So when can I expect my shirt?
Perl golf goes by the byte (Score:5, Interesting)
Machine language, the bytecode form of assembly language that microprocessors interpret, doesn't really have "lines" either. The point isn't that MoleSter is 6 lines as much as it is 466 bytes, and programming golf rules [xs4all.nl] state that a lower score in bytes is better.
Re:Eh? (Score:3, Interesting)
No, but it is one of the reasons that it's a "social infection" that's damn hard to stamp out.
Same with pot. It's a weed, fer chrissakes. It'll find a way to grow through concrete, and in areas where other plants will die. It's practically impossible to eradicate it (until we've got nanotech, but even then I think it would be foolish to attempt; once we have nanotech, there'll be much easier ways to achieve a high with far fewer side effects; and it can be maintained indefinitely while being ultra-productive as well).
Re:Libraries (Score:4, Interesting)
You know what happens when you don't totally reinvent a chunk of code but instead write a chunk of code suited directly to your specific goals? The file size shrinks and it does only what you want it to. Sounds good to me.
For a look at what writing everything from scratch gets you, look at this demo:
http://www.pouet.net/prod.php?which=482
I
Imagine what Microsoft could do if they rewrote code more often to directly suit a certain goal, instead of just building up on top of what they already have. I want the next release of Windows to have a *smaller* footprint than XP. heh.
Re:Eh? (Score:2, Interesting)
Same thing with p2p. If anyone can whip up a peer to peer in 5 minutes, then it does little good to ban peer to peer. Sure, the government could monitor all bandwidth, have encrypted packets decrypted by supercomputer, have a log of every packet of information going across the internet. But the expense would be more than whatever the percieved economic damage of file sharing is.
Re:Reported last month (Score:2, Interesting)
Hey, I like compact perl scripts as much as the next guy. I've done some fun things in "one line", and part of the appeal is having someone look at it for a couple minutes before going "ah, I see. slick". But I can't see taking something that would be on the order of 30 lines or so of reasonably formatted script and taking out all the white space to fit as much as possible into an 80 column display and claiming it is 3 lines. That doesn't impart any useful information about how compact the code is relative to the task it performs.
Re:Reported last month (Score:4, Interesting)
This (I'm fairly sure...it's been a few months since I've coded up some Perl) prints out 'omg line' for each line (every time, because the
You can have multiple statements on one line.
Re:Interesting implementations (Score:3, Interesting)
Now if you were to use 600x600 DPI, 2 sides of the paper, you'd get 8MB on a single sheet of paper. An optical 2400x2400 scanner should be sufficient to correctly "read" the 600x600 format.
Assuming you can recognize about 16 shades of gray on a paper, you now get (2^4=16, so 4x) 32MB on a single sheet.
Assume you can do the same for the CMY colors too and you have 128MB on a sheet.
I'd like to see if anybody could write a program which could "store" and "read" such information. If it could store about 5-6MB per page it could contain most MP3 files
Talk about sheet music