Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

World's Shortest P2P App: 15 Lines

CowboyNeal posted more than 9 years ago | from the no-need-to-be-fancy dept.

The Internet 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."

Sorry! There are no comments related to the filter you selected.

eph pee (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#11283079)

you guessed it

Re:eph pee (0)

Anonymous Coward | more than 9 years ago | (#11283291)

fuck slashdot and its clones of not-even-the-first-time-newsworthy fuck-topics.

fuck taco.

fuck mozilla.

fuck firefox.

fuck rathat and that crappy lunix-os of theirs.

Repeat :) (-1, Offtopic)

LT4Ryan (178006) | more than 9 years ago | (#11283083)

FP

Reported last month (5, Informative)

joeldixon66 (808412) | more than 9 years ago | (#11283084)

The 15 line P2P has been mentioned before [slashdot.org] by Slashdot - but the New Scientist article wasn't mentioned last time (as it hadn't yet been written).

The last article also mentioned the 9 line Molestar written in Perl - which is now 6 lines [sooke.bc.ca] .

Re:Reported last month (0)

Anonymous Coward | more than 9 years ago | (#11283152)

Am I the only one who read "Molestar" as "Molester" at first?

Re:Reported last month (1, Troll)

stratjakt (596332) | more than 9 years ago | (#11283235)

It is molester.

The guys an asshole and thinks molester is a funny pun.

Re:Reported last month (0)

Anonymous Coward | more than 9 years ago | (#11283309)

quit being a prude, it is funny.

Re:Reported last month (4, Funny)

nxtr (813179) | more than 9 years ago | (#11283340)

Maybe New Scientist editors read Slashdot for their news, which then Slashdot user read for more news. I wouldn't be surprised if I saw this article in New Scientist next month.

Repost (0, Redundant)

sriram_2001 (670877) | more than 9 years ago | (#11283086)

This was posted to Slashdot a couple of weeks back

dupe (-1, Redundant)

Karamchand (607798) | more than 9 years ago | (#11283087)

It's a dupe [slashdot.org]

bet i could write a 15 line (5, Funny)

catbutt (469582) | more than 9 years ago | (#11283089)

dupe checker for slashdot

Re:bet i could write a 15 line (1)

muzzmac (554127) | more than 9 years ago | (#11283134)

I bet you can't.

Re:bet i could write a 15 line (1)

EpsCylonB (307640) | more than 9 years ago | (#11283204)

How difficult would it be ?

All slashdot editors have to do is search through their archive to see if there are any similar stories. It wouldn't be difficult to automate.

Re:bet i could write a 15 line (1)

EnronHaliburton2004 (815366) | more than 9 years ago | (#11283304)

There are thousands of stories in the Archive. Comparing every article submission against every story

It wouldn't be difficult to automate.

Really? How? Computers have a really hard time parsing human language, and comparing two paragraphs to see if they are about the same subject would be quite difficult. If you could write a program to do that well you'd be a billionare.

The computer could check URLs, but often the URLs in dupe stories are different then in the original story.

Re:bet i could write a 15 line (2, Informative)

realdpk (116490) | more than 9 years ago | (#11283337)

World's Shortest P2P App: 15 lines [slashdot.org] just over the middle of the page.

Re:bet i could write a 15 line (0)

Anonymous Coward | more than 9 years ago | (#11283219)

if exist (article) then DUPE=true

Re:bet i could write a 15 line (0)

Anonymous Coward | more than 9 years ago | (#11283271)

Two lines:
#!/usr/bin/perl
print "COWBOY NEAL: PUT DOWN THAT CHEESEBURGER AND DO YOUR FUCKING JOB!\n";

abcdefghijklmnopqrstuvwxyz no yelling

Perl (0)

Anonymous Coward | more than 9 years ago | (#11283092)

Wasn't there a Perl P2P app that was only 9 lines, or something?

Dupe. (0)

Anonymous Coward | more than 9 years ago | (#11283094)

Thanks for playing.

repost (0)

Anonymous Coward | more than 9 years ago | (#11283095)

repost...

Duplicate... (1, Redundant)

Haydn Fenton (752330) | more than 9 years ago | (#11283097)

Duplicate [slashdot.org] .

Re:Duplicate... (0, Redundant)

Haydn Fenton (752330) | more than 9 years ago | (#11283144)

Duplicate [slashdot.org] .

Re:Duplicate... (4, Funny)

thhamm (764787) | more than 9 years ago | (#11283215)

your dupe post is da dupe too. ugh.

Re:Duplicate... (0)

Anonymous Coward | more than 9 years ago | (#11283331)

was intended to be funny, ah well :p

No... (1)

Mitchell Mebane (594797) | more than 9 years ago | (#11283288)

...that's just one of the multiple sources on the new SlashTorrent network.

Easier = should be legal? (4, Insightful)

nizo (81281) | more than 9 years ago | (#11283098)

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.

Umm, if I publish a recipe for crack that uses 2 less ingredients than the normal recipe and takes only half the time to make, why would that be a valid argument for making crack legal? Don't get me wrong I think the act is idiotic, but I don't follow Mr. Felton's reasoning here.

Re:Easier = should be legal? (4, Insightful)

Skepparn (838310) | more than 9 years ago | (#11283139)

i follow your point, but i think that his point is that banning ONE program is pointless, since "anyone" (not me though) easily could program a new p2p app..

Re:Easier = should be legal? (4, Insightful)

nurb432 (527695) | more than 9 years ago | (#11283155)

But the act of publishing your recipe should remain legal. As should the existance P2P apps. I think is the point everyone is making, in their own way.

Its the illegal use of your recipe, or the improper use of the p2p that should be dealt with, not the technology ( or information, in your example )..

Re:Easier = should be legal? (2, Insightful)

JustAnotherBob (811208) | more than 9 years ago | (#11283162)

The inherent ingredient in Crack, Cocaine, which egal to begin with. A P2P app inheriently is not illegal, but illegal acts can be commited by the use of the application though. The point of making the P2P app in 15 lines of code is to prove that legislation regulating and restricting the development/dissemination of P2P applications would be pointless.

Re:Easier = should be legal? (1)

soft_guy (534437) | more than 9 years ago | (#11283203)

I was going to make this point too. It's pretty easy to kill someone with a handgun - even easier than writing a 15 line P2P app. This doesn't mean murder should be legal.

Re:Easier = should be legal? (2, Insightful)

Class Act Dynamo (802223) | more than 9 years ago | (#11283252)

But simply using p2p should not be illegal. There are legitimate uses for it. Your argument is like saying crack houses are bad, so let's ban houses.

Re:Easier = should be legal? (1)

R2.0 (532027) | more than 9 years ago | (#11283268)

No, but it does imply that banning handguns is pointless.

Re:Easier = should be legal? (1)

iXiXi (659985) | more than 9 years ago | (#11283316)

Yeah, like making the drinking age 21 keeps people from dying from accidents caused by DUI's. It takes a bit of convoluted logic to follow that path.

Re:Easier = should be legal? (0)

Anonymous Coward | more than 9 years ago | (#11283294)

ok, murder not legal
but handgun not legal?

Re:Easier = should be legal? (1)

Derling Whirvish (636322) | more than 9 years ago | (#11283330)

I don't follow the logic either. How about a pipe bomb? They too are easy to make and simple to operate. But the manufacture or possession of one is a felony not just the use of it. Should making or owning a pipe bomb be legal?

Re:Easier = should be legal? (2, Interesting)

Derekloffin (741455) | more than 9 years ago | (#11283317)

I think the real point is how do you enforce such a think meaningfully. The compiler isn't illegal, and if the code is a mere couple lines, you need no real expertise to code one, a simple internet search could easily yield a viable codebase. So, any joe shmoe with a text editor, a PC, and the appropriate compiler installed can create a P2P app and replicate it endlessly, not to mention quite easily distribute it too. At that point enforcement of any law banning such apps becomes really difficult to justify.

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.

Libraries (2, Insightful)

flossie (135232) | more than 9 years ago | (#11283100)

import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac

15 lines of code, but linking to libraries that do much of the hard work.

Re:Libraries (-1, Flamebait)

Anonymous Coward | more than 9 years ago | (#11283236)

You moron, of course you link in libraries doing lots of work for you. That's what allows modern apps to have many more features.

What, an app isn't "real" unless you reinvent every freakin' wheel and do it in assembly?

Re:Libraries (4, Insightful)

flossie (135232) | more than 9 years ago | (#11283261)

of course you link in libraries doing lots of work for you. That's what allows modern apps to have many more features.

Quite. But the implication of the article is that the code is trivial because it takes so few lines to write. I could easily write a fast fourier transform program in just a few lines by linking to FFTW, but that doesn't mean that FFT is trivial.

Re:Libraries (5, Insightful)

LnxAddct (679316) | more than 9 years ago | (#11283247)

In that case, next time you write a hello world program, make sure you write a custom OS with it and don't forget the thousands of drivers you'll need. Sharing or reusing code is a common and necessary practice.
Regards,
Steve

Re:Libraries (0)

Anonymous Coward | more than 9 years ago | (#11283280)

Yes, and as we all know, code reuse is a disgusting practice. As far as your logic goes, perhaps it should have been written entirely in machine language. Even assembler pneumonics obsfuscate the inner workings through abstraction. Please, get a clue.

-Slashdot

Re:Libraries (2, Funny)

Neil Blender (555885) | more than 9 years ago | (#11283318)

Yes, and as we all know, code reuse is a disgusting practice. As far as your logic goes, perhaps it should have been written entirely in machine language. Even assembler pneumonics obsfuscate the inner workings through abstraction. Please, get a clue.

I start every coding project with 50 tons of sand, some plastic, some iron ore, and a few other items including zinc.

Re:Libraries (1)

flossie (135232) | more than 9 years ago | (#11283345)

I start every coding project with 50 tons of sand, some plastic, some iron ore, and a few other items including zinc.

Iron ore? Luxury. When I was a lad, we had to dig t'ore out of t'mines with our bare hands; and pay mine owner t'work there. And when we got home ...

Re: Libraries (2, Informative)

dubhead (173092) | more than 9 years ago | (#11283332)

The point is, these are standard Python libs.
You don't need to install external third-party libraries for this app.

Subscribers: (0, Flamebait)

johnny_sas (785125) | more than 9 years ago | (#11283109)

I bet you're really glad to be the firsts to see this.... REPOST!!!!

deja vu (1)

tomcio (143235) | more than 9 years ago | (#11283112)

what about the guy that wrote 9 line p2p
this is several months ago

Speaking of dupes... (1)

thesatch (844290) | more than 9 years ago | (#11283119)

I can't wait for all the dupe posts in this story.

Re:Speaking of dupes... (2, Funny)

Anonymous Coward | more than 9 years ago | (#11283157)

I can't wait for all the dupe posts in this story.

Re:Speaking of dupes... (0)

Anonymous Coward | more than 9 years ago | (#11283305)

I can't wait for all the dupe posts in this story...

Dupe (0, Redundant)

AhabTheArab (798575) | more than 9 years ago | (#11283120)

Re:Dupe (0)

Anonymous Coward | more than 9 years ago | (#11283181)

No, you did not, because althought the TinyP2P file was posted on slashdot earlier, the New Scientist article, the INDUCE ACT, and the other links were not posted before.

Please do not jump on the "ooh, i found a mistake" bandwagon and claim so when there isn't actually a mistake made.

P2P (3, Insightful)

tuxter (809927) | more than 9 years ago | (#11283122)

NApster, kazaa, bittorrent, Whatever you use and they then ban will be replaced with another app. There is always someone smarter than the last guy, therefore you will never get rid of P2P altogether.

Re:P2P (0)

Anonymous Coward | more than 9 years ago | (#11283276)

Unless peer-to-peer is made completely illegal, which is on the horizon.

Why TinyP2P when you have MoleSter (2, Interesting)

OverlordQ (264228) | more than 9 years ago | (#11283127)

Dr. Edward Felten recently posted a piece of code called TinyP2P, which demonstrates how easy it is to create a peer-to-peer filesharing application by doing it in just 15 lines of Python. However, TinyP2P uses a ready-made XMLRPC server library, which seems to me to be taking the easy way out. Here's my response: MoleSter, a non-trivial filesharing application in 6 lines of Perl, using no protocol library more sophisticated than TCP.


MoleSter [sooke.bc.ca]

Re:Why TinyP2P when you have MoleSter (1, Funny)

Anonymous Coward | more than 9 years ago | (#11283178)

Oh Please.

Perl is Barbaric.

People who use Perl are Barbarians.

Re:Why TinyP2P when you have MoleSter (0)

Anonymous Coward | more than 9 years ago | (#11283237)

RRRRRR!! Thag declare hashtable!

I can do better (5, Funny)

krbvroc1 (725200) | more than 9 years ago | (#11283131)

10 wget http://localhost/warez/\* 20 pause 10 30 goto 10

Rerunning stories?? (1)

E IS mC(Square) (721736) | more than 9 years ago | (#11283135)

Seems /. is running out of new 'scoops'!

Thank god! (2, Funny)

ozric99 (162412) | more than 9 years ago | (#11283142)

I've been waiting for a suprnova replacement for a while!

Re:Thank god! (1)

thryllkill (52874) | more than 9 years ago | (#11283160)

suprnova was a website... this is a p2p app...

Re:Thank god! (1)

ozric99 (162412) | more than 9 years ago | (#11283185)

You don't say...

1 line? (1)

Nightreaver (695006) | more than 9 years ago | (#11283143)

Øøøh, what's the problem of making a 1 line P2P app? The line might get a bit long, but that isn't a problem...

Re:1 line? (1)

Knights who say 'INT (708612) | more than 9 years ago | (#11283167)

Python is line-based, like Old Basic. There's no ";", so each command has to be on a different line.

Re:1 line? (5, Funny)

prodangle (552537) | more than 9 years ago | (#11283173)

Lines cannot be longer than 80 chars - it's the law :)

Re:1 line? (0)

Anonymous Coward | more than 9 years ago | (#11283208)

Depends on language, here is my BT client in bash: ./btclient &

Instead of talking about the repost (3, Funny)

ian rogers (760349) | more than 9 years ago | (#11283145)

Why don't you guys just write a 15 line program that checks the first 50 replies to stories, and filter out 49 of them that say anything about it being a repost.

Re:Instead of talking about the repost (1)

Tangwei (704210) | more than 9 years ago | (#11283323)

Wouldn't that filter your post out?

How does this prove anything? (3, Insightful)

nt7s (842196) | more than 9 years ago | (#11283148)

Does anyone want to enlighten me as to how a 15 line P2P app means that it is pointless and silly to ban them? TPTB are not going to care if you hack together a little P2P app that you and your buddies use. However, if that little app becomes as popular as Kazaa or BitTorrent, you can bet they will be gunning for your program; they won't care if it is 15 lines or 150000 lines.

Re:How does this prove anything? (4, Insightful)

anum (799950) | more than 9 years ago | (#11283327)

POOR ANALOGY ALERT:
The nearest analogy I can think of is Prohibition. You can make alcohol illegal and you can punish people for making it or selling it or drinking it, but there are a lot of people who want to drink and alcohol is VERY easy to make. So every time you close down one source another pops up. There is a demand and you can't control the supply because anyone with enough time can create a new supply.

Now feel free to argue the inappropriate nature of my analogy. Have fun!

Heh.. (0)

Anonymous Coward | more than 9 years ago | (#11283154)

Isn't it kind of ironic how many dupe "dupe story" posts there are?

Re:Heh.. (0)

Anonymous Coward | more than 9 years ago | (#11283182)

Also how many "look at all the dupe dupes" there are strangely enough

Something else new (1)

MrLint (519792) | more than 9 years ago | (#11283156)

Under the regime of the new red scare by the leader Bill Gates.. hes now a communist.

I apologize for blatant whoring.

"dupe" (0, Redundant)

KingDoubt (585013) | more than 9 years ago | (#11283158)

Am I the only one who finds it ironic there are so many "dupe" posts? ... dupe dupes...?

Eh? (5, Insightful)

ZSpade (812879) | more than 9 years ago | (#11283171)

How does the fact that they're simple to make have any ramifications on whether or not they should be banned? Meth is simple to make, but I don't see anyone using that as excuse to make it legal. "P2P can be simple and written very quickly, so to try to ban or prevent the technology is not feasible." What he fails to mention is that while they may be simple and quick to write, they take months to gather serious steam, giving ample time to stop them, at least from becoming mainstream like bit torrent, Kazaa, or edonkey. It honestly makes no sense. I don't agree that they should be made illegal, but this is not really a decent supporting argument as to why.

Another Record also broken (1)

Prince Vegeta SSJ4 (718736) | more than 9 years ago | (#11283174)

Shortest Time To Cease & Desist letter

Shortest lawsuit... (2, Funny)

dogmatixpsych (786818) | more than 9 years ago | (#11283176)

And to go along with this the MPAA and RIAA will quickly hit the programmer with the world's shortest lawsuit. It will be written in English.

how come no one (2, Funny)

geekoid (135745) | more than 9 years ago | (#11283177)

has mentioned that this story is a dupe?

Re:how come no one (0)

Anonymous Coward | more than 9 years ago | (#11283301)

Ditto. People continue to discuss it. It hurts my head. It was a stupid story the first time around.

whatever... (0)

Moustache N Tits (828608) | more than 9 years ago | (#11283179)

that's nothing, I can do the oldest program ever in 1!: print 'hello world!' beat that super smart scientist

Python? (4, Funny)

Psychor (603391) | more than 9 years ago | (#11283189)

Python? That code is so hard to read I thought it was Perl!

Re:Python? (1)

mr_z_beeblebrox (591077) | more than 9 years ago | (#11283263)

Python? That code is so hard to read I thought it was Perl!

I don't usually say this but....Mod parent UP!!! Funny ... laugh or actually, maybe insightful ;-)

You know it's Slashdot... (0)

Anonymous Coward | more than 9 years ago | (#11283192)

when all "It's a dupe!" posts are modded Redundant.

FIRST POST!!! (0)

Anonymous Coward | more than 9 years ago | (#11283195)

FP!! In you're face Slashdot!! USA! USA! USA!

The Dr. Said it best (1)

OverlordQ (264228) | more than 9 years ago | (#11283209)

My goal in creating this program is not to facilitate copyright infringement. I do not condone copyright infringement. Nothing about the program's design is optimized for the sharing of infringing files. The program is useful mainly as a proof of concept. A more practical program would be faster, more secure, and more resilient against failure. But that would require a few more lines of code!


Just because it can be done, doesn't mean you should.

repost comments! (5, Funny)

Anonymous Coward | more than 9 years ago | (#11283223)

heres some +5 comments for your viewing pleasure!

The point is that a person/entity can create a P2P program with a very small amount of custom code. If someone is going to ban P2P for "inducing" copyright infringement, they'd look stupid for banning a program this small or they'd have to ban the libraries that are used too which is pretty unlikely.

A p2p app is pretty pointless without a network stack but no one counts that as part of the app or supporting code. Don't pick the nits too much.

Umm, you're missing the point. The fact is with commonly available tools, and I'd consider Perl and Python (or Java) with their massive stock libraries "commonly available", one can easily write a p2p app (heck, BitTorrent is written in Python, so I think it's a very valid example).

Hell, by your logic, the following application:

int main(int argc, char **argv)
{
printf("Hello World");
}

is cheating, since I'm using printf, and god knows how complicated that call is, not to mention all the code in the OS to make the text appear on stdout!

Those are both cheating.

Okay, here's p2p in two lines of perl:

#!/usr/bin/perl
`wget http://www.filefront.com/?filepath=/gnutelliums/gt k-gnutella/gtk-gnutella-0.92.1c.tar.gz`;

It also uses files, which is totally cheating. Without fi.write(), this guy would have to do a lot more work to have the computer convert a virtual address into the a device real address and accessing the filesystem implementation specific rules to carry out the necessary data and metadata operations to complete the task. And thats just the half of it.

Do Perl developers have some kind of reverse size-compensation complex?

Anything you can do I can do smaller?

It's commonly referred to as "golf". ;) http://www.perlmonks.org/index.pl?node=golf [perlmonks.org]

I have just created a zero line P2P program which I have entitled "Walking to the Neighbor's House to Borrow a Movie".

I could be evil and patent it, but I have decided to release it under the GPL.

I have discovered a truly marvelous demonstration of P2P that this margin is too narrow to contain.

--Fermat's Second-to-Last Conjecture

I've added some new features to your wonderful program, which I too am releasing under the GPL. I call it:

"Breaking in to the Neighbor's House to steal a Movie".

Oh yeah, I got it in 2 lines of shell: (Score:5, Funny)
by Anonymous Coward on Wednesday December 15, @01:10PM (#11096822)
#!/bin/bash
### ToDo: Write P2P app here

There goes my argument that Python promotes readable code....

Matthew Scala, a reader of Freedom to Tinker, has responded with the 9 line MoleSter, written in Perl.

There have been discussions recently about potential employers doing a Google search on job applicants, so the way I see it Mr. Scala's either very smart or very stupid.

Very stupid, for the fact a lot of searches will put "Matthew Scala" and "molester" together on the same page.

Very smart, because this tactic will bury any evidence of his pedophilia under a pile of MoleSter links and pages.

=P
--
± 23 dB

Faulty logic (1)

Junior J. Junior III (192702) | more than 9 years ago | (#11283224)

I can kill someone with as much simplicity as a bullet to the head. Does that make murder laws silly?

Re:Faulty logic (0)

Anonymous Coward | more than 9 years ago | (#11283254)

Heh. Nice. Wish I had mod points.

Your faulty logic (0)

Anonymous Coward | more than 9 years ago | (#11283302)

Murder hurts someone. Writing a program that is able to transfer data does not.

Easy to write therefore ridiculous to ban? (4, Insightful)

maynard (3337) | more than 9 years ago | (#11283228)

I don't understand this. Yeah, it's pretty cool to write a fifteen line P2P app, but just because the concept is simple to implement doesn't mean it's unworthy to ban. Not that I'm arguing for banning P2P apps, I'm just critiquing the logic used here. It's also fairly easy to write a simple virus or trojan. Should law enforcement give up pursuing computer criminals who write viruses and such as a result? Better put: shouldn't the amount of damage to society be the valuation for enacting a ban or chasing criminals, not the ease with which criminals obtain or create their tools of trade? Maybe his original statement was taken out of context or more nuanced than the quoted text... --M

466 bytes (1, Interesting)

Anonymous Coward | more than 9 years ago | (#11283250)


$/=$_;$,=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]

Silly (1)

Reality Master 101 (179095) | more than 9 years ago | (#11283255)

Sawed-off shotguns are easy to make, too. Doesn't seem to stop them being illegal.

My question is, what is with this need for geeks to "prove" something is innocuous based on the number of lines of code? It's just so stupid. Viruses are easy to write, too (I'm sure someone can do it in 15 lines), but that doesn't mean we shouldn't make those illegal.

Makes me weep for the future when I see college professors being so blind to what the real issues are here.

dupe checker in shorter (0)

Anonymous Coward | more than 9 years ago | (#11283275)

Can probably then make a dupe checker for slashdot even shorter!

http://www.immigrantornot.com/ [immigrantornot.com]

Pete (0)

Anonymous Coward | more than 9 years ago | (#11283279)

and Repeat...

A more legible version of tinyp2p.py (4, Informative)

dstone (191334) | more than 9 years ago | (#11283285)

Code is left intact, but here is the whitespace massaged into a more widely-accepted (and readable) convention. You see, Python isn't -that- sensitive to whitespace! ;-)
# tinyp2p.py 1.0 (documentation at http://freedom-to-tinker.com/tinyp2p.html)

impo rt sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac # (C) 2004, E.W. Felten

ar, pw, res = (
sys.argv,
lambda u:hmac.new(sys.argv[1], u).hexdigest(),
re.search)
pxy, xs = (
xmlrpclib.ServerProxy,
SimpleXMLRPCServer.SimpleXMLRPCServer)

def ls(p=""):
return filter(
lambda n: (p == "") or res(p, n),
os.listdir(os.getcwd()))

if ar[2] != "client": # license: http://creativecommons.org/licenses/by-nc-sa/2.0
myU, prs, srv = (
"http://"+ar[3]+":"+ar[4],
ar[5:],
lambda x:x.serve_forever())

def pr(x=[]):
return ([(y in prs) or prs.append(y) for y in x] or 1) and prs

def c(n):
return ((lambda f: (f.read(), f.close()))(file(n)))[0]

f = lambda p, n, a: \
(p == pw(myU)) and \
(((n == 0) and pr(a)) or ((n == 1) and [ls(a)]) or c(a))

def aug(u):
return ((u == myU) and pr()) or pr(pxy(u).f(pw(u), 0, pr([myU])))

pr() and [aug(s) for s in aug(pr()[0])]

(lambda sv: sv.register_function(f, "f") or
srv(sv))(xs((ar[3], int(ar[4]))))

for url in pxy(ar[3]).f(pw(ar[3]), 0, []):
for fn in filter(lambda n:
not n in ls(),
(pxy(url).f(pw(url), 1, ar[4]))[0]):
(lambda fi: fi.write(pxy(url).f(pw(url), 2, fn)) or
fi.close())(file(fn, "wc"))

# lines isn't important.. (2, Insightful)

dustinbarbour (721795) | more than 9 years ago | (#11283290)

It's about file size or byte count. That's it. Why there is such a hoopla over the number of lines I don't know.. It's an arbitray definition.

Where's my T-shirt? (1, Funny)

Anonymous Coward | more than 9 years ago | (#11283299)

Might as get ready for my trial when the RIAA sues everyone for fair use.

Reminds me of a much simpler day on the web (1)

MerlynEmrys67 (583469) | more than 9 years ago | (#11283312)

People pointing out that you could write a web server in x lines of perl ( usually in the low 2 digits ) and people talking about the smallest embedded web server (including the networking stack) in the low double digit K bytes (as in 12 - 19 K bytes)

Can you even boot a modern OS with less than 1 MB ram these days ?

I don't want to brag but... (4, Funny)

revery (456516) | more than 9 years ago | (#11283328)

I wrote a 2 line p2p app in python:

import modified_tinyp2p, sys
modified_tinyp2p(sys.argv[1])

dependent libraries? what dependent libraries?!

Interpreted. Yar! (0)

Anonymous Coward | more than 9 years ago | (#11283339)

Don't get me wrong, Python is a wonderful language. Add the size of the interpreter and libraries and you'll get quite a bit more "code" behind the P2P app. I could write a library with a single export and write a C program that could call "start_server()" and be within the confines of 5 or 6 lines. For that matter, write an app that reads a single byte config file for a function. Does that make the P2P application a single byte?

Also I have to ask why a program's ease of creation would have anything to do with banning it. How about a virus?

find (com/exe/bat/vbs/wsh/scr/vxd/sys/insert_file_forma t), open the file, insert malicious replicating content, close file, repeat

Viruses are probably the simplest programs short of "Hello World" and "Guess my number". Before someone says that writing viruses isn't illegal, plenty of people are trying to make it as such and they are in the same boat as these people. If something as simple as a virus isn't illegal to code when it obviously has a much more malicious intent than p2p apps do, I don't think p2p authors have anything to worry about. What are the sizes on file infectors? I recall COM file overwriting ones being well under 1K. "OMGOMG TEH MAGIC STRING OF 28 HEX CHARS MAKES ALL DIE ILEGAL MUCH!"

Is this a fucking joke??? (1)

fz00 (466988) | more than 9 years ago | (#11283349)

This is MONTHS old! Who does the screening over there?
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?