Slashdot Mirror


World's Shortest P2P App: 15 Lines

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

443 comments

  1. Reported last month by joeldixon66 · · Score: 5, Informative

    The 15 line P2P has been mentioned before 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.

    1. Re:Reported last month by Anonymous Coward · · Score: 0

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

    2. Re:Reported last month by stratjakt · · Score: 1, Troll

      It is molester.

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

      --
      I don't need no instructions to know how to rock!!!!
    3. Re:Reported last month by Anonymous Coward · · Score: 0

      quit being a prude, it is funny.

    4. Re:Reported last month by nxtr · · Score: 4, Funny

      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.

    5. Re:Reported last month by thrift24 · · Score: 5, Interesting

      Molestar uses a very loose defintion of "lines". A line in perl is ussually where the ; is, which in readable code should be at the end of the actual line. I counted 5 ;'s in the first line of Molestar with a briefscan. A brief estimation would tell us Molestar is more like 30 actuall lines. (I don't see why Molestar doesn't just claim to be one line as all of this code, could work just fine in 1 "line" as they define.) I've never used Python before, but I would imagine by looking at the code to TinyP2P that python's lines truely end at the end of the line. So as far as line count is concerned TinyP2P is around half the size as Molestar.

    6. Re:Reported last month by bmd3k · · Score: 1
      Not that this will likely justify the name to you, but he DOES give a reasonable explanation for it:

      This program is called MoleSter because it's small and furtive, like a mole, and "-ster" is a traditional suffix for filesharing programs. It rhymes with "pollster"; don't pronounce it as three syllables.

    7. Re:Reported last month by Tablizer · · Score: 1

      I see they decided to completely separate the lines-of-code contest from the readability contest.

    8. Re:Reported last month by dcarey · · Score: 2, Insightful

      The REALLY sad part is that I don't read slashdot but maybe twice a week on average and ever *I* remember the dupe story ... the link color is already darkened from where I visited precisly the same link the the very short past.

      No, I don't believe this is the "death of slashdot or anything silly like that." But it is conceivable that in that that glorious mound of slashdot web code there could be a way to check the relevant links in the current article against the laready existing articles within the past yada yada yada, such that the "TinyP2P" link would be automatically flagged since it was referenced a short while ago. That way, editors can double check for dupes. I bet you could even do it in 15 lines (har har, hardy har har, har).

      Or mebbe use teh "search feature."

      keke.

      --

      -- (Score:i , Imaginary)

    9. Re:Reported last month by Seumas · · Score: 3, Funny

      Did anyone else initially pronounce "Molestar" the same way I did, before realizing it was "molestar" as in the burrowing rodent and the heavenly object?

    10. Re:Reported last month by Anonymous Coward · · Score: 0

      Just wait til the RIAA get ahold of the author of Molester (it's Mole-ster not Mole-star)
      He's gonna feel like just like the name of his software implies!

    11. Re:Reported last month by Anonymous Coward · · Score: 0

      grand parent was wrong, it's MoleSter as in POLLSTER
      named after the napSTER tradition of adding STER to a word when naming a p2p filesharing app.
      you're also redundant

    12. Re:Reported last month by Anonymous Coward · · Score: 0

      parent's not a troll. he just doesn't like molesters.

    13. Re:Reported last month by Lehk228 · · Score: 1

      *raises hand*

      --
      Snowden and Manning are heroes.
    14. Re:Reported last month by slavemowgli · · Score: 1

      Look closely, and you'll see that every line is less than 80 characters. It's not really about newlines, it's about lines on your screen.

      --
      quidquid latine dictum sit altum videtur.
    15. Re:Reported last month by shellbeach · · Score: 4, Informative

      Molestar uses a very loose defintion of "lines" ... So as far as line count is concerned TinyP2P is around half the size as Molestar.

      No. Perhaps you should have had a look at the TinyP2P web site, which defines a line as follows: "Each line has 80 characters or fewer."

      If you really want to compare sizes though, compare the number of characters: TinyP2P has 951 non-whitespace characters; Molster has 436. And the author of Molster also makes the point that almost all the P2P work of TinyP2P is done by an external library. Have a look here for more of the author's thoughts on the matter of sizes - they're quite interesting.

    16. Re:Reported last month by AstroDrabb · · Score: 1

      No, perl doesn't care about whitespace. So you don't need to end your lines after ;. If you RTFA, you would see that the definition of a "line" in this "competition" is 80 characters. What is even more important then line count is file size. MoleSter is 466 bytes while TinyP2P is 1,072 bytes which is much bigger then MoleSter.

      --
      If Tyranny and Oppression come to this land,
      it will be in the guise of fighting a foreign enemy. -James Madison
    17. Re:Reported last month by Anonymous Coward · · Score: 0

      I have a much shorter code for windows box, I wrote this nice little smallestp2p batch file, which calls up my emule.exe in that line, if you want fancy, I can use a c++ call or make c# program to do the same thing.

    18. Re:Reported last month by Fishstick · · Score: 2, Interesting

      well, then 'lines' would be pretty meaningless as a measure of code complexity/simlicity. When I hear about how many 'lines of code', I might reasonably assume one 'statement' (whatever that is) to occupy one or more lines, not how many statements one can cram on together before a cr/lf without any whitespace within a given screen width.

      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.

      --

      There is much cruelty in the universe, John.
      Yeah, we seem to have the tour map.

    19. Re:Reported last month by BlueCodeWarrior · · Score: 3, Interesting
      To elaborate slightly, (I agree with you), ...

      ...

      ...aww hell, let's use some Perl!

      #!/usr/bin/perl

      #set your input to $_ somewhere in here

      print "omg line\n" if(/.*/);
      print "omg statement\n" while(/[^;]*;/);

      1;


      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 .* is optimized away) and 'omg statement' for each statement. A line is whatever (though usually considered less than 80 columns) up to a newline, and a statement is, well, a statement.

      You can have multiple statements on one line.
    20. Re:Reported last month by grub · · Score: 5, Funny


      Good tagline for that "New Scientist: Bringing you last weeks Register news through yesterdays Slashdot... Today!

      --
      Trolling is a art,
    21. Re:Reported last month by damiam · · Score: 1

      Actually, it's not even that. It rhymes with "pollster", so the pronounciation is more like "molsture" then "mole-star".

      --
      It's hard to be religious when certain people are never incinerated by bolts of lightning.
    22. Re:Reported last month by Punboy · · Score: 2, Informative

      Um, sorry but there are no ';' anywhere in the program. It's python, we don't need them unless we are stating multiple code "lines" in a single ASCII line. Perhaps you were referring to the commas, which were not specifying separate strings, but were instead specifying the list of modules to import. Do you not know how to read python code? Or would this seriously take one separate line for each module, thus showing Python is far superior in that aspect?

      --
      If you like what I've said here, and want to read more, go to http://www.krillrblog.com
    23. Re:Reported last month by Botty · · Score: 0

      Not to be dense, but how many apps end in -ster? Theres napster, iTunesster, Kazaaster, eDonkeyster, bittorrentster....Limewirester.... Am I missing any?

    24. Re:Reported last month by brianmed · · Score: 1

      The website states that his definition of a line is 80 characters. Since perl actually requires whitespace in some locations it takes a bit of work to get the newlines to line up correctly.

    25. Re:Reported last month by jessecurry · · Score: 1

      MICROster, Sigster, and Grokster just to name a few.

      --
      Those who know, do not speak. Those who speak, do not know. ~Lao Tzu
    26. Re:Reported last month by the+angry+liberal · · Score: 1

      Dude, you need a pill. Better yet, a girlfriend to molest.

    27. Re:Reported last month by Anonymous Coward · · Score: 0

      And your sexual fantasies must be...
      1. Molesting
      2. Molesting
      3. Molesting

      Sick.

    28. Re:Reported last month by codepunk · · Score: 1

      Hate to tell you this but if you look at the python code it is not nearly as small as it could be. I am willing to bet it could get to half it's size in characters at the cost of some readability.

      --


      Got Code?
    29. Re:Reported last month by maunleon · · Score: 4, Funny

      >> TinyP2P is done by an external library

      Yep.. here's my own implementation of Microsoft Word in one line... In C! Unfortunately it doesn't work on Linux. :(

      main() { system("msword.exe"); }

    30. Re:Reported last month by strider44 · · Score: 1

      it doesn't work with my clean XP install - oh no something's wrong with my computer!!!

    31. Re:Reported last month by pixelcort · · Score: 1

      There are no lines - only line break characters.

      Seriously, folks, count bytes, not lines.

      --
      http://pixelcort.com/
    32. Re:Reported last month by Aurix · · Score: 0, Redundant

      ...that's because you haven't installed word yet on your 'clean' install :P

    33. Re:Reported last month by aichpvee · · Score: 2, Insightful
      I know mine are!

      1. Molesting... over-18 consenting Asian girls.
      2. Molesting... over-18 consenting Asian girls in schoolgirl outfits.
      3. Molesting... over-18 consenting Asian girls dressed as Sailor Mars.

      See, now there's something EVERYONE can enjoy.

      --
      The Farewell Tour II
    34. Re:Reported last month by Prophet+of+Nixon · · Score: 1

      Wouldn't that be "winword.exe"?

    35. Re:Reported last month by ajs · · Score: 1

      Why do people bother with this kind of silliness? Really. We've all witnessed the IOCCC and various other golf-like activities for decades now, so why are we shocked that the definition of a "line of code" is different in this hobbiest sport than it is in the pointy-haired-project-planner world of the LOC?

      In code-minimization (golf) and code obfuscation passtimes, a line of code is almost always defined as any source code which is considered valid by the interpreter or compiler, and fits on a standard 80-column green-screen or vt100/ANSI-emulation.

    36. Re:Reported last month by Anonymous Coward · · Score: 0

      ditto, and I can write a c app in 1 line too == pretty silly

    37. Re:Reported last month by Geoffreyerffoeg · · Score: 1

      It doesn't work on Windows, either. Did you mean "winword.exe"? I guess I congratulate you on not using MS Word that much...or laugh at you for using menus instead of the run line, depending.

      More specifically, did you mean "start winword"? Winword is in the registry's App Paths, not in the DOS path, so you need "start" to be able to system() it.

      Oh, and it ought to work fine on Linux using system("wine winword.exe");.

    38. Re:Reported last month by Anonymous Coward · · Score: 0

      If I am not mistaked python doesn't use ';' to end a readable line. Whitespace actually means something which means that this program is truly 15 lines. Unlike a god awful 1 liner in Perl.

    39. Re:Reported last month by endx7 · · Score: 1
      That won't work.

      It'll just end up matching the same statement over and over again. An infinite number of times.

      If $_ contains any statements at all, you have an infinite loop on your hands.

      You want something more like:
      while(<>){ print "omg line\n"; print "omg statement\n" while(s/[^;]*;//); }
    40. Re:Reported last month by SmittyTheBold · · Score: 1

      Has a SourceForge project to port to Linux been started yet?

      --
      ± 29 dB
    41. Re:Reported last month by BlueCodeWarrior · · Score: 1

      Ahh. I ran it in my shell and indeed, you are correct...any way to do it without destroying the string, however? Without just making a copy and operating on that?

    42. Re:Reported last month by endx7 · · Score: 1

      Ahh. I ran it in my shell and indeed, you are correct...any way to do it without destroying the string, however? Without just making a copy and operating on that?

      Well...I've sorta done it. But the way I did it required constantly changing the regex. Something along the lines of using {} (for me to specify the length to skip) and $& (to get the length). Not that I suggest using this method, since it's supposed to be considerbly slower from using $&.

      Of course, a true perl wizard could probably do it with a single one line non-destroying non-copying regex and it'd probably look something like $_=~%s++^&@#Cxxxx#5 sded /w433{33,4,5}sss/ x2.

      Unfortunately, I'm not a true perl wizard.

  2. Repost by sriram_2001 · · Score: 0, Redundant

    This was posted to Slashdot a couple of weeks back

  3. bet i could write a 15 line by catbutt · · Score: 5, Funny

    dupe checker for slashdot

    1. Re:bet i could write a 15 line by muzzmac · · Score: 1

      I bet you can't.

    2. Re:bet i could write a 15 line by EpsCylonB · · Score: 1

      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.

    3. Re:bet i could write a 15 line by Anonymous Coward · · Score: 0

      if exist (article) then DUPE=true

    4. Re:bet i could write a 15 line by Anonymous Coward · · Score: 0

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

      abcdefghijklmnopqrstuvwxyz no yelling

    5. Re:bet i could write a 15 line by EnronHaliburton2004 · · Score: 1

      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.

    6. Re:bet i could write a 15 line by realdpk · · Score: 2, Informative

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

    7. Re:bet i could write a 15 line by EpsCylonB · · Score: 1

      Excuse me ?, are you really suggesting this is a difficult problem ?.

      In this case all the editor would have had to have done is run this slashdot like this. When I said it would be easy to automate what I meant was that every time a story is posted a search is automatically run so the editor can check if the story has already been posted.

    8. Re:bet i could write a 15 line by BlueCup · · Score: 1

      While you couldn't write a program that could tell you for sure whether or not the article is a dupe, you could have a list of articles displayed that show the same subject, (search for proper nouns, verbs, links) the only downside would be a small wait, but any decent computer could do it in a reasonable time (less than a minute?) and then if there were ones that "scored" high enough (enough matching nouns, verbs, links) then the editor would just look them over... but, no one will write it or use it so this is all pointless...

      --
      WANNAWIKI Wannawiki WannaWiki WANNAWIKI!
    9. Re:bet i could write a 15 line by Arngautr · · Score: 2

      Actually it isn't that hard, a few more than 15 but I'll bet I could do it in under 500, excluding libraries.

    10. Re:bet i could write a 15 line by gl4ss · · Score: 1

      come on, you could get good results by just checking if the links are the same...

      a checker that required human interaction would at least be easy to write, one that would check for potential dupes(seriously, do the mods even _read_ slashdot? stuff like this is easy to remember even 6 months later that you have read about it, thus it probably being a dupe, so you should check....).

      --
      world was created 5 seconds before this post as it is.
    11. Re:bet i could write a 15 line by jarich · · Score: 5, Funny
      All slashdot editors have to do is search through their archive

      Have you ever tried to find anything on /. with the built in search engine?

      Heck, for all we know, the editors ~are~ looking, but the search engine tells them it's a new article!

      It's a joke! Laugh! :)

    12. Re:bet i could write a 15 line by cuteseal · · Score: 2, Interesting

      Maybe before articles are released to the general public, it should be pre-released to a "dupe checking" circle of readers... :)

    13. Re:bet i could write a 15 line by Anonymous+Luddite · · Score: 2, Informative

      >> excluding libraries.

      There's the important part, I think. Any measure of a program's simplicity based on how many "lines" it is fails to take into account the level of abstraction the language itself provides. I mean how many instructions are called with those 15 lines?

      Simple to program != simple program

    14. Re:bet i could write a 15 line by EnronHaliburton2004 · · Score: 2, Informative

      ./ subscribers can preview articles.

      I was a subscriber at one point, and I submitted emails when I noticed a duplicate article in the queue, but the duplicate articles were rarely ever removed, and email to "daddypants" frequently bounced.

    15. Re:bet i could write a 15 line by lukewarmfusion · · Score: 2, Funny

      Yeah, and we could use a meta-dupe-checking group to ensure that the dupe-checkers were honestly and accurately checking for duplicates. And it would be a real success, just like the other checks and balances here on Slashdot!

    16. Re:bet i could write a 15 line by EnronHaliburton2004 · · Score: 1

      Right, now compare that article against all articles from the last 6 months. Make sure you check against the keywords and common synonyms of the keywords.

      The editors could do this by hand, and in this case a computer could have caught "15 lines" and "p2p" if it could figure out that those were the keywords...

      Now, why is "30 Years of Adventure: A Celebration of D&D" in the results page for "world's shortest p2p app: 15 lines" ...

    17. Re:bet i could write a 15 line by Anonymous Coward · · Score: 1, Funny

      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




      Here ya go, slash dupe-checker in around 15 lines of code:


      \ cmt {d-bank} -- text of slashdot article including subjct
      \ end inpt {d-bank} c %VAR = $SUBJ
      \ inpt DATE c %VAR = $DATE $$N-1 $$$n-365
      \ bg inpt c %VAR = $DATEn $$SUBJ {d-bank}
      \ end inpt c %VAR = $OLD {d-bank};n $$ OLD {d-bank)n-1; n-365
      \ cmt -- assumes value of 15 redundant words = redunant story, can be adjusted to taste
      \ bg inpt char = $ {d-bank} $AVG $$AVG = (n-1);(n-365) $$$ !avg \1\ !max \15\
      \ end impt $AVG $$AVG = 1 \TRUE\ $$$AVG = 1 \FALSE\
      \ pipe $1 \Story is dupe {d-bank (n-VAR1}}\ $$2 \Story is unique\ pipe end

    18. Re:bet i could write a 15 line by Anonymous Coward · · Score: 0

      Your ideas intrigue me...

    19. Re:bet i could write a 15 line by Anonymous Coward · · Score: 0

      It wouldn't have to check thousands of archives, only 3 weeks in the past, which seems to be the maximum memory span of the fucking idiots who run this site. The vast majority of the dupes posted here occur less than 7 days apart.

    20. Re:bet i could write a 15 line by EnronHaliburton2004 · · Score: 2, Funny

      ok, fine. I owe you a beer.

    21. Re:bet i could write a 15 line by Anonymous Coward · · Score: 0

      Now, why is "30 Years of Adventure: A Celebration of D&D" in the results page for "world's shortest p2p app: 15 lines" ...

      Simple.
      Because:
      1. Slashcode and its search function is retarded.
      2. The Slashdot story submitters and editors are retarded for posting that kind of "news".

    22. Re:bet i could write a 15 line by BorgCopyeditor · · Score: 4, Funny
      fails to take into account the level of abstraction the language itself provides

      Exactly. To wit:

      import java.net.p2p.*;
      class Dukester {
      ..public static void main (String[] args) throws IOException {
      ....new java.net.p2p.Client();
      ..}
      }
      Piece of cake!
      --
      Shop as usual. And avoid panic buying.
    23. Re:bet i could write a 15 line by realdpk · · Score: 1

      Who cares why? It took me ~10 seconds to read that list and see the same article context. I don't really care about articles 6 months ago. I'm pointing out that in this case, as which as probably been the case many times in the past, simply pasting the title of the article in the search box was enough to see that it was a dupe.

    24. Re:bet i could write a 15 line by Cyn · · Score: 1

      What built in search?

      Have you tried finding slashdots built in search lately? Removed due to poor mans blog DOS'ing

      --
      cyn, free software and *nix operating systems enthusiast.
    25. Re:bet i could write a 15 line by jc42 · · Score: 1

      Have you ever tried to find anything on /. with the built in search engine?

      I gave up on it long ago; I just use google. The /. search never returned anything on the topic. Often the "matches" didn't even contain any of the words that I typed.

      I wonder how they got it so wrong? Oh, well; google indexes it all.

      BTW, does anyone know what happened to the pointer to a logged-in user's personal page? It used to be at the top of the web page, but it seems to have disappeared some time in the past couple of weeks. Now, I know that it's "users.pl", but how would a new user find it?

      There seems to be some entropy hereabouts ...

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    26. Re:bet i could write a 15 line by MikeXpop · · Score: 1

      Still there for me. Perhaps you changed something in settings?

      --
      Etiquette is etiquette. He kills his mother but he can't wear grey trousers.
    27. Re:bet i could write a 15 line by Anonymous+Custard · · Score: 1

      come on, you could get good results by just checking if the links are the same...

      Wouldn't be a true slashdot script if it actually RTFA.

    28. Re:bet i could write a 15 line by Cyn · · Score: 1

      Naturally - it's back now.

      Timely as ever /. - update your damned copyright to 2005 unless you want me to steal all your regurgitated content.

      --
      cyn, free software and *nix operating systems enthusiast.
    29. Re:bet i could write a 15 line by dgatwood · · Score: 1
      Here's one in even less lines.

      #!/usr/bin/perl
      $/ = undef; $input = <STDIN>;
      print "Story is a duplicate.\n";

      Three lines. By my estimate, it's right more than 80% of the time and is O(n) on the size of the input.

      :-D

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    30. Re:bet i could write a 15 line by Anonymous Coward · · Score: 0

      With current copyright law, they have what, 10^26 years to update it before you can use the content...

    31. Re:bet i could write a 15 line by Anonymous Coward · · Score: 0

      please do

    32. Re:bet i could write a 15 line by Anonymous Coward · · Score: 0

      Why do you use input ?

      $ echo Story is a duplicate.

      It's in O(1) and as accurate as your O(n) implementation.

    33. Re:bet i could write a 15 line by zBoD · · Score: 0

      > It's a joke! Laugh! :)

      You've ruined it.

      --
      BoD
    34. Re:bet i could write a 15 line by BohKnower · · Score: 1

      I rewrote you little program with one less line: class Dukester { ..public static void main (String[] args) throws IOException { ....new java.net.p2p.Client(); ..} }

    35. Re:bet i could write a 15 line by iamwahoo2 · · Score: 1

      Clusty has a special search just for slashdot. I have been using it: http://slashdot.clusty.com/

    36. Re:bet i could write a 15 line by 1u3hr · · Score: 1
      stuff like this is easy to remember even 6 months later that you have read about it, thus it probably being a dupe, so you should check....)

      Though I do agree that it eould be trivial to automatically flag possible dupes, depending on memory isn't going to work. The editors must read dozens or maybe more submissions every day, and many of these will be dupes, so remembering you've "seen something like that before", as we humble readers do, is not going to work.

    37. Re:bet i could write a 15 line by daniil · · Score: 1

      Eh's probably reading /. in Light mode.

      --
      Man is a slave because freedom is difficult, whereas slavery is easy.
    38. Re:bet i could write a 15 line by gstoddart · · Score: 1
      dupe checker for slashdot


      Yeah, but you'd be out-done by the zero-line dup checker already in use. :-P

      --
      Lost at C:>. Found at C.
    39. Re:bet i could write a 15 line by gl4ss · · Score: 1

      I disagree, i'm on irc practically all day long when i'm at home - and there comes pretty many urls there per day.

      yet it's easy to remember if you've seen a single one of them before(for some it's easier, for some it's not though, but hey, even a moderately active irc channel would be able to do the job that they do, there's quite a few that run linkblogs with 20-30 and more links per day and yet someone always remembers a dupe pretty instantly ).

      --
      world was created 5 seconds before this post as it is.
    40. Re:bet i could write a 15 line by 1u3hr · · Score: 1
      it's easy to remember if you've seen a single one of them before

      My point was, you may well remember seeing the story or link, but it's harder to remember if it was from a submision that was rejected or one that was published. But the main issue is that you don't really have to, a simple automated search could give you a list of similar stories and 10 seconds would let a human scan through this and find almost all dupes.

  4. Perl by Anonymous Coward · · Score: 0

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

  5. Dupe. by Anonymous Coward · · Score: 0

    Thanks for playing.

  6. repost by Anonymous Coward · · Score: 0

    repost...

  7. Duplicate... by Haydn+Fenton · · Score: 1, Redundant
    1. Re:Duplicate... by Haydn+Fenton · · Score: 0, Redundant
    2. Re:Duplicate... by thhamm · · Score: 4, Funny

      your dupe post is da dupe too. ugh.

    3. Re:Duplicate... by Anonymous Coward · · Score: 0

      was intended to be funny, ah well :p

    4. Re:Duplicate... by Anonymous Coward · · Score: 0
      In Soviet Russia, article duplicates YOU!

      It's lame, true, but illustrates a serious point: If you don't enjoy seeing the same old shit again and again, then what the hell are you doing on Slashdot?

  8. Easier = should be legal? by nizo · · Score: 4, Insightful
    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.

    1. Re:Easier = should be legal? by Skepparn · · Score: 4, Insightful

      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..

      --
      ... Disclaimer: I barely know how to Read, please dont expect me to spell right!
    2. Re:Easier = should be legal? by nurb432 · · Score: 4, Insightful

      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 )..

      --
      ---- Booth was a patriot ----
    3. Re:Easier = should be legal? by JustAnotherBob · · Score: 2, Insightful

      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.

    4. Re:Easier = should be legal? by soft_guy · · Score: 1

      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.

      --
      Avoid Missing Ball for High Score
    5. Re:Easier = should be legal? by Class+Act+Dynamo · · Score: 2, Insightful

      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.

      --
      My other computer is a Jacquard loom.
    6. Re:Easier = should be legal? by R2.0 · · Score: 1

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

      --
      "As God is my witness, I thought turkeys could fly." A. Carlson
    7. Re:Easier = should be legal? by Anonymous Coward · · Score: 0

      ok, murder not legal
      but handgun not legal?

    8. Re:Easier = should be legal? by iXiXi · · Score: 1

      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.

    9. Re:Easier = should be legal? by Derekloffin · · Score: 2, Interesting
      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.

    10. Re:Easier = should be legal? by Derling+Whirvish · · Score: 1
      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?

    11. Re:Easier = should be legal? by soft_guy · · Score: 1

      I'm not saying that at all. If I were, then I'd be saying "let's ban computers".

      I strongly agree that there are some really great applications for P2P. For example, what if there was a P2P program that would help teachers trade lesson plans and teaching materials (i.e. not materials from a publisher, but materials created by a teacher who chooses to share them). I could imagine that such a system could help find lessons by subject, grade level, what text book it might supplement (or not).

      My point is not that something should be illegal or legal based on whether it is easy to do. Therefore, I think that showing that a P2P app could be written in 15 lines is kind of pointless.

      --
      Avoid Missing Ball for High Score
    12. Re:Easier = should be legal? by Anonymous Coward · · Score: 0

      Exactly. Lock picking tools are legal. Using them to gain unauthorized access is unlawful. Why can't people see the same distinctions with regards to P2P and unauthorized distribution of copyrighted material? If you start outlawing anything which could possibly be used to facilitate unlawful acts, that pretty much put us back to the stone age -- except that rocks are illegal, since they can be used to assault police officers! The real question here is whether copyright holders should have the right to lobby for criminalizing anything that they see as a potential impediment to their business model. I say no; one of the side effects of progress is that you have to constantly change your business model to reflect new market realities.

    13. Re:Easier = should be legal? by Anonymous Coward · · Score: 0

      Uhm, what exactly *are* the arguments for making crack recipes illegal? Seriously. I'd have to understand that first before answering your question.

      I really don't think *either* should be illegal.

      What Mr. Felton is pointing out is that banning P2P apps is silly because a P2P app can be implemented easily whenever needed. Because P2P is just communication between two or more parties.

    14. Re:Easier = should be legal? by Anonymous Coward · · Score: 1, Insightful

      Sure, why not? It's a thought-crime situation... you have a pipe-bomb, therefore you will try and bomb someone/someplace.

      By that logic owning a gun should also be illegal, you have it because you want to kill someone, shoot someone...

      Let's make actually doing something a crime, not doing something or making something that could be used for bad purposes. It's all tactics to supress the populace anyway... keep the militia down and exert power.

    15. Re:Easier = should be legal? by NetNifty · · Score: 1

      A peer is just a device on a network, correct? Then wouldn't a web server be one peer, and the user's computer be another, and the relationship between them would be *gasp* Peer to Peer?

      Does anybody know how aggressive this legislation is? The wikipedia article seems to give me the impression that if it can be used for copyright infringement (the CD ripping program is the given example), it would be illegal to create.

      "I heard people trade music warez on MSN messanger, Microsoft are in trouble!"

    16. Re:Easier = should be legal? by blonde+rser · · Score: 2, Insightful

      I think the point is not that it's just easier but 15 lines impies that it is very easy in which case there might be an argument for making it legal. Your example happens to be the best example I can think of. What if crack could be made with a handful of household ingredients and the method was simple enough that an average person could not only implement it but think it up. Sure crack wouldn't become any less harmful but any law against would be a joke. It would be unenforcable since anyone could make it anytime they wanted in the privacy of their own homes.

      Once something becomes that easy society needs to change its focus to how to integrate it in the least harmful way. In that world crack would become a fact of life. In this world p2p programs are.

    17. Re:Easier = should be legal? by huge+colin · · Score: 1

      I think his point was, something that you can essentially stumble across by accident and that has significant noninfringing uses should obviously be legal.

      I use the word 'obvious' very loosely, of course, because the world includes lawyers and politicians.

    18. Re:Easier = should be legal? by liangzai · · Score: 1

      Actually, using a recipe making crack with two less atoms/molecules (or two substitute atoms/molecules) is legal, since it is then no longer crack. It is a designer drug. Laws need to be precise about what to ban, otherwise they would have to ban chocolate, coffee and tea on some pretty blurred premises.

      The same holds true to software. You really can't ban an algorithm or a method, and you can't make a simple enough algorithm or method copyrightable, at least not in a democracy. With a simple recipe, every geek can make his own P2P app, substituting something in the code to make it unique to him/her, without infringing, just using public domain ideas.

      The file sharing community thus no longer needs to rely on a hefty übergeek providing them with complicated software. All that is needed is a common protocol, which can't be banned either. The **AA would have to target indivudual massive providers of illegal stuff in order to pursue their police state agenda.

    19. Re:Easier = should be legal? by suffe · · Score: 1
      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?

      Erm, I don't know. But could you publish it all the same for, erm, research reasons?
      --

      Karma: 2.71828182846 (Mostly due to small, fun pills)
    20. Re:Easier = should be legal? by Coryoth · · Score: 2, Insightful

      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?

      Probably not. Then again, if you published a simple to follow recipe for making crack using nothing but commonly available household items one would have to question the point of banning crack - giving the difficulty in enforcing such a ban. Which is the point.

      Jedidiah.

    21. Re:Easier = should be legal? by Donny+Smith · · Score: 1

      > But simply using p2p should not be illegal.

      He didn't say that.

      > Your argument is like saying crack houses are bad, so let's ban houses.

      No, his argument is that things shouldn't be allowed or disallowed based on ease of manufacture or make.

    22. Re:Easier = should be legal? by Psykosys · · Score: 1

      Two less ingredients than the standard two-ingredient recipe? If you can magick things out of thin air like that, I'd urge you to use this power for achieving world peace instead of a 5-minute high.

    23. Re:Easier = should be legal? by Ungrounded+Lightning · · Score: 2, Insightful

      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?

      Actually, yes, if the simplification of the method makes the law significantly less enforcable.

      Unenforcable laws should be removed from the books and moved from the province of laws to the province of morals. If you can't stop them when they do it, or have a good chance to catch them when they do, it's time to stop policing and start preaching voluntary behavior change.

      Leaving such laws on the books leads to selective enforcement (down the slippery slopes toward a police state and/or discrimination), massive civil disobedience, disrespect for laws in general (by both the population and the law enforcement perdonnel), more violation of IMPORTANT laws, and more strain on enforcement resources.

      The government should stick to trying to control only those things that meet three criteria:
      They CAN be controlled in a fair manner,
      the general population agrees they SHOULD be controlled, and
      the Constitution gives government the POWER to control them.

      --
      Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    24. Re:Easier = should be legal? by untaken_name · · Score: 1

      If you could make crack out of, say, milk and bread and salt, then it would be pointless to ban crack. That is, in essence, what Mr. Felton's trying to say. It isn't that his is faster or easier, it's that it's *so* fast and simple to do that concurrent development is inevitable. Hope that helps. Please note that his argument isn't predicated on the ethics of file-sharing. Also, your post seems to indicate that you don't believe there are valid reasons to make crack legal. While I don't smoke crack nor suggest that anyone else do so, there *are* perfectly valid reasons for making it legal.

    25. Re:Easier = should be legal? by mattspammail · · Score: 1

      Crack? Yeah. That's exactly the same thing. Your example is hardly practical.

      I mean C'mon. Like the FBI actually cares about crack. When was the last time you saw an article in any publication about crack?

      DRM is much more serious. It's worth more.

      --
      Now accepting PayPal donations!
    26. Re:Easier = should be legal? by yep-yep · · Score: 1

      I think your comparison is the problem. P2P apps are not the drugs but rather the packaging. A P2P app is more like the little plastic bag that drugs are distributed in, but little plastic bags are used for many other things day to day. So to compare any P2P app to crack is really unfair, sure someone can put crack in a bag, but do we stop selling sandwich baggies? The media pushes how "bad" the whole P2P thing is, could you imaging if law makers suddenly decided that because drug dealers put there drugs in "brand x" baggie, that company is held responsible.

    27. Re:Easier = should be legal? by poopdeville · · Score: 1

      Parent and Grandparent: Way to get ECHELON on us.

      --
      After all, I am strangely colored.
    28. Re:Easier = should be legal? by ski2die · · Score: 0

      This was +5 Insightful? This is fear mongering at its best. Plenty of 100% bonafide USDA-approved commercial apps use peer-to-peer technology. Nobody is talking about banning the technology. The talk is about banning the application of the technology for the purpose of violating copyright laws. If you have a problem with copyright laws, that's a separate issue. The original poster was correct in asserting that ease of implementation is a poor guide for the legal system to use in determining legality. Hell, mugging is not exactly complicated from an implementation perspective.

    29. Re:Easier = should be legal? by mrchaotica · · Score: 1

      That's the same reasoning as somebody's sig here on Slashdot: "If your law requires a police state to enforce, then your law is wrong." In society, morals are not absolute; they are determined by the majority. Any law that contradicts that fact won't last -- for example, Prohibition.

      Would a law banning P2P apps require a police state to enforce? Moreover, considering what they'd be policing, wouldn't "thought police" be an accurate description of the ones enforcing it? Do you think American citizens are that stupid and apathetic, to allow it?

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    30. Re:Easier = should be legal? by cpeterso · · Score: 1


      Actually, I think mere possession of lock picking tools is illegal in California (unless you are a licensed locksmith).

    31. Re:Easier = should be legal? by DeeBs · · Score: 1

      In a word - yes.

    32. Re:Easier = should be legal? by Deusy · · Score: 1

      Simplicity is just not a solid argument for keeping something legal though. Anyone can walk into a shop, put an item for sale in their pocket, and walk out without paying. Does that mean stealing should become legal because it's incredibly simple to do?

      I'm not condoning the INDUCE act but we, as a community, have to come up with much more robust reasoning to successfully argue against it and change the minds of the people who matter.

      --

      Free Gamer - Free games list and commentary

    33. Re:Easier = should be legal? by 91degrees · · Score: 1

      It's a pointless argument anyway. As far as I understand it, INDUCE is not intended to ban P2P itself. For example, Bittorrent is clearly useful for distributing any large file to many users. The record industry wants to ban the specific P2P apps that it believes exist only to violate copyright, such as Kazaa.

    34. Re:Easier = should be legal? by Herr_Nightingale · · Score: 1

      Excellent, as long as you can somehow upload me the newest Debian 3.0 ISO's in record time with your new crack recipe. Which is Entirely The Point - the P2P is convenient, easy to make, and has significant non-infringing uses.
      See the Sony-Betamax case for more criteria that your crack recipe doesn't make, but Felten's P2P does.

    35. Re:Easier = should be legal? by mdielmann · · Score: 1

      I think a more accurate recipe analogy for what felton is saying is if you found a recipe for making crack that was as easy as making an omlette, and had ingredients that were as common. Like other commonly available drugs, say, alcohol.

      --
      Sure I'm paranoid, but am I paranoid enough?
    36. Re:Easier = should be legal? by mwvdlee · · Score: 1

      To use your metaphore, it wouldn't be "crack" (a specific product) but rather "chemically produced substances" (the general class of products) that would be banned.

      Also, specific products such as the old Napster can already be "handled" by the current laws, so why make new laws when the problem can already be dealt with? Unless they believe the very concept of P2P infringes on their rights.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    37. Re:Easier = should be legal? by mislinux · · Score: 1

      Haha...funny anology...apparently P2P is like crack...pretty soon there will be skinny and pale geeks on the street begging for their P2P...

    38. Re:Easier = should be legal? by 1u3hr · · Score: 1
      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.

      Well, by reading TFA, one finds out that his reasoning is:

      I wrote TinyP2P to illustrate the difficulty of regulating peer-to-peer applications. Peer-to-peer apps can be very simple, and any moderately skilled programmer can write one, so attempts to ban their creation would be fruitless.
      If you want a crack analogy, it'd be something along the lines of: "You can make crack illegal, but you can't (practically) make the recipe for making it illegal". And to prove that, here is a recipe, courtesy of the DOJ
      Crack is produced by dissolving powdered cocaine in a mixture of water and ammonia or sodium bicarbonate (baking soda). The mixture is boiled until a solid substance forms. The solid is removed from the liquid, dried, and then broken into the chunks (rocks) that are sold as crack cocaine.
      (I realise that it's lacking a few, probably vital, details, but a DOJ link was hard to resist.) In case you want a practical recipe, Morgan's Crack House has:
      Ingredients:
      1-2 grams coke
      4 tablespoons baking soda
      Some bottled water
      Take a cookie sheet and sprinkle a light covering of coke on the bottom. No more than 1 - 1/2 tablespoons. Now, take 1 tablespoons or so of Baking Soda, and sprinkle it on top. Add 2 teaspoons of water evenly. Cook at 300 deg. for 15 min. Sprinkle Pot if you want to really do it up on top. Add rest of coke evenly, and 2 more tablespoons of baking soda evenly. Bake at 300 for 25-30 min. Let sit OVERNIGHT. Put in freezer 15- 20 minutes, or until hard. Crack off small peices and enjoy!
      Note that as there are only 3 ingredients, including water, it would be truly revolutionary to invent a "recipe for crack that uses 2 less ingredients".
    39. Re:Easier = should be legal? by 1u3hr · · Score: 1
      Simplicity is just not a solid argument for keeping something legal though. Anyone can walk into a shop, put an item for sale in their pocket, and walk out without paying. Does that mean stealing should become legal because it's incredibly simple to do?

      No, but the outline of a simple plan to do so, as you did, should not be. And if anyone had RTFA, they'd know Felton was not talking about the legality of using P2P, but of the writing of apps to do so. Since just about any app that is capable of networking could be used to do P2P with greater or less convenience, there is really no sensible way to ban "P2P apps" and have an Internet at all.

    40. Re:Easier = should be legal? by Anonymous Coward · · Score: 0

      I think you're confusing the two very different things. Using your crack analogy, a P2P application is more similar to the equipment or method used to produce the crack, not the crack itself. The difference is important.

      It's like saying that crack could be made from sugar and milk. You would not change the laws to make crack legal, but you also would not create laws to make sugar and milk illegal.

      The point is that a P2P application can easily be produced by anyone, anywhere, with minimal effort, and at a moment's notice from many high-level languages. Therefore, short of making all high-level languages illegal there is really no way to make P2P applications illegal. What's more you wouldn't want to because what you're really trying to stop is illegal file sharing. Illegal file sharing and crack are the similar end products in this analogy. And like crack, illegal file sharing is already illegal, but they don't know how to stop it.

      p.s. I'd love to see a version of this in Microsoft's .net C#, or however that language is referred to. Then you're faced with the prospect of making illegal, the product of a large political contributor.

    41. Re:Easier = should be legal? by Dr.+GeneMachine · · Score: 1
      So that sinister looking guy with the suitcase nuke in his hotel room should go unpunished? Hey, let him keep the thing - he showed no intention to use it! After all, it would be a thoughtcrime situation if we took it from him, before we actually caught him setting the timer! Suppressing the populace, that, keeping the milita down...

      Come on, guys... I don't want to hijack this thread into a possession of handguns - flamewar, but there are obviously more levels to this than simple black and white. Perhaps it's just me, but I for one recognize the right and the duty of the government to actually do something for the prevention of crime.

      --
      This comment does not exist.
    42. Re:Easier = should be legal? by soft_guy · · Score: 1

      Client to Server is, by definition, not Peer to Peer.

      --
      Avoid Missing Ball for High Score
  9. Libraries by flossie · · Score: 2, Insightful
    import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac

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

    1. Re:Libraries by LnxAddct · · Score: 5, Insightful

      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

    2. Re:Libraries by flossie · · Score: 4, Insightful
      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.

    3. Re:Libraries by Anonymous Coward · · Score: 0

      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

    4. Re:Libraries by Neil+Blender · · Score: 2, Funny

      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.

    5. Re: Libraries by dubhead · · Score: 1, Informative

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

    6. Re:Libraries by flossie · · Score: 1
      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 ...

    7. Re:Libraries by Anonymous Coward · · Score: 1

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

      <wakes up> <rubs eyes> :Thank God I live in the world with zinc!

    8. Re:Libraries by nr · · Score: 1

      Yes, the wonderful world of component/object (RAD) based development. Nowadays creating a embedded webserver or ftpserver is just a matter of calling an class/object/library, like:

      httpd myServer = httpd(80)
      myServer.start();

      Easily done in C and C++ too, libhttpd.so, etc. Look at all the good stuff included in the GNOME and KDE environments. No reason to reinvent the wheel if you dont need to.

    9. Re:Libraries by Anonymous Coward · · Score: 0

      Thanks! Now we know which libraries to ban!!!!

      Best,

      RIAA

    10. Re:Libraries by anakin876 · · Score: 1

      Iron ore? where? Must find Ore! Never mind the giant beast waiting to slay my party members, never mind the cliff I just fell off. I MUST have that iron!

    11. Re:Libraries by lux55 · · Score: 1

      Here's one that avoids them, even shorter too:

      http://ansuz.sooke.bc.ca/software/molester/

    12. Re:Libraries by Thing+1 · · Score: 1
      Even assembler pneumonics obsfuscate the inner workings through abstraction.

      Heh, hydraulic assemblers...

      --
      I feel fantastic, and I'm still alive.
    13. Re:Libraries by Anonymous Coward · · Score: 0

      +1 coding with python

    14. Re:Libraries by Anonymous Coward · · Score: 0

      This old-timey school-movie joke also applies to sand if you recall the episode with Bart going to military school.

      "So the next time you're walking on the beach, enjoying an hourglass, or
      making cheap, low-grade windshields, think where we'd be without sand!"

    15. Re:Libraries by syukton · · Score: 3, Interesting

      In writing a hello world program, all you need is direct access to the framebuffer, which any language worth its salt will provide. Regarding your "thousands of drivers" remark, again, you don't really need all this: just the framebuffer and a screen. You don't need sound or floating point support, just you and the framebuffer. I know you were being a smartass, but everything you need for "Hello World" is in the BIOS, from the character set to interfacing with the framebuffer, and "Hello World" can be accomplished but a few dozen more bytes than there are in the string "Hello World."

      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
      It 's a flythrough of the first level of Descent (remember Descent?) in 4096 bytes, including a MIDI soundtrack. Not 4096k, but 4096 bytes, or 4 kilobytes. 4k. Four K!

      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.

      --
      Reinvent the wheel only at either a lower cost, greater effectiveness, or your own personal enrichment and satisfaction.
    16. Re:Libraries by Anonymous Coward · · Score: 0

      Even the license links to the law library at Dewy, Cheatum, and Howel.

    17. Re:Libraries by XxXoldsaltXxX · · Score: 0

      now is that pronounced "mole-ster" or "mo-les-ter"

    18. Re:Libraries by retro128 · · Score: 1

      Yes, but why reinvent the wheel? I don't think a program exists that is not written using common libraries or APIs made available by the host OS. A programmer trying to avoid using such things would have to be some sort of masochist.

      --
      -R
    19. Re:Libraries by adeydas · · Score: 1

      But that won't be a problem, if there is Python there are libraries.

    20. Re:Libraries by fyngyrz · · Score: 1

      000: Actual value of total "beast" concept convolved with intelligence

      --
      I've fallen off your lawn, and I can't get up.
    21. Re:Libraries by Anonymous Coward · · Score: 0

      That would only be a good example if the P2P code was something like:

      import p2p
      p2p.startP2P()

      This is using multiple libraries to make a program, which is the basis of modern programming.

    22. Re:Libraries by yRabbit · · Score: 1

      Awesome.. :)
      This reminds me of kkrieger, a beta first person shooter in 96k (requiring 512MB ram, 1.5ghz processor, um, DirectX 9.0b)

    23. Re:Libraries by Anonymous Coward · · Score: 0

      I'm sorry but that would be a really bad idea.
      Sure you might get a smalle foorprint, but lazy developers aren't the only reason for shared libraries. What if a large flaw is found in some technique which is often used. If the code is only found in a few shared libraries it's much easier to fix than if every single program needs to be rewritten in part!
      E.g.using assembler it's easy to get small footprints, but it's a lot harder to get good security and stability. There's always a tradeoff.

    24. Re:Libraries by frankvl · · Score: 1

      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

      You don't need thousands of drivers; there is a 'println' in the bios which can be called using 2 bytes, so even if you would have no OS (which you don't need because you don't use concurrency or resource management), a hello world program would still consist of a few dozen bytes.

      However, sharing or re-using code should become common practise, because it hardly is.

    25. Re:Libraries by julesh · · Score: 1

      Note that the only libraries used by this program are general purpose networking libraries that weren't written with the intention of allowing P2P apps to be written using them. They provide standard functions similar to features available in most modern languages (e.g. Java's RMI, several competing implementations for Perl, etc.).

      Your analogy would only be accurate if writing P2P apps was the primary intention behind these libraries, or at least one of the considerations that was born in mind when they were being designed, but all they are is simple, application-independent network abstraction layers.

    26. Re:Libraries by Anonymous Coward · · Score: 0

      OMG you cheater! You're using the bios for your hello world program, even though you didn't write the bios!!! Your hello world program must interact only with the hardware, and you have to make your own hardware too, since existing hardware already has logic and algorithms developed by others. And no cheating and looking up how digital logic works, or using any math that you were taught, you have to create that from scratch too. Plus, your hardware must be made from stuff you collected outside your cave. Only then will it be a hello world program from scratch.

    27. Re:Libraries by MAdMaxOr · · Score: 1

      > that doesn't mean that FFT is trivial. Actually, common FFT implementations in C are ~30 lines long. You could definitely make that 10-15 lines of Python, but it'd be slow.

  10. Subscribers: by johnny_sas · · Score: 0, Flamebait
    I bet you're really glad to be the firsts to see this.... REPOST!!!!

  11. deja vu by tomcio · · Score: 0

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

  12. Speaking of dupes... by thesatch · · Score: 1

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

    1. Re:Speaking of dupes... by Anonymous Coward · · Score: 2, Funny

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

    2. Re:Speaking of dupes... by Anonymous Coward · · Score: 0

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

    3. Re:Speaking of dupes... by Anonymous Coward · · Score: 0

      I c4n't wait for all teh dup3 posts in this story.

  13. P2P by tuxter · · Score: 3, Insightful

    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.

    1. Re:P2P by Anonymous Coward · · Score: 0

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

    2. Re:P2P by tuxter · · Score: 1

      Just like making copying copyrighted works illegal... that worked didn't it.

    3. Re:P2P by trewornan · · Score: 1

      They're going to ban Microsoft's SMB networking then are they?

  14. Why TinyP2P when you have MoleSter by OverlordQ · · Score: 2, Interesting
    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
    --
    Your hair look like poop, Bob! - Wanker.
    1. Re:Why TinyP2P when you have MoleSter by Anonymous Coward · · Score: 1, Funny

      Oh Please.

      Perl is Barbaric.

      People who use Perl are Barbarians.

    2. Re:Why TinyP2P when you have MoleSter by Anonymous Coward · · Score: 0

      RRRRRR!! Thag declare hashtable!

    3. Re:Why TinyP2P when you have MoleSter by JoshRosenbaum · · Score: 1

      Ohh! So that explains why I clubbed that woman over the head and brought her to my computer cave! Maybe I'd better switch to Python, since it's the new buzz word and all the sophisticated people use it. ;) -- Josh

  15. I can do better by krbvroc1 · · Score: 5, Funny

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

    1. Re:I can do better by MrWa · · Score: 1
      Maybe you should have tried "wget -h" first

      Doesn't

      wget -r http://localhost/warez/
      do the same thing - without using goto?
  16. Rerunning stories?? by E+IS+mC(Square) · · Score: 1

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

  17. Thank god! by ozric99 · · Score: 2, Funny

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

    1. Re:Thank god! by thryllkill · · Score: 1

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

      --

      Note to self: No more arguing with the faithful.

    2. Re:Thank god! by ozric99 · · Score: 1

      You don't say...

    3. Re:Thank god! by Anonymous Coward · · Score: 0

      It's true... I've been there, and it was good.

  18. 1 line? by Nightreaver · · Score: 1

    Øøø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...

    1. Re:1 line? by Knights+who+say+'INT · · Score: 1

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

    2. Re:1 line? by prodangle · · Score: 5, Funny

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

    3. Re:1 line? by Anonymous Coward · · Score: 0

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

    4. Re:1 line? by Saint+Aardvark · · Score: 3, Funny
      I can do better than that:

      $ su root -c "echo '/ (ro,insecure,root_squash)' > /etc/exports && exportfs -a && iptables -P INPUT ACCEPT && iptables -P OUTPUT ACCEPT"
    5. Re:1 line? by glassesmonkey · · Score: 4, Funny

      I thought all you had to do was install Windows unpatched and it became it's own P2P program sharing worms & the such with clients all around the world.

    6. Re:1 line? by Anonymous Coward · · Score: 1, Informative

      Not really. I don't want to be an ass, but Python does have the semicolon; it's just only needed when you explictly want to do more than one statement in a line (like Visual Basic has the ":" separator).

      You're right in a thing: TinyP2P does not use any semicolons, but it's still hard to define how many lines exactly it has. Lines 11-13 represent a single line (which was split to conform to the 80-characters-per-line limit), yet it abuses so much of functional programming and multiple variable assignment that I wouldn't say it's a single line (in the sense of a line being a single instruction with one or more auxiliar operations).

      For instance, "x, y = 1, 2" defines two variables at the same time. In standard algorithmic notation (aswell as in most languages), this would be two lines, but Python has a special syntax to do two things practically at the same time. Should we still count that as a single line?

      Then there's the 11-13 combo, where three lines represent what would normally be two (as "def aug(u):" should be in a separate line from the rest), and create a lambda function inside the aug function while using the list comprehension syntatic sugar to fit a whole loop (which would normally be a couple lines long) into that single return instruction.

      IMO the line counting in this code is just bullshit; Python has too many shortcuts to strive from the standard algorithmic code line, making the competition unfair. And if we get into bytes used, Python is too verbose (as for the logical operators which use keywords instead of symbols and the need of whitespace) to compete with Perl and other more compact languages.

    7. Re:1 line? by Jugalator · · Score: 1

      Yes, but that's way above 15 lines large. :-)

      --
      Beware: In C++, your friends can see your privates!
  19. Instead of talking about the repost by ian+rogers · · Score: 2, Funny

    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.

    1. Re:Instead of talking about the repost by Tangwei · · Score: 0

      Wouldn't that filter your post out?

    2. Re:Instead of talking about the repost by mangee · · Score: 1
      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.

      Because:

      1. 20% of slashdot would complain - because they hadn't read the first one.
      2. Mod -10: D'uh. is more fun
      3. We'd get 300 posts "I could do it in less lines"
      4. ...
  20. How does this prove anything? by nt7s · · Score: 3, Insightful

    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.

    1. Re:How does this prove anything? by anum · · Score: 4, Insightful

      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!

      --
      I don't think, Therefore I'm not.
    2. Re:How does this prove anything? by TeraCo · · Score: 1
      That's quite a good analogy actually!

      And believe me, there is nothing I like more than pointing out flaws in poorly designed analogies.

      --
      Not Meta-modding due to apathy.
    3. Re:How does this prove anything? by BobPaul · · Score: 2, Informative

      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.

      And then as soon as they start gunning for your program, 30 others will pop up and at least 5 of them will become just as popular as yours was, thus making it pointless to have gunned down the initial program; you just made the problem worse.

      Quoting the author of TinyP2P
      "P2P can be simple and written very quickly, so to try to ban or prevent the technology is not feasible."

    4. Re:How does this prove anything? by Coryoth · · Score: 2, Informative

      Does anyone want to enlighten me as to how a 15 line P2P app means that it is pointless and silly to ban them?

      The point is that a ban would be ridiculously hard to enforce as pretty much anyone could write a new P2P app, which could quickly rise to popularity. You'd be fighting an endless battle with no hop of victory unless you start putting serious restrictions on compilers etc. at which stage... well...

      Jedidiah.

  21. Heh.. by Anonymous Coward · · Score: 0

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

    1. Re:Heh.. by Anonymous Coward · · Score: 0

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

  22. Something else new by MrLint · · Score: 1

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

    I apologize for blatant whoring.

  23. "dupe" by KingDoubt · · Score: 0, Redundant

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

    1. Re:"dupe" by Anonymous Coward · · Score: 0

      no you're not. your dupe dupe post is a dupe.

    2. Re:"dupe" by mangee · · Score: 1

      must be.. the rest of them think they are "redundant" and "informative" and "funny"

    3. Re:"dupe" by idlemachine · · Score: 1

      No, so now we're getting dupe dupe dupes.

    4. Re:"dupe" by Anonymous Coward · · Score: 0

      i posted that half an hour ago

      you know what's coming don't you?

      that was a dupe dupe dupe dupe

    5. Re:"dupe" by Anonymous Coward · · Score: 0

      dupe dupe dupe dupe

      goose

    6. Re:"dupe" by MrRTFM · · Score: 1

      This week... Rob Schneider is the carrrot.
      Coming next...

      Rob Schneider is dupe-de-dupe-dupe-do-do-dupe
      (Cant remember where I saw this but it was pretty funny)

      --
      You can't expect to wield supreme executive power, just because some watery tart threw a sword at you
    7. Re:"dupe" by Anonymous Coward · · Score: 0

      This week... Rob Schneider is the carrrot.
      Coming next...

      Rob Schneider is dupe-de-dupe-dupe-do-do-dupe
      (Cant remember where I saw this but it was pretty funny)


      yea, that was from south park.

  24. Eh? by ZSpade · · Score: 4, Insightful

    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.

    --
    Go ahead and call me unreliable; reliable is just a synonym for predictable.
    1. Re:Eh? by the+pickle · · Score: 1

      The difference being, as several others have pointed out, that meth is harmful, and P2P is not, unless its users CHOOSE to break the law.

      It's about like the gun analogy. P2P doesn't violate copyright. People with P2P apps violate copyright. Just because something CAN be used to break the law doesn't mean it WILL be, and should therefore be banned.

      p

    2. Re:Eh? by ZSpade · · Score: 1

      A valid point. Than again, I never said I was a proponent for the anti-p2p movement. Kinda preaching to the Choir here. Though I imagine that all of slashdot is pretty much the Choir in this case...

      --
      Go ahead and call me unreliable; reliable is just a synonym for predictable.
    3. Re:Eh? by Thing+1 · · Score: 2, Interesting
      Meth is simple to make, but I don't see anyone using that as excuse to make it legal.

      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).

      --
      I feel fantastic, and I'm still alive.
    4. Re:Eh? by Thing+1 · · Score: 1
      Actually, at the risk of being pedantic:

      meth is harmful, and P2P is not

      Both meth and P2P are equally harmful when laying dormant. Just because I make a P2P app, or methamphetamine, doesn't mean I'm going to use it to break the law. (Well, the law is "possession" of a substance == go directly to jail, but that's just an insidious way of controlling the populace by planting evidence.)

      I could be doing chemistry experiments, and just seeing if I have the skills/ability to make a particular substance. Just like Bram Cohen made BitTorrent for Linux ISOs, and does not infringe on copyright.

      --
      I feel fantastic, and I'm still alive.
    5. Re:Eh? by the+pickle · · Score: 1

      Aright, maybe I wasn't clear... ;)

      *Using* meth is inherently harmful.

      Using P2P is not.

      That better? :)

      p

    6. Re:Eh? by RexRhino · · Score: 2, Interesting

      How easy it is to break the law has a lot to do with should a law be passed. What happens if the government decided to ban oral sex? It wouldn't be very effective, unless the government decided to put cameras in everyones bedroom, and that would cost billions.

      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.

    7. Re:Eh? by recursiv · · Score: 1

      By using, I assume you mean using as a drug. I'm sure it has other uses too, though I don't know what. I'm sure it reacts with some chemicals or some fancy science crap.

      So I don't know my science, but the point is that meth could theoretically have "non-infringing" uses.

      --
      I used to bulls-eye womp-rats in my pants
    8. Re:Eh? by m50d · · Score: 1

      The point is that banning the *technology* is impossible and silly. Like how Meth being simple to make means it's stupid to try and ban "Meth-making equippment". Which is what INDUCE act is trying to do.

      --
      I am trolling
    9. Re:Eh? by the+pickle · · Score: 1

      The difference here -- and I'm speaking as a chemist who knows what he's talking about -- is that the non-infringing uses of P2P software are legion, and the medical and industrial uses of meth are virtually nil.

      Controlled Substances Act information for further perusal, in case you're interested.

      p

  25. Another Record also broken by Prince+Vegeta+SSJ4 · · Score: 1

    Shortest Time To Cease & Desist letter

  26. Shortest lawsuit... by dogmatixpsych · · Score: 2, Funny

    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.

    1. Re:Shortest lawsuit... by ColaMan · · Score: 1

      ...world's shortest lawsuit.
      and it still will be 15 pages of double-spaced type :-)

      --

      You are in a twisty maze of processor lines, all alike.
      There is a lot of hype here.
    2. Re:Shortest lawsuit... by Anonymous Coward · · Score: 0

      I know you're joking, but check out this article from The Morning News under the lawyers section. Lawyers often work very hard to give the IMPRESSION of simplicity.

  27. how come no one by geekoid · · Score: 2, Funny

    has mentioned that this story is a dupe?

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    1. Re:how come no one by Anonymous Coward · · Score: 0

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

    2. Re:how come no one by klang · · Score: 1

      Nobody reads the refered articles anyway, so what is this dupe you are talking about?

  28. whatever... by Moustache+N+Tits · · Score: 0

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

    1. Re:whatever... by Anonymous Coward · · Score: 0

      How old are you, anyway?

  29. Re:Dupe by Anonymous Coward · · Score: 0

    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.

  30. Python? by Psychor · · Score: 4, Funny

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

    1. Re:Python? by mr_z_beeblebrox · · Score: 1

      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 ;-)

    2. Re:Python? by Doppler00 · · Score: 2, Insightful

      This is the ugliest, hardest to read python code I've ever seen. How can someone abuse such a wonderful language like this?

      My guess is that most of the functionality of the code is in the standard libraries imported at the begining: SimpleXMLRPCServer, xmlrpclib

      They could have just as well imported "p2p_lib" if such a thing existed.

    3. Re:Python? by tepples · · Score: 2, Informative

      The point was to show how easily something of dubious legality can be made from parts considered legitimate, that SimpleXMLRPCServer and xmlrpclib are 15 lines away from actually being p2p_lib, so if legislators wanted to ban p2p_lib, they'd have to ban SimpleXMLRPCServer and xmlrpclib too. MoleSter goes even deeper, threatening that the Perl interpreter is under half a kilobyte away from being a P2P app as well.

    4. Re:Python? by bill_mcgonigle · · Score: 1

      How can someone abuse such a wonderful language like this?

      Crikey, next thing you know they'll be adding sigils like $ and @ to Python!

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    5. Re:Python? by Doppler00 · · Score: 1

      I never liked that they did that with the @ symbol. They could have just as easily made a keyword instead of adding an ugly symbol.

  31. You know it's Slashdot... by Anonymous Coward · · Score: 0

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

  32. FIRST POST!!! by Anonymous Coward · · Score: 0

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

  33. The Dr. Said it best by OverlordQ · · Score: 1
    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.
    --
    Your hair look like poop, Bob! - Wanker.
  34. repost comments! by Anonymous Coward · · Score: 5, Funny

    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

    1. Re:repost comments! by JoshRosenbaum · · Score: 1

      Dang this was a long post! I mean seriously, your post is longer than the amount of code it takes to write a p2p program. ;) Next time put some separators in so I can read the posts easier, or post them in Perl/Python using some libraries. ;)

      Thanks,

      -- Josh

    2. Re:repost comments! by hkb · · Score: 2, Funny

      Always the hacker, I've ported your 2 line Perl program to sh:

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

      You'll notice that it weighs in at significantly fewer bytes than your original Perl program.

      --
      /* Moderating all non-anonymous trolls up since 2004 */
    3. Re:repost comments! by hkb · · Score: 2, Funny

      Version 2.0:

      #!/bin/sh
      wget http://tinyurl.com/3t8mj

      --
      /* Moderating all non-anonymous trolls up since 2004 */
    4. Re:repost comments! by m50d · · Score: 1
      There goes my argument that Python promotes readable code....

      Try comparing it to the 6 line perl one others have posted though. I think it does show Python is more readable, and not good for being really small. But I think it's better to sacrifice compactness for readability.

      --
      I am trolling
  35. Faulty logic by Junior+J.+Junior+III · · Score: 1

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

    --
    You see? You see? Your stupid minds! Stupid! Stupid!
    1. Re:Faulty logic by Anonymous Coward · · Score: 0

      Heh. Nice. Wish I had mod points.

    2. Re:Faulty logic by Anonymous Coward · · Score: 0

      no it doesn't, but, by your logic, we should then make guns illegal, cuz it's so simple to kill with them.

    3. Re:Faulty logic by Junior+J.+Junior+III · · Score: 1

      It's not my logic... but anyway, the *AA's are objecting to piracy/copyright violation/unauthorized distribution. If p2p doesn't get used for those purposes, they would have no leg to stand on.

      --
      You see? You see? Your stupid minds! Stupid! Stupid!
    4. Re:Faulty logic by archen · · Score: 1

      You can kill someone with a screwdriver. It doesn't make a murder law silly, but it does make it silly to ban screw drivers.

    5. Re:Faulty logic by Anonymous Coward · · Score: 0

      It's only murder if you don't do it for the government. Otherwise it's called capital punishment.

    6. Re:Faulty logic by ricuse7 · · Score: 1

      How about Shutting down all Networks? Aren't they all P2P too?

  36. Easy to write therefore ridiculous to ban? by maynard · · Score: 4, Insightful

    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

    1. Re:Easy to write therefore ridiculous to ban? by Herkum01 · · Score: 1

      The logic is more along the lines of the government attempting to ban salt. You really cannot ban something that is totally beyond your ability to control.

    2. Re:Easy to write therefore ridiculous to ban? by Anonymous Coward · · Score: 0

      Sure it does.

      Law enforcement has far more pressing needs, such as threats to life and real property, that it more rightly should concern itself with.

      We tilt at the windmill that is the alleged loss of the RIAA of "millions" of dollars of revenue a day, yet very many high level corporate fraudsters (Ken Lay, Bernie Ebersole, Jeff Skilling, et al) still have yet to even be charged with a crime, and they ran multi-billion dollar companies into the ground, while cashing themselves out while the going was good.

      Or, why not instead spend more effort at trying to identify and punish "phishers" and other identity theft issues?

    3. Re:Easy to write therefore ridiculous to ban? by eluusive · · Score: 1

      And it's not as if a government hasn't tried to ban salt before........ Silly British.

    4. Re:Easy to write therefore ridiculous to ban? by mrogers · · Score: 1
      You really cannot ban something that is totally beyond your ability to control.

      Yes you can, and your friends can sell a lot of guns and helicopters to South American governments as a result. You might even get an excuse to expand your power at home and abroad and a lucrative source of funding for your intelligence services. ;-)

    5. Re:Easy to write therefore ridiculous to ban? by cballowe · · Score: 1

      I'd argue that writing a virus or trojan in a lab setting shouldn't be illegal - neither should posting the code publically for other researchers. On the other hand, compiling and releasing a trojan in the real world such that it actually impacts people is a completely different issue. The virus and trojan and worm and other malware do have their place in research. Understanding the techniques that allow them to spread rapidly and effectively also helps improve the understanding of how to design systems to protect against those same techniques.

    6. Re:Easy to write therefore ridiculous to ban? by biryokumaru · · Score: 1

      ya, i agree, its pretty damn easy to take an axe from the hardware store and just start chpping up ppl.

      --
      When you're afraid to download music illegally in your own home, then the terrorists have won!
    7. Re:Easy to write therefore ridiculous to ban? by mark-t · · Score: 2, Insightful
      A virus is a program that is presumably unwanted by its recipient. A P2P program is unwanted by a small but wealthly and potentially controlling segment of our society that doesn't want _anyone_ to have them.

      Further, you might note that it's not a crime to teach someone how to write a virus, or even a crime to give people virus code, it is only criminal when the recipients of the virus are unwilling to receive it.

    8. Re:Easy to write therefore ridiculous to ban? by danila · · Score: 1

      The logic of legislators is different. They are not saying P2P is evil (like viruses), so they should be banned. They are saying P2P can be a great technology, but used predominantly for illegal activities and this harms the economy, so it makes sense to protect the economy by banning P2P.

      Viruses, spam and heroin are things that are clearly bad and so there is no reason for them to remain legal. You can ban them even if you are sure the ban will be wholly ineffective. Even if it stops 5% of cases it's still worth it. But to ban something, which is not inherently bad, you need some proof that the ban would actually help. To ban smoking, violent games or P2P you need very clear "bulletproof" proof that it would provide significant benefits. And if we can show that banning P2P would not help get rid of P2P programs, the benefits of the ban are no longer obvious.

      --
      Future Wiki -- If you don't think about the future, you cannot have one.
    9. Re:Easy to write therefore ridiculous to ban? by mdielmann · · Score: 1

      The theory here is similar to trying to ban rocks and pointy sticks because you could hurt someone with them. Rather, we prosecute those who do. This is also the case with viruses. I can write one right now, test it on my network at home, even publish some exploit details (think computer security company), and I haven't broken a law. Release it into the wild, though... Mr. Felton is trying to point out that the main components are so ubiqitous that trying to ban an ordered compilation of these components is foolish.

      --
      Sure I'm paranoid, but am I paranoid enough?
  37. 466 bytes by Anonymous Coward · · 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/

  38. Silly by Reality+Master+101 · · Score: 1
    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.

    --
    Sometimes it's best to just let stupid people be stupid.
    1. Re:Silly by Anonymous Coward · · Score: 0

      Hey, I like Harry Potter, but the webmaster of your posted link needs to get a fucking clue!

    2. Re:Silly by mcleodnine · · Score: 1

      Comparing p2p applications with sawed-off shotguns and virus code?

      Why not just ban TCP/IP networking, and IPX (just in case)?

      The application is not the problem. Jackasses trading in copyrighted material is. Get over it.

      --
      one better than mcleodeight
    3. Re:Silly by IdntUnknwn · · Score: 1

      The point isn't that it shouldn't be illegal. The point is that its incredibly difficult to enforce a ban on it, and so banning it would be a waste of effort.

  39. dupe checker in shorter by Anonymous Coward · · Score: 0

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

    http://www.immigrantornot.com/

  40. Pete by Anonymous Coward · · Score: 0

    and Repeat...

  41. A more legible version of tinyp2p.py by dstone · · Score: 4, Informative
    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"))
    1. Re:A more legible version of tinyp2p.py by Anonymous Coward · · Score: 0

      How did you get this to display properly? Every time I try to include code into a post the indentation is always removed, even though I'm using the ecode tag like the comment page says.

    2. Re:A more legible version of tinyp2p.py by jc42 · · Score: 1

      Hey, that's cheating! It's comprehensible now.

      When I looked at the code, my first thought was to wonder whether it was an entry in the next Obfuscated Python Contest. If not, it should be.

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  42. No... by Mitchell+Mebane · · Score: 1

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

    --

    The roots of education are bitter, but the fruit is sweet.
    --Aristotle
    1. Re:No... by Anonymous Coward · · Score: 0

      Incidentally, with the previous color scheme it was called the "SlashTorment" network.

  43. # lines isn't important.. by dustinbarbour · · Score: 2, Insightful

    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.

    1. Re:# lines isn't important.. by bill_mcgonigle · · Score: 1

      In these parts we use 80-character lines.

      15 lines is shorthand for roughly 15*80 bytes.

      Yes, we only understand ASCII.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    2. Re:# lines isn't important.. by entrigant · · Score: 1

      Seems rather self evident to me that this isn't about size. It's an indication of simplicity.

  44. Re:eph pee by Anonymous Coward · · Score: 0

    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.

  45. Where's my T-shirt? by Anonymous Coward · · Score: 1, Funny

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

  46. Your faulty logic by Anonymous Coward · · Score: 0

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

    1. Re:Your faulty logic by Junior+J.+Junior+III · · Score: 1

      Note that I'm not against p2p apps, I'm just saying this argument of simplicity is no justification.

      --
      You see? You see? Your stupid minds! Stupid! Stupid!
  47. Reminds me of a much simpler day on the web by MerlynEmrys67 · · Score: 1
    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 have mod points and I am not afraid to use them
    1. Re:Reminds me of a much simpler day on the web by Nasarius · · Score: 1

      Of course. There are plenty of embedded OSes with low requirements. I'm pretty sure even uClinux can fit into less than 1MB of RAM.

      --
      LOAD "SIG",8,1
  48. I don't want to brag but... by revery · · Score: 4, Funny

    I wrote a 2 line p2p app in python:

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

    dependent libraries? what dependent libraries?!

    1. Re:I don't want to brag but... by slittle · · Score: 1

      Python can handle semicolon line breaks. Observe:

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

      One line.

      --
      Opportunity knocks. Karma hunts you down.
    2. Re:I don't want to brag but... by revery · · Score: 1

      HITCHHIKER : You heard of this thing, the 2 line p2p app?
      TED : Yeah, sure, the 2 line p2p app. Yeah, the file sharing thingie.
      HITCHHIKER : Yeah well, this is gonna blow that right out of the water. Listen to this: 1...line... P2P app.
      TED : Right. Yes. OK, all right. I see where you're going.
      HITCHHIKER : Think about it. You log onto slashdot, and you see the 2 line p2p app sittin' there waitin to be downloaded, and there's the 1 line p2p app right beside it. Which one are you gonna pick, man?
      TED : I would go for the 1.
      HITCHHIKER : Bingo, man, bingo. 1 line p2p app. And we guarantee just as good a download as the 2 line folk.
      TED : You guarantee it? That's -- how do you do that?
      HITCHHIKER : If you're not happy with the first line, we're gonna send you the second line for free. You see? That's it. That's our motto. That's where we're comin' from. That's from "A" to "B".
      TED : That's right. That's -- that's good. That's good. Unless, of course, somebody comes up with the 0 line p2p app. Then you're in trouble, huh?
      [Hitchhiker convulses]
      HITCHHIKER : No! No, no, not 0! I said 1. Nobody's comin' up with 0. Who can write code in 0 lines? You can't even type an umlaut on 0 lines.

    3. Re:I don't want to brag but... by Anonymous Coward · · Score: 0

      Traceback (most recent call last):
      File "p2p.py", line 2, in ?
      modified_tinyp2p(sys.argv[1])
      TypeError: 'module' object is not callable

      Since people are getting pissy about combining multiple Python statements into a single line, here's a single-statement equivalent:
      __import__('modified_tinyp2p').run(__ import__('sys ').argv[1])

      Yes, I really am that bored.

  49. Interpreted. Yar! by Anonymous Coward · · Score: 0

    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!"

  50. Is this a fucking joke??? by fz00 · · Score: 1

    This is MONTHS old! Who does the screening over there?

    1. Re:Is this a fucking joke??? by mangee · · Score: 1

      over here we read the title, and don't click ;)

  51. old news by Anonymous Coward · · Score: 0

    this was posted like 2 weeks ago

  52. p2p/drugs analogy by __aailob1448 · · Score: 1

    and thus banning them (a la the INDUCE Act) is pointless and silly.

    By this reasoning, you could also argue that manufacturing illegal drugs is also too easy and outlawing them is pointless and silly. Oh wait..it is :p

    1. Re:p2p/drugs analogy by myowntrueself · · Score: 1

      Only things which are difficult should be illegal; like getting along with ones inlaws.

      --
      In the free world the media isn't government run; the government is media run.
    2. Re:p2p/drugs analogy by grozzie2 · · Score: 1
      A p2p app is a tool, which has multiple uses. Maybe one use should be banned, but there are plenty of uses for which its perfectly acceptable.

      By your logic, not only would manufacturing illegal drugs be illegal, but so would the manufacture of any of the materials (hoses, buckets, beakers, stoves) used in the process of makeing the illegal drugs.

    3. Re:p2p/drugs analogy by __aailob1448 · · Score: 1

      You're wrong. See, you made the assumption that I was trying to make a reasoned argument. I just wanted to make fun of drug laws.

  53. 2 lines? by comwiz56 · · Score: 1
    if(story.isDupe())
    story.post();
    hows that for 2 lines?
    1. Re:2 lines? by Eudial · · Score: 1

      more like

      while(story.isDupe()) story.post();

      --
      GAAH! MY PRINTER IS ON FIRE!!! PUT IT OUT! PUT IT OUT!
  54. Mod points for articles? by Anonymous Coward · · Score: 0

    If only -1 Redundant could be applied to the articles, and not only the comments.

  55. Dupe by Kentsusai · · Score: 1

    Yeah this a dupe

    btw, why aren't they counting all the lines of code in the library? bit misleading don't you think? 6 libraries were used in Mr. Ed's code... hmm.. can anyone be bothered counting how many lines of code are used in each library. Coz I can't. All I'm saying is that it is actually more than just 15 lines of code. They're all in the libraries.

    nuff said.

  56. Like that one comic said... by Anonymous Coward · · Score: 0
    I know! Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore? It'll be just like that!

    God, I wish that War On Drugs hadn't been so effective. I could really use some fucking marijuana right now.

  57. Doesn't work out of the box; firewall problems by leighklotz · · Score: 1

    It doesn't seem to work, but a working version by Richard Jones. Unfortunately, it's incompatible ;-).

    More to the point, it seems to me that one of the big features of P2P programs is that they can use the response path to get around firewalls, home routers, and dynamic IP address problems by using a symmetric (or at least combined) protocol. (Of course, not everybody can be behind a firewall but at least some people can.)

    TinyP2P appears to require that a server be able to accept incoming connections, rather than just make outgoing ones, in order to share bidirectionally. Fixing that would be a good project, but the XMLRPC libraries available might make it difficult; I don't know.

  58. I have a web server I wrote in two lines~!!!! by pyrrho · · Score: 1

    did I tell you?

    #!/bin/bash /etc/init.d/httpd start

    I know I told you because I always post this when we get "in X lines!" stories... please believe me when I tell you that if you write anything at all in under 10 lines of code that is because it was already written and all you had to do was invoke the right tools. It's a testament to Python, which evidently has a peer to peer app more or less built in.

    it may even be a sign of great skill to have seen how so few lines were required to invoke the behavior. BUT: it's still not really "writing XYZ in N lines of code".

    yes yes... I'm just bitter because my Peer to Peer application is 25 lines long.

    by the way, did I tell you about the animation program I wrote? It can only animate one thing but it works flawlessly, I wrote it in GIF.

    I also wrote a word processor in Word Basic in zero lines! that's right... without altering the host environment at all... I achieve word processingness. Also... I ported this to Open Office macros with only zero lines.

    I feel old and mean now... but in my day we liked being old and mean, hey... GET OFF MY LAWN!

    --

    -pyrrho

    1. Re:I have a web server I wrote in two lines~!!!! by tepples · · Score: 1

      #!/bin/bash
      /etc/init.d/httpd start

      Unlike TinyP2P and MoleSter, httpd doesn't come with decentralized search. This feature is essential to prevent an attacker from censoring the network through technical or legal means. If you can write a P2P search module for Apache, on the other hand...

      if you write anything at all in under 10 lines of code that is because it was already written and all you had to do was invoke the right tools. It's a testament to Python, which evidently has a peer to peer app more or less built in.

      In other words, the existence of a 15-line P2P app written using Python standard libraries means that to ban P2P, a government would pretty much have to ban Python. Besides, unlike TinyP2P, which uses a library for XML RPC (layer 6), MoleSter uses only those libraries necessary to interact with sockets (layer 4 and perhaps 5).

  59. how many lines??? by Anonymous Coward · · Score: 0

    how many lines of code does python have???

    since this depends on python then python is part of the program, (ya cant run it without python)...

  60. That's nothing...it's one line in bash by exp(pi*sqrt(163)) · · Score: 1

    bash> $PREFERRED_P2P_CLIENT

    --
    Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  61. evil perview by pyrrho · · Score: 1

    would have been better like this


    #!/bin/bash
    /etc/init.d/httpd start


    sorry for my formating evil.

    --

    -pyrrho

  62. P2P-You'll NEVER win. by Anonymous Coward · · Score: 0

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

    Similiar reasoning works for security. That's why Linux should just give up, and drop security.

    1. Re:P2P-You'll NEVER win. by Medevo · · Score: 1

      As it applies to Linux, that smarter guy SHOULD allow his code to be added to the common effort.

      What is much more likly is that he will start his own security company and Linux will develop technology to emulate it.

      Medevo

  63. Because we haven't seen enough "me too!?" by Anonymous Coward · · Score: 0

    Next time write an article AND the application that proves a point and has validaty in countermanding stupid legislation instead of trying to be a perl showoff...

  64. Rerunning stories??-Kellogg's two scoops. by Anonymous Coward · · Score: 0

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

    NEWSFLASH!

    Kelloggs Raisin Bran now come with four scoops.

  65. Loophole by Tylerious · · Score: 1

    I'm not sure I understand your theory about how proving P2P programs are easy to write will put and end to people trying to stop them. Case in point: murder. If you think about it, killing people doesn't take much effort at all, but people still try to stop it. (No, I'm not condoning murder; just making a point)

  66. Nope by Anonymous Coward · · Score: 0

    You were duped.

  67. I wish that... by barchibald · · Score: 1

    His rationale compelled legislation. I do like the "build the sidewalk where people walk" (gennerall) approach to legislation, as infrequently as it is follwed.

    But...everyone smokes weed, it still illegal. Oral-sex was illegal and it wasn't even taking moola from anyone. Its only our naivate that makes us think that this sort of argument will influence any legislator beyond a few on the fringe.

  68. RIAA Response by Indy+Media+Watch · · Score: 4, Funny

    In response to development of the World's shortest P2P Application, the RIAA has weighed-in with the World's shortest lawsuit, coming in at a mere 2 lines:

    #1 You are fucked.
    #2 See you in court.

    --

    Indy Media Watch-Proctologist of the Internet

    1. Re:RIAA Response by bbtom · · Score: 1

      I'm surprised that you didn't put "#3 Profit!!!" on the end, since this is actually a case where that is appropriate.

      --
      catch (HumourFailureException e) { e.user.send("You, sir, are a humourless idiot."); }
    2. Re:RIAA Response by Xyrus · · Score: 1

      GOLF!

      #1 urfkd
      #2 cuncrt

      ~X~

      --
      ~X~
  69. Reported last month by Anonymous Coward · · Score: 0
    The 15 line P2P has been mentioned before 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.

  70. Interesting implementations by jd · · Score: 4, Interesting
    One of the best-publicised (amongst the geek community) protests against the ITAR regulations on encryption was the DES encryption algorithm on a t-shirt. What would be really cool, though, would be to have a P2P on a t-shirt and then have a CCD-based device that could "run" it when you walked into the room. "Me? No, I never loaded the computer with that."


    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.)

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    1. Re:Interesting implementations by wertarbyte · · Score: 2, Funny

      Of course, there are other interesting implementations out there. IIRC, there used to be a web server that was written entirely in Postscript.

      So, when can I use filesharing on my Laserjet 4000TN?

      --
      Life is just nature's way of keeping meat fresh.
    2. Re:Interesting implementations by the_mad_poster · · Score: 1

      The postscript web server is called 'ps-httpd'.

      --
      Alito: A vote for Alito is a punch in the eye to put that bitch back in her place!
    3. Re:Interesting implementations by peragrin · · Score: 5, Funny

      It's easy you can do it now. Just dump the raw hex of the files into a postscript and print. use a photocopier to make as many copies as you like.

      then hand them out. end users use OCR and their scanners. reassemble the files by hand.

      Warning large files may use lot's of paper.

      --
      i thought once I was found, but it was only a dream.
    4. Re:Interesting implementations by mrchaotica · · Score: 1

      Now, the real question is, can it actually run on a networked PostScript printer?

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    5. Re:Interesting implementations by beware+of+the+robot · · Score: 2, Funny

      Ok, that's 6,5 lines. Or 2,5 - depending on how we're counting...

    6. Re:Interesting implementations by mwvdlee · · Score: 3, Interesting

      Actually if you were to print out black/white "bits" on an A4-sized paper at 300x300 DPI you could fit rougly 1MB per side.

      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 ;)

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    7. Re:Interesting implementations by Sloppy · · Score: 1
      What would be really cool, though, would be to have a P2P on a t-shirt and then have a CCD-based device that could "run" it when you walked into the room.
      Why do I have the feeling that your CCD-based device is about to become a node in someone's distributed spamming network?
      --
      As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
    8. Re:Interesting implementations by the_mad_poster · · Score: 1

      Postscript doesn't have any mechanism for handling TCP/IP sockets, so the server runs in inetd. I guess if you could get inetd to run on your printer, which is theoretically possible I suppose, you could turn a printer into a (really slow) webserver.

      --
      Alito: A vote for Alito is a punch in the eye to put that bitch back in her place!
    9. Re:Interesting implementations by cra · · Score: 1

      So, file size would be measured in Logs and Twigs, then?

      --
      This message has been ROT-13 encrypted twice for higher security.
    10. Re:Interesting implementations by Taladar · · Score: 1

      Not to mention me walking in his room with a "rm -Rf /" T-Shirt.

    11. Re:Interesting implementations by wings · · Score: 1

      A simple google search shows the postscript webserver is available: http://public.planetmirror.com/pub/pshttpd/

    12. Re:Interesting implementations by jd · · Score: 1

      So mathematicians will be able to take the log of a file?

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    13. Re:Interesting implementations by cakefool · · Score: 1

      wow

    14. Re:Interesting implementations by Ithika · · Score: 1

      That'll teach them not to run their CCD-scanning software as root....

    15. Re:Interesting implementations by Ben+Hutchings · · Score: 1

      These days, real printers tend to come with embedded web servers already. Mine is too old for that, but it does have a telnet server.

    16. Re:Interesting implementations by mwvdlee · · Score: 1

      Well, I've been working on some numbers and although it should be quite possible to fit over 200MB on a single page, it would require a pretty expensive color printer though (and expensive ink). Actually there is no realistic upper bound; it's all based on the max. resolution and number of colors which can be printed and scanned.

      Pages which can be photocopied cannot realistically contain much more than 3MB/side at which time E-mailing might be easier and cheaper. Still; it would be a nice experiment so I'm thinking of doing a Java implementation if I get some more spare time.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  71. 466 bytes, no outside libraries by hummassa · · Score: 2, Interesting
    At http://ansuz.sooke.bc.ca/software/molester/:
    $/=$_;$,=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}
    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
    1. Re:466 bytes, no outside libraries by jellomizer · · Score: 1

      No outside libraries. Put Perl is a high level language, So is python. Commands like socket, bind. Probably run an equivalent of at least 100 lines of c code (following all the libraries to the raw conclusion) Plus how many line of code is perl just to get that program to run? I am not dissing Perl, or Python they are grate languages. But to start bragging that you can write such small code in these high level languages is the same as saying you are the tallest person in the world because you are on top of Mt. Everest. Perl and Python both have a lot of advanced text altering abaility which makes them very handy to work with. And yes your code seems impressive, although I haven't tested it or spent time reading it (Mainly because I hate reading perl) But to say your program is 466 bytes with no outside library you are forgetting this chuck of space that is in the megabytes that is called perl.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  72. I can beat that by Anonymous Coward · · Score: 1, Funny

    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.

  73. When it comes to lines.... by Anonymous Coward · · Score: 0

    80 columns ought to be enough for anybody.

    1. Re:When it comes to lines.... by deadlinegrunt · · Score: 1

      " 80 columns ought to be enough for anybody."

      Although 72 seems to be the agreed upon protocol.

      --
      BSD is designed. Linux is grown. C++ libs
  74. Problem: high demand for p2p by Anonymous Coward · · Score: 0

    Solution: make theft legal

  75. You missed the point. by raehl · · Score: 5, Informative

    The point isn't how trivial (or not) a complete P2P solution is.

    The point is that the DIFFERENCE between a networking application that has nothing to do with P2P and a P2P application is 15 lines. Thus, if you write a law that "bans something that allows peer-to-peer file sharing", you've probably just banned the standard distribution of Python since, being only 15 lines short of being a full P2P app, it pretty much allows peer to peer file sharing.

    1. Re:You missed the point. by Anonymous Coward · · Score: 0

      We can ban .NET here and now them.

  76. I bet 13 of those lines... by Anonymous Coward · · Score: 0

    ...are dedicated to spyware if its anything like kazaa.

  77. When will this code be on a T-shirt? by Anonymous Coward · · Score: 1, Interesting

    As we saw when the courts tried to ban DeCSS, the code was printed onto t-shirts.

    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?

  78. Perl golf goes by the byte by tepples · · 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 state that a lower score in bytes is better.

    1. Re:Perl golf goes by the byte by Pr0Hak · · Score: 1

      I would say that a single machine language instruction would be considered one "line"

    2. Re:Perl golf goes by the byte by Anonymous Coward · · Score: 0

      That puts machine language at a bit of a disadvantage in golf.

    3. Re:Perl golf goes by the byte by uhlume · · Score: 2, Informative

      This argument is either sophistry or stupidity. Perl and python are both interpreted HLLs (although both can also be compiled), so your "466 bytes" of source code is no more intrinsically meaningful a measure than the number of lines in either program: the relationship between bytes of source code and bytes of machine language in this case isn't even in the remote vicinity of 1:1, nor do I know of any simple means to compare the efficiency of perl and python in terms of size of bytecode to size of source code -- or for that matter the runtime overhead incurred by either interpreter.

      --
      SIERRA TANGO FOXTROT UNIFORM
    4. Re:Perl golf goes by the byte by bogado · · Score: 1

      For me a line must have at most 80 chars and should contain only one statment. This is a clear and easy to understand definition. :-D

      In the 8bit times there were oneliners contests in basic, those were limited to 256 bytes due to limitations in the basic interpreters. (typedef char line[256]?)

      --
      []'s Victor Bogado da Silva Lins

      ^[:wq

    5. Re:Perl golf goes by the byte by operagost · · Score: 1

      CBM basic 2 (used in the VIC-20) used to allow you to "tokenize" your statements and commands by typing the first letter and shifting the second. This worked because in upper-case mode the shift key produced special characters. "?" was the shortcut for PRINT, of course. It also allowed you to put no spaces between commands, and let you put multiple commands on one line using the colon. Finally, 88 characters (four lines on the chunky 22 character wide VIC screen) was the limit per line. When you're working on a machine that has only 3581 bytes of free ram (of course, mine had the 3K expansion for a roomy 6517) you must perform extreme measures. I don't know how the hell I could read that code.

      --

      Gamingmuseum.com: Give your 3D accelerator a rest.
    6. Re:Perl golf goes by the byte by bogado · · Score: 1

      I do remember my days of

      ] 10 ? "VICTOR ";
      ] 20 GOTO 10
      ] RUN

      VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR VICTOR ....

      I guess you can guess what computer I used to have.. :-D

      Ps. Dear slashcode (and ocasionaly slahreader that is offended), this is not shouting, and simply nostalgia. Since the computer emulated in the comment didn't suport lower case. Will you accept my comment now?

      --
      []'s Victor Bogado da Silva Lins

      ^[:wq

    7. Re:Perl golf goes by the byte by Anonymous Coward · · Score: 0

      Brings back memories. I wrote what I believe to be the smallest assembler ever written on the VIC-20. I sold it as The Assembler, the only assembler ever published for the unexpanded VIC. It left 1944 bytes free for your source, which meant the assembler took 1639 bytes (I seem to remember that the VIC had 3583 bytes free, not 3581 bytes).

      The Assembler was a lot more than just a "monitor", too. It supported symbolic labels (as long as you wanted), a symbolic program counter, hex constants and strings, comments, text strings, and perhaps most surprising, arithmetic address expressions that supported combinations of addition, subtraction, multiplication, divsion, AND, OR, XOR operators. And it could read the source from and write the object code to the cassette recorder. Everything was done in memory, no disk drives avaialable at that time.

      I worked for months squeeezing every possible byte out of that program and firmly believed that no one would ever be able to improve on it or make an equivalent assember to fit in the same space. At least not on the VIC-20. To the best of my knowledge, it is still the smallest assembler that supports symbolic addressing (i.e. a symbolic assembler) ever written for any platform. It seems unlikely that anyone ever will, at this point.

    8. Re:Perl golf goes by the byte by FrenchSilk · · Score: 1

      Oops, I was the anonymous coward who wrote that, thinking I was logged in. If anyone reading this bought The Assembler, sometimes called French Silk, the name of my company at the time, I would like to hear from you. Either reply to this or to D C French @ gmail dot com. I would be especially thrilled if someone still actually has a working copy of the original cassette and wouldn't mind parting with it.

    9. Re:Perl golf goes by the byte by bensafrickingenius · · Score: 1

      "victor victor victor victor victor victor victor victor ...."

      hail to the victors

      --
      I am not left-handed, either!
  79. hahahahaha by Anonymous Coward · · Score: 0

    In Soviet Russia... tiny P2P apps write YOU!

  80. more psudo code by Anonymous Coward · · Score: 0

    #define editor

    while(1) {
    post slashdot_aricle(today - month)
    }

  81. "P2P" in practice means decentralized search by tepples · · Score: 1

    Then wouldn't a web server be one peer, and the user's computer be another, and the relationship between them would be *gasp* Peer to Peer?

    True, a distribution of Apache HTTP Server plus Mozilla Firefox would be a peer-to-peer system under the RFC definition. However, the essential feature of "p2p" that makes it different from Mozpache is that search on "p2p" is decentralized and thus resilient to censorship by governments, copyright owners, or other alleged holders of monopoly on a particular work. For example, if I wanted to publish a document describing how to dismantle an atomic bomb on Mozpache, the Department of Defense or Island Records could go after Google, MSN, and AllTheWeb to censor my work, but on a decentralized system, they wouldn't have such an easy target.

  82. That prooves nothing! by adolfojp · · Score: 1

    I could probably make a lethal weapon out of a jagged rock in 15 minutes or less and it would still be banned from commercial flights.

    Disclaimer: I am a P2P supporter

    Cheers,
    Adolfo

    1. Re:That prooves nothing! by slavemowgli · · Score: 1

      You don't actually have to invest time for that. A jagged rock (or even a non-jagged one) already *is* a lethal weapon when applied properly.

      --
      quidquid latine dictum sit altum videtur.
    2. Re:That prooves nothing! by klang · · Score: 1

      Even the in-flight magazine is a lethal weapon, when applied properly .. So, the need to bring a rock is eliminated as well.

    3. Re:That prooves nothing! by computational+super · · Score: 1

      Yeah, no kidding - I tried to read one of things once and the boredom almost killed me, too.

      --
      Proud neuron in the Slashdot hivemind since 2002.
  83. Super Mario Networking? by tepples · · Score: 1

    The first to attack SMB networking would be Nintendo.

  84. Just "Peer-To-Peer"? by kg4gyt · · Score: 1

    Essentially peer to peer creates a server on everyone's computer and allows you to search all of the other servers.

    How is this any different than what google does? Its a harmless "application" that searches other computers on which there are files being served to the web. Large portions of the web are copyrighted. Universities, Companies, Enyclopedias, they're all copyrighted, and you search them with google/yahoo etc.

    "Whoever intentionally induces any violation identified in subsection (a) of this section shall be liable as an infringer.

    In subsection (g), "intentionally induces" means intentionally aids, abets, induces, counsels, or procures, and intent may be shown by acts from which a reasonable person would find intent to induce infringement based upon all relevant information about such acts then reasonably available to the actor, including whether the activity relies on infringement for its commercial viability."

    Isn't the purpose of search engines to "intentionally aid" you in finding something, regardless of whether its copyrighted or not? Search engines, nor arguably Peer to Peer is created for the sole purpose of copyright infringement. Where is the line drawn between the two?

    I'm anxious to find out how this holds up in court if it even passes both houses.

  85. Time to move beyond P2P by ewanrg · · Score: 1
    I think it would be just as valid to argue that if P2P has gotten this simple that it's time to look for programs that will require more work and produce better results.

    Seriously, isn't it time to look for a program that will more intelligently let you find what you're actually looking for, help you get it quickly, and then make it easy for you to share it with your friends? That's where P2P has started, but it seems like we're not making as much progress here as we could given the increased connectivity of our community and the increased performance of our computers.

    Of course, considering the legal problems that P2P authors have run into, perhaps the problem is that anyone who comes up with the next best thing has been scared off of releasing? Who do we sue about that?

    ---

    Yeah, I've been told I'm like that on my blog ;-)

  86. Suggested improvement by Anonymous Coward · · Score: 0

    come on, if you are going to invoke perl, you might as well invoke echo and pass the string directly.

  87. tinyp2p is not a p2p app by kervel · · Score: 1

    is that tinyp2p is not actually a p2p app, or only if you see p2p very broadly.

    just offering/transferring files is not really enough to satisfy the "p2p" demand, because then http and ftp would classify as "p2p" too. a real p2p app would make a distributed peer-to-peer network without central server possible.

    1. Re:tinyp2p is not a p2p app by slavemowgli · · Score: 1

      So Napster wasn't a P2P app (or network), and eDonkey isn't, either?

      --
      quidquid latine dictum sit altum videtur.
    2. Re:tinyp2p is not a p2p app by kervel · · Score: 1

      okay, you have a point (the "without central server" thing was incorrect). But i would still argue tinyp2p is not a real p2p app, as it doesn't have any functionality that ftp doesn't have. napster and edonkey had functionality to build a large (= more than 2 hosts) network. tinyp2p doesn't.

    3. Re:tinyp2p is not a p2p app by slavemowgli · · Score: 1

      Yes, it does (at least if I understand how it works correctly). When you start it as a server, you can specify the URL of another, already running server, and the new server you're starting will become a part of the network that server's connected to. You can build arbitrarily-sized networks of servers that way, and a client that connects to one of the servers to get files will look for them on every server of the network the server it connects to belongs to.

      --
      quidquid latine dictum sit altum videtur.
  88. Any program can be itty-bitty by davidwr · · Score: 1

    If you have a rich enough library, any "program" can be itty-bitty.

    Heck, if "rundll" counts, you can do a lot of stuff in a 1-line MS-Windows command file.

    Assuming your hardware supports only "low-level" instructions as we know them today, the true test of program complexity is how much code is executed, not now many lines are on the printout.

    Of course, if your hardware has "open a reliable network socket and send some data and receive some data then close the socket" as a single instruction:
    SENDANDRECV OUTGOING_DATA, INCOMING_DATA, PORT, PROTOCOL
    then er um well, "nevermind."

    --
    Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
  89. Outspoken Supporter of Digital or Patent Rights? by theodp · · Score: 1

    Perhaps it should be mentioned that this 'outspoken supporter of the digital rights the Slashdot community holds so dear' is also the expert witness for Eolas, who has been awarded $565M for its web plug-in patent, which even Microsoft-loathing /.'ers have trouble stomaching.

  90. ++Funny by Anonymous Coward · · Score: 0

    Will someone please mod this as funny? It's both true and laughable at the same time!

  91. HEH by Anonymous Coward · · Score: 0

    Does anyone at Slashdot even read the f'n site? I'm not one to cry dupe but some are just bad. Must be smoking some heavy stuff there.. hook me up.

  92. It's no use... by bill_mcgonigle · · Score: 1

    Thus, if you write a law that "bans something that allows peer-to-peer file sharing", you've probably just banned the standard distribution of Python ... even if it was banned the Pythonistas still wouldn't shut up about how great it is.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  93. Enforcement impossible by bill_mcgonigle · · Score: 1

    Does anyone want to enlighten me as to how a 15 line P2P app means that it is pointless and silly to ban them?

    I have to assume he's going for the Whack-A-Mole argument.

    Actually, this might be a good strategy. Setup a thousand shell companies each with their own 15-line P2P network, and let the RIAA litigate each one out of business. Death of a thousand legal bills.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  94. Um... by Hikaru79 · · Score: 1

    Everyone seems to be saying that just because this app is small, it is unworthy of banning. Read the post. It did not say it was *unworthy* but rather that it is *pointless* and *silly*. And this makes sense-- he's saying if it's this easy to make a quick P2P app, banning it would be like trying to heal a chainsaw wound with a band-aid. Nizo said: 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. No it wouldn't be. But if you could find a simple way to produce crack that required nothing more than a few common household items and the IQ of a rabbit, it would be POINTLESS to try and make it illegal. It would be non-enforcable. THAT'S what Mr. Felton is saying.

  95. Naive question by chancycat · · Score: 1

    Shouldn't the command line statements for launching or executing a program like this constitute a "line of code" for measurement purposes? It seems as much context goes into the launching of a program like this than goes into many of the lines of Python code.

    --
    Evan - needs to hit preview before submitting
  96. Now if he had 20 000 lines more by JaCKeL+1.0 · · Score: 1

    Now if he had 20 000 lines of backdoor, spyware and malware it will be ready for release.

  97. By the theory of ease-- by way2trivial · · Score: 1

    Murder-it's easy to commit, so making it illegal is silly.

    --
    every day http://en.wikipedia.org/wiki/Special:Random
    1. Re:By the theory of ease-- by tedrlord · · Score: 1

      Hah, so you say. Committing murder takes a damn good bit of effort, let me tell you. Sometimes you've got to stab a person a dozen times before they die. And when you've already got carpel tunnel, man...

      Wait, forget I said anything.

      --
      [insert witty quote here]
  98. This guy is a renegade and must be stopped! by Anonymous Coward · · Score: 0

    This hacker is spreading "code", immoral behavior, and communism. He's a threat to America!

  99. better use of 15 lines by slapout · · Score: 1

    Maybe this is what we need: a program that looks at the topic ("windows", "handhelds", "games", etc) and shows the editor the last 15 or so stories that were posted in that topic. That could be written in 15 lines of python couldn't it?

    --
    Coder's Stone: The programming language quick ref for iPad
  100. Proof of concept....err....not. by Anonymous Coward · · Score: 0

    Has anybody actually gotten it to work?

    When I run it in client mode I get:

    File "tinyp2p.py", line 14, in ?
    for url in pxy(ar[3]).f(pw(ar[3]),0,[]):

    xmlrpclib.Fault: Fault 1: 'exceptions.TypeError:coercing to Unicode: need string or buffer, list found'

    On OSX 10.3.7. Great proof of concept guys.

  101. ...here is the 1 line version: by Anonymous Coward · · Score: 0

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

    retards.

  102. mod up by Anonymous Coward · · Score: 0

    valid point.

  103. pointless and silly? by HappyDrgn · · Score: 1

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

    Don't get me wrong, I'll be the first to defend legitimate P2P apps. Though using the uncomplicated process of building a P2P app as justification for not banning them (or as a basis for argument) is in itself silly however. Pipe bombs are easy to make and rifles can easily be modified to be automatic, should they not be illegal simply because someone can make them easily in their homes?

    1. Re:pointless and silly? by vidarh · · Score: 1
      The difference is in the level of harm. It is extremely hard to prevent the making of pipe bombs because it is so simple, but the risk to the public from people making them with the intent of using them makes the case that the benefit to the public of attempting to control and deter them is worthwhile. Contrary to a P2P app, it is also relatively straightforward to determine what is a pipe bomb and what isn't.

      In the case of a "P2P" app (what is P2P anyway? Felten's code is just a trivial client-server example similar to what you can find in most textbooks on network programming, but I guess P2P sounds better these days) they are so trivial to make and so hard to police and the concept is so wide (is an FTP server a P2P application? What about a web server - with WebDav it has the same capabilities as Felten's clients?) that any attempt to ban them would either fail because it is too narrow and easy to work around or too wide and would catch a plethora of network services that are in common use.

      Combine that with a worst case scenario of making it easier to do something that isn't inherently illegal (copying files) but that MAY hurt copyright holders if you break another law by copying copyrighted material without a license and it's worthwhile asking questions about whether the public is in any way served by attempts to outlaw P2P applications.

  104. 15 lines is why I'm not a programmer by Anonymous Coward · · Score: 0

    I remember my freshman year in college. I thought I was a hot shot computer guy and was seriously contemplating getting a CS degree. One of the first assignments was to write a program that displayed something in a pretty weird manner (I don't remember exactly). I tried and tried and tried to get it to work. I could get close, but not quite there. Then the professor showed the results of the contest--someone wrote a program that did it in 15 lines. I knew right then that there were a lot of people much more talented than I. So there went my CS thoughts.

  105. p2p class? by Anonymous Coward · · Score: 0

    import p2p
    def ....:
    ???
    x=p2p.get('profit!!!')

  106. small code == legal app? by tvjunky · · Score: 1

    This might be pretty cool, though it was postet before and MoleSter is already down to 6 lines with 466 bytes, but is small code size really a reason why it must necessary be legal? Don't get me wrong, I don't think that code can be illegal at all. But stating that small code size implies that the resulting app and it's uses are legal sounds quite silly to me, considering SQL Slammer is only 376 bytes.

  107. Bad Analogy by SilentDissonance · · Score: 1

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

    So by this logic... since a single command on a windows machine (format C: /y), which is just as bad as some virii out there, is fine and dandy and we shouldn't go after the people who wrote that virus that ate your grandmother's hard drive?

    Listen, I'm as much for the free sharing of information as the next person, as long as the original author is OK with it. Also, I'd like to be sure that said author gets some cash for his work. The way P2P networks are used, primarily, is to trade MP3s and video files without the concent of the original author, or their getting some form of income from it. If you use it for something else, fine, but it's the primary use of it that bothers me.

    Please, I encourage you to show me where I'm wrong in this. If you use the argument "the artists don't get any money or very little from the sale of their work" understand that that is not a valid excuse. If they feel cheated, they should have went with a better contract when they started, or been smarter during their negotiations with their label.

    1. Re:Bad Analogy by Queuetue · · Score: 1

      The core issue is that the RIAA/MPAA having a bad business plan shouldn't be reason for the government to reduce my rights or control my behavior.

      If they are silly enough to offer me something, and I pay for it, it should be mine - no matter what dumb provisions they try to attach to it, and no matter how much they want to sell it to me and to everyone else, too. A dysfunctional business should not be propped up by my taxes and elected officials.

      If people can't make money that way, then go find another job. I, like slashdot, give away information for a living, and it's hard work. You need to find ways to have your customers prefer to get their data from you, when they could get it anywhere.

  108. This is so a month ago by BestNicksRTaken · · Score: 1

    This is why I don't bother with offline magazines anymore, by the time you read them, they're already a month behind the internet!

    It's also some bloody ugly Python code - which is quite an accomplishment seeing how beautiful Python code looks (when compared to Java/Perl).

    --
    #include <sig.h>
  109. This is useless by entrigant · · Score: 1

    People like this guy are missing the point. This is not very different from a DCC file send on IRC. There is a reason the RIAA is going after suprnova and not bittorrent itself. They could care less if it's possible to connect to another system on the internet and send data two ways (who'd have thunk it?!). The term p2p has changed somewhat to imply a database and/or search functionality of shared content coupled with the ability to send that content to anyone who requests it. THAT is what the RIAA doesn't want. Unfortunately this 15 line Python program doesn't allow me to type "Radiohead" into an input box and press a search button, then have nearly instant access to hundreds of copies of radiohead songs from people accross the planet. This was never about sending files. It has always been about organized systems used almost exclusively to illegaly find and distribute copyrighted materials.

  110. what are the odds... by Anonymous Coward · · Score: 0

    That's so short, if you cat through /dev/random for long enough you'll probably find it! Are they going to ban /dev/random next?

  111. I have the best P2P app and it fits in ONE line! by Anonymous Coward · · Score: 0

    Yeah... you can strip the whitespace and newline characters from just about any program to make it fit in one line...

    If that so-called genius application was written with any kind of decent coding standards, it would certainly be larger than just 15 lines.

  112. Clearly by achurch · · Score: 1

    programming languages are tools of the devil. Look at all these illegal purposes they can be used for! We'd better ban them now before those thieving pirates do worse. Arrr.

  113. Just a coincidence? by Philom · · Score: 1

    At least on my screen, the article is also only 15 lines long. It must be vying to be the world's shortest story about the world's smallest P2P app.

  114. Know your history by alexo · · Score: 1


    > What happens if the government decided to ban oral sex?

    Funny you should mention it because until recently your government was doing just that.

  115. What-U-Ban by tepples · · Score: 4, Insightful

    Perl and python are both interpreted HLLs ... so your "466 bytes" of source code is no more intrinsically meaningful a measure than the number of lines in either program

    The existence of MoleSter proves that Perl is 466 bytes away from being a P2P program, that in order to ban decentralized search (the key point of P2P file sharing), you'd almost have to ban Perl itself.

    1. Re:What-U-Ban by Anonymous Coward · · Score: 4, Funny

      'bout bloody time too ;-)

    2. Re:What-U-Ban by CodeMonkey4Hire · · Score: 1

      Or you could just ban any Perl program that is longer than 465 bytes. I know a lot of people that would be glad to see that. (not me mind you)

      --

      Let's go Hurricanes!!! 2006 Stanley Cup Champions!!!
  116. shortest google hack by Anonymous Coward · · Score: 0
  117. Yeehah! Ban the Internet! by mrchaotica · · Score: 1

    ...Because that's what making peer-to-peer completely illegal ultimately means, you know.

    If the **AA (and US government) had any sense, they'd realize this is going over about as well as Prohibition (and the War on Drugs, for that matter) and give up.

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  118. If they really want to put the breaks on this.... by mark-t · · Score: 1
    They can.

    By "purchasing" a law that requires all ISP's within the country to firewall absolutely *ALL* residential customers so that they are behind a NAT with absolutely no port forwarding other than for ports where an outgoing packet was sent by the home PC, making it effectively impossible for a residential customer to host any server of any kind (they could, however, pay a higher fee to their ISP and get a corporate account with their ISP). This approach would _RADICALLY_ reduce the number of infringers, and maybe even make it viable to actually go after the "corporations" that are left still infringing.

    This won't actually stop the infringement, but it would have the potential to reduce it radically, since most home users won't be interested in paying more money to their ISP just to download "free music".

  119. Babylon 5 by MourningBlade · · Score: 1

    Famous episode with Penn and Teller.

    "We say serious things in a silly way, and people laugh. The government says silly things in a serious way and people pay attention."

  120. bah. by pb · · Score: 1

    In my day, we wrote hundreeds of lines of C to precisely implement the RFC for TFTP--and we liked it!

    Also, perhaps the better point here is that P2P apps aren't new, and we use them all the time, for much more than just file(shar|steal)ing. (Hey, are you net-booting that PC? You criminal, you!)

    --
    pb Reply or e-mail; don't vaguely moderate.
  121. One line by AndroidCat · · Score: 1
    justdoitokay.bat:
    CassiniWebServer c:\ 80 /

    It's a very high level language called DOS batch. (Hey, if it's okay to sweep stuff under the rug or into a library, why not?)

    --
    One line blog. I hear that they're called Twitters now.
  122. Viruses by eMartin · · Score: 1

    Viruses are pretty easy to write in just a few lines too, so they should be legal as well.

    1. Re:Viruses by Anonymous Coward · · Score: 0

      They should be legal to write, just not to distribute. Just as p2p apps should be legal to use.

  123. Why the repost? by Anonymous Coward · · Score: 0

    Why the repost? This was cover a few weeks ago on Slashdot.

  124. shorter golf code segment - one line! by Anonymous Coward · · Score: 0

    #1 urskrd

    1. Re:shorter golf code segment - one line! by Anonymous Coward · · Score: 0

      #1 sueu

  125. Smaller is better... by Crayon+Kid · · Score: 1

    Well, here we are taking pride in who's got the bigger... err, smaller code. That's geeks for you.

    --
    i ate crayons when i was a kid and now i have two braincells and the blue ones taste nicer
  126. Missing the point by Anonymous Coward · · Score: 0

    I think some people here are missing the point. This guy has coded this to emulate the DeCSS code that was put on t-shirts etc. It is a demonstration of the absurdity of banning a technology. Technology doesn't break the law, people use technology to break the law. When I was on IRC and running an FTP server to trade warez like it was "Garbage Pail Kids" cards from my dorm room in college no one ever thought IRC and FTP should be banned. Thats because people in power were to technologically stupid to understand how it worked/what it was/etc.

    Now that it is trivially easy for anyone to share anyfile the same stupid people think "Hey that's not right people can use that to do something illegal". You can use a computer to do plenty of illegal stuff, but using the same tools you can do legal stuff too.

    Writng a short implementation of P2P is just a way of demostrating that P2P is not some fancy magical thing. It is nothing new, merely the combination of existing technologies (i.e. fileservers and search engines).

    All the people here saying "Just 'cause its short doesn't mean it should be legal" are missing the point.

  127. Great summary of the real issue. by Futurepower(R) · · Score: 1

    LOL.

  128. Warez by any other name..... by panicst8 · · Score: 1

    I am 30 and have been in and out of the warez scene for 15 years. There has always been warez in the world of computers be it: sneaker net (passing warez via some sort of media), ftp, irc, web links (direct downloads), news groups, zmodem, xmodem, whatever. Where there is a will, ther will always be a way. Until it got to be all the rage, no one really cared, (ok some dark mansion somewhere so guy thought man i could by gold toothpicks if not for those damned pirates!) The bigger picture of all this is who is losing money.... People who bootleg software, are either A) people who wouldn't, or couldn't buy the software (egads at the cost of some some software... add up photoshop, office 2003, XP pro, a couple games, cd buring software, etc... add in the price of the computer and now your talking some bucks. or B) people who want it to learn from to get jobs do better at jobs, use it at work, etc. In fact, I am sure there is a study that shows people learning the stuff requesting it or recomening it to there office who buys legit copies, or the fact that the more people whon know Product Whatever, the more companies choose to use Product Whatever... I know I have learned skill after skill from downloaded books, classes, and software. All of which got used on the job and ended up getting a lot of said software and books purchased. People who bootleg music and movies .... well p2p may have made it simple for the common man, but movies have been boot legged FOREVER ... personnally I have 450+ store bought dvd's and 5 music cd's :) cough (120gigs mp3s..) I had reall cd's once but when my case of 200 cd's got swiped and the insurance company wouldn't pay for it since i didn't have renters insurance, I downloaded my 200 albums ... this was 7 years ago... hmmmm I am pretty sure I used only ftp, or borrowed cd's to replenish them... Since then I only collect random songs from my lifetime (ack and some from my parents .. damn road trips) and occasionally i'll look up billboard hits and grab some.. but as for paying as much for a cd with 2 good songs on it as i do for a dvd, please spend some more time in the studio. and the cost for reproduction? I can make my own label case included (and what the hell wrap some Glad Wrap around it and Vola, one quarter later I have a nice bootlegged copy they want 15 bucks for. and Movies, a crappy ass movie I pay to see in a theater costs me 16 bucks (Have to bring the wife) and then if we like it i get to spring another 15 when it hits dvd ... so 31 dollars in total ... or i could grab a copy love it or hate and buy it or don't ... and with 450+ I do buy the occasional. How about if I go see it in theater I can joing a movie club and on the way out swipe my stub and my account card and soon as the dvd is out it hits my house at like 7.50 plus 1.50 for delivery or maybe each movie I go see adds some discount action twords dvd purchase by that production company ... something for crying out loud ... Oh what if I register my cd with the production company and if it's lost or stolen i can download a new copy. :) I guess I'll have to switch to digital downloads, ubtil they say you can only dload it once. :) One last thing, As for software, once we move to thin clients (hehehe full circle, can you say unix X terminals?) Then that pretty much does away with boot legging , mp3's, movies, etc ..... the people who host the apps, and storage, and stream you your stored stuff, will have the DRM action going, and won't allow you to bootleg, or install bootleg, or type the word bootleg, or fritters. and then bill can go sit on a stick.... The End.

  129. Your point is moot. by hummassa · · Score: 1
    TinyP2P uses the same run-in scheme (collapsing small lines) that MoleSter. It's comprised of 15 lines of roughly 80 chars each, while MoleSter has 6 x ~80. If you expand TinyP2P in a similar way, it will still be roughly 3 times the size of MoleSter AND it uses a separate library (XMLRPC) while MoleSter uses only built-in sockets.

    MoleSter:
    $/=$_;$,=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}
    TinyP2P:
    import 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.SimpleXM LRPCServer)
    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"))
    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
  130. How can I actually test these apps? by pancakegeels · · Score: 1

    Its all theoretical to me at the moment.
    I have a 24kb picture of the two ronnies I want to share.
    How do i do it?

  131. Not 15 Lines by Nautica · · Score: 1

    If it Didn't use any other library written in python it would be 15 lines of code, but since he is using XML Services, I would have to say it wasn't done in 15 lines.

  132. OK... Encryption next, please? by Civil_Disobedient · · Score: 1

    If you can make a p2p app in 15 lines, how hard is it to make one with built-in encryption? This seems like a relatively easy additional layer to implement, but I honestly don't know all the various pitfalls. Could someone please enlighten me? (I realize WASTE already has this, but the development of WASTE appears to have hit a stand-still in beta implementation).

  133. New P2P language by bluestar · · Score: 1
    What we really need is a new language to write P2P apps in. Then we could get it really small.
    #!/usr/bin/p2p

    fork SHARE(my_stuff);
    while true FIND(other_stuff);
    --
    "The cost of freedom is eternal vigilance." -Thomas Jefferson
  134. say it. by binarybum · · Score: 1

    It's pronounced "Tiny PeePee" (it's a silent 2).

    --
    ôó
  135. Lines of Code. by jellomizer · · Score: 1

    What is the point of bragging about lines of code for high level languages.

    Ohh I can do it in 10 lines in Perl. Ohh I can do it in 5 lines in Python. But wait here is this guy who did it in 3 with Ruby!.

    Sure there is some credit about making a small program but comparing them with other languages is just silly it is apples vs. oranges.

    First off these are high level languages. Which take up at least a couple of megs of hard drive space. The languages sourcecode is in the thousands if not 10s of thousands lines of code if not greater. There primary design is to get work done as close to the psutocode design as possible without all the mucking about allocating memory, making search routiens. Basicly all the boring stuff in programming.

    Secondly Each Language is specilized to do things differently, some things are quicker to code in one language and other are not.

    Third. All this time used to make the shortest program doesn't nessarly make it faster (Quick to code often means large O(n^2) speed). As well it makes it hard to read and to fix, and change thus useless in real life.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    1. Re:Lines of Code. by Anonymous Coward · · Score: 0

      Dude, chill. It's a fucking contest. A fun thing to do. Nobody is pretending the Perl code runs faster than hand-coded asm.
      Remember the 3-line RSA cipher in Perl, from back in the day? Well this is like that. Somebody coded it because they could, because they wanted to.

  136. What is a statement? by tepples · · Score: 1

    For me a line must have at most 80 chars and should contain only one statment.

    Now the problem becomes one of what is a statement. Python allows multiple assignments in one statement. C allows multiple expressions-with-side-effects in a statement, separated by commas.

    1. Re:What is a statement? by bogado · · Score: 1

      usually a statment is one line that ends with a ';'. This work well in C and perl, I don't know python well. :-P (I realy would like to know python, but I simply can't force me throw the barrier of forced identation, damn me). :-D

      --
      []'s Victor Bogado da Silva Lins

      ^[:wq

    2. Re:What is a statement? by tepples · · Score: 1

      usually a [statement] is one line that ends with a ';'. This work well in C

      Accent on the "usually". How many statements does the following ANSI C program have?

      #include <stdio.h>
      #include <stdlib.h>
      int main(void){ if(puts("Hello World!"), exit(0), 1) {} }

      I [really] would like to know python, but I simply can't force me [through] the barrier of forced [indentation], damn me

      Others would say: "I really would like to know lisp, but I simply can't force me through the barrier of forced parentheses, damn me."

    3. Re:What is a statement? by m50d · · Score: 1

      In Python a lie is actually a line, as in it ends with a carriage return. 13 lines in a language with syntactically significant whitespace is, to my mind, a very good achievement, even though I hate to see Python abused so.

      --
      I am trolling
  137. fewest punchcards by peter303 · · Score: 1

    In my days, when programming exercises were in OS360 assembler, on 80-character punchcards, with one assembly instruction per punchcard, the macho guys tried to minimize the number of punchcards. Of course this lead to impossible to understand code (if assmbler isnt hard enough). And the dangerous practice of "self-modifying code", i.e. the program may write new assembler instructions in existing location of execution memory. The latter is usually prohibited by modern OS loaders that sequester executables into read-only pages.

    The "WOZ" was a legendary hacker in this regard. You should see how tight some of the monitor code is in the original Apple I & II. In those days a byte of ROM memory cost a couple cents, so every instruction counted.

  138. If you read my other, comparing, comment... by hummassa · · Score: 1

    You'll see that:
    perl ~ 500 chars WITHOUT outside libraries (using only sockets)
    python ~ 1500 chars USING outside libraries (XMLRPC)

    and then you can think about the expressivity (is this a word?) of each language.

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
  139. 15 lines of python code by Anonymous Coward · · Score: 0

    1000's of lines of c code that make up the python interpereter.

    Let's be more realistic here. All non-os, non network stack software required for the app to run should be counted.

  140. Netcat is the silliest P2P app. by Anonymous Coward · · Score: 0

    http://www.google.com/search?q=netcat+win32

    C:\> nc -l -p 1234 < File-to-serve

    $ nc servermachine.local 1234 > my-copy-of-file

    Ban netcat!? That's like banning notepad.

    -- RDB

  141. And how many assembly instructions per C line? by adb · · Score: 1

    ...and how many transistors to implement each assembly instruction? It's HUGE! HUGE I tell you!

  142. nicely put by pyrrho · · Score: 1

    and you didn't even flame my snark. You are a gentleman.

    Yes. It means (1) Python has some great high level stuff built in for networking software, which my pythonophilic freinds have told me for (holy shit!) a decade. And (2) banning P2P will not happen unless python is banned, nor even if python is banned.

    banning P2P would be to ban servers... for that's all it is, servers which are peers rather than the old ugly named "master-slave" setup.

    Web Hosts that are not traditionally thought of as Peers are, in fact, with modern smart workstations rather than terminals, just Fat Peers. Though I would prefer to call them Phat Peers.

    --

    -pyrrho

  143. ALL my programs are one line by MMHere · · Score: 1

    That's because I open them in vim and type:

    10000J:x!