Slashdot Mirror


P2P In 15 Lines of Code

nile_list writes "Edward Felten of the very fine Freedom to Tinker has written a 15 line P2P program in Python. From the post on Freedom to Tinker, "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." Matthew Scala, a reader of Freedom to Tinker, has responded with the 9 line MoleSter, written in Perl."

418 comments

  1. hrm.. by grub · · Score: 5, Funny


    Freedom to Tinker has written a 15 line P2P program in Python

    Does anyone have a .torrent link for it?

    --
    Trolling is a art,
    1. Re:hrm.. by Anonymous Coward · · Score: 5, Funny

      it's 9 lines in perl....

      #!/usr/bin/perl

      fjdohsb0y[tu34qtyjhq5ykl2yjh4u5iongvwy5iopy9uy7u 87 srthmn90;
      ps394b7-6vh0ae6se0n89789t75j890t67scj89 067j890e54t 890;
      5478n35890904hn907t85j90670w9-57-xfg90hjx;om nxrt9b n0ps54;
      s907n-679s-90xe54/6w547/7589vj0s9-78se-06 vw346hbn8 7n98i7eu6;
      463g3w6g6v6u45betyv4yc45y4y5s7n86uijy4 63q4awy;
      4w57ne568une5j7vc7uyh35xjh7z6jx5uj6ukdtm cdryjtu;
      68ne578iyjvyhdrc h6ug37eb64n84mw6m8 s4r6i4rt6;

      I was suprised it was so simple! i can not believe i did not think of it already!

    2. Re:hrm.. by javax · · Score: 1

      actually, its ONE line of perl, though that line probably has more than 80 characters...

    3. Re:hrm.. by Lord+Kano · · Score: 2, Insightful

      I disagree. They're trying to hold the people who write such apps liable for the criminal behavior of others. It's like suing Ford because a drunk driver killed your kid or suing Lorcin because some psychopath shot your wife.

      It's dishonest to pretend that they're only going after the people who actually infringe when they are going after software publishers for contributary infringement.

      LK

      --
      "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
    4. Re:hrm.. by Anonymous Coward · · Score: 0

      point2pointless

    5. Re:hrm.. by Narcissus · · Score: 1

      Where will this whole "go after the software producers" attitude end? You'll know we are in trouble the day Microsoft gets sued because of the file sharing functionality within Windows.

      They make sharing so easy (right click on a folder and it's right there in the menu!) they're all but telling their users to infringe copyright...

    6. Re:hrm.. by Chandon+Seldon · · Score: 1

      Ha!

      That's way unlikely, a perl script that compact wouldn't make it through slashdot's junk filter.

      --
      -- The act of censorship is always worse than whatever is being censored. Always.
    7. Re:hrm.. by jpetts · · Score: 1

      Well, I encrypted it and can't tell the difference:

      -----BEGIN PGP MESSAGE-----
      Version: PGP 8.1

      qANQR1DBwU4DD6nDmdavmCoQB/sE/OOSnrHHimB3F71Cw1Dk fo jcGQVaEiBGwVnS
      i7wS5fN10qNqCkHg5uwHb0NqsXu46L0OxL VXUa69s1tNlI9Pfh ig7jGqDB4ippEz
      iZ1+Q80c4ueI3fBsVoSmzICCq6nUq+LoBe di0F8OFII5F7BcGf CA7I3qF7OlX+mP
      2bnqqDV1c0b5Xh65/Aff86iUrMacM9gsTg suURODQwUajoBp+Z SXNsfQEHgPvUZF
      6Y+dsFAGXI0SzUTBT0ChbHQaQGYFfbmQXo eud4mABi/ABNZYLR fVQZL9kyw60XUo
      fz5nuOGsUWtYR1ZrVi0RJXONorjeecTMru ici/0ECv9kFRBdCA Cb3DUoTugNWUTQ
      LL/9AUq2qoXsZm9iOQXqSTZ1luFiwpI1A1 5bttrsnnaDcAbeHT mKA10FbO+puA63
      tDEYz/bLXKRmgGVzBji2VM4YcWShBwHd7d 633a2h6voFLIcp1i f1ngNa+Db2FfaQ
      IN26idVfg31eOGKmMnay+XFeQy1Hr3EY5s wqAZVlKWDTj2kp/B A10+b/PYYvjUd8
      wYbQVVurHuF+V+8tPhnA0QWnEVUr8B+OST d0ql3u89Bwnt/1dr mSeqNXyU1kNQU+
      leQ4juWsBQAT3jYmymAtT/Q4kmwD0GzVfE UwbaMcO5MIj1N9sc 1kNHPLhYSgiF1i
      Xysl0Ao00sEnAZYYrOMumpIkMVvC6brAg4 VbhUXogDSRLGhAy7 /tomLFqETZjc4Q
      gdKYbdzqw4oF3W7/IRQZ469iIoqTK1vhLB yvFwt3MF1DD4gY5x BEXDo2REclWHb2
      fykaRe3OGiNSaHuAVCDUjZjJulhSLz+xNj KOl0AQddEwcSVaJX kaJ2M+rSzQsESt
      gXXq6/bwgR2adiT5SEbIKGsWyRcW5tna12 IvhPJqRoaokt5d/0 x07Zgq3ouRmDr6
      UDZGJDqtzCi7BZabsekWMsegnzY6FjPRNd WiSGxysh5I7MCpzs Cfbmax3oYe6xAu
      TRZWIqpBlCfx4s8sE7KAQQFuxDg52jKS4u oj86c0RKd+/q0qXI Zg4HFK4L3N009o
      GWMO63jiSWMiVoWaX4BlyXqVPfGjp+8rtJ X4FqVAnk4SJQreiv Ujl8+qcC02oTEX
      6ksEMZ+ED+J51PO3Rw4HUwdIf7lqdF8gh5 weyGnYRc9TR8sTMz eOIkNuHSB0jwXD
      rT6KlQh7XdmL4X1CwH+FxrZ5r1OJvFhlIE Uh4WoxyVOL+pzn1P hYUIvPXv3pxQVv
      CbAxK7rRC60SqZWygeNNu7NKGezDIjeOOr gDYettsGJ7KEt3TM jHFPAGcGw43CBs
      8eCgEJQw1cMRu1d7G8rRkA==
      =0Nnp
      - ----END PGP MESSAGE-----

      --
      Call me old fashioned, but I like a dump to be as memorable as it is devastating - Bender
    8. Re:hrm.. by forkazoo · · Score: 2, Funny

      Fermat apparently had proved a theorem for an N-line PERL script P2P app (n!=2), but in his famous "Treatise on the PERL language," he scrawled in the margin:

      I have found a single line of PERL to do this, but it is too long to fit in this margin.

    9. Re:hrm.. by Alsee · · Score: 1
      That's obviously not Perl - way too many alpha-numerics!
      Here's the actual Perl, note that it's well below 50% alphanumeric:
      $p=shift;$a=shift;i(shift);socket S,2,1,6;bind S,&a($a);listen
      S,5;$/=undef;while(@ARGV&&($_="$p $a f".shift)||accept(C,S)&&($_=<C>)&&close
      C){m!^(.* ?) (.*?) ([e-i])([^/]*)/!s&&$1 eq$p&&&$3($2,$4,$');}sub e{open
      F,'>',$_[1];print F $_[2];close F}sub f{&s($_,@_)for keys %k}sub
      g{open(F,'<',$_[1])&&&s($_[0],$a,"e$_[1]", <F>);close F}sub
      h{&s($_[0],$_,'i')for keys %k}sub i{$k{$_[0]}=1}sub
      a{$_[0]=~/:/;pack'CxnC4x8',2,$' ,split'\.',$`}sub
      s{socket X,2,1,6;$w=shift;if(connect X,&a($w)){print X
      "$p $_[0] $_[1]/$_[2]";close X}else{undef $k{$p}}}
      Slashdot broke the formatting a little, but I'm suprised Perl made it through the filters at all.

      -
      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
  2. Not a good true complexity issue. by jellomizer · · Score: 2, Interesting

    15 Lines? 9 Lines.
    The python code has
    import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac
    The perl code puts multiple commands in one line.

    Those are both cheating. And not really 15 or 9 lines of code. How many lines of code are just os.py alone? Using these upper level languages is not a good way to prove how simple these activates are because they use many complicated libraries preinstalled in the language. It is like saying I can write a webserver in 3 lines of code.
    #!/UpperlevelProgrammingLanguage
    Import webserver
    Run Webserver
    Version in lower level language like C with just say the <includes> are better but still a bit of cheating. If you did in in assembly then that is even fairer. The true test is how many lines of code in assembly without an OS.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    1. Re:Not a good true complexity issue. by malfunct · · Score: 1

      I think it depends on whether the libraries are commonly available and considered part of the language "framework". If they are then its not really cheating as the amount of work involved is installing the framework (which is necessary to do any development in the language) and writing 15 lines of code.

      Of course multiple commands on the same line is cheating, especially in perl where you have to know all the magic to make things compact.

      --

      "You can now flame me, I am full of love,"

    2. Re:Not a good true complexity issue. by wwahammy · · Score: 5, Insightful

      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.

    3. Re:Not a good true complexity issue. by grub · · Score: 5, Insightful


      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.

      --
      Trolling is a art,
    4. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      Plus it's not understandable.

    5. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0
      Hasn't this been said enough around here?!?!?

      DON'T RE-INVENT THE WHEEL

      Importable modules are there specifically to be used (re-used?) like this. I think this guy deserves more credit than you give him.

    6. Re:Not a good true complexity issue. by Abcd1234 · · Score: 5, Insightful

      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!

    7. Re:Not a good true complexity issue. by BridgeBum · · Score: 1

      While what you say is true, unless your UpperlevelProgrammingLanguage is commonly available, there is a lot of complexity in getting said language to install and work on a large number of systems. Using standard high level languages with standard libraries does cut down on the work to make portable servers available to the masses.

      The length of code isn't the real issue here, it's the effort required in writing said server and making it available to others.

      --
      My UID is the product of 2 primes.
    8. Re:Not a good true complexity issue. by dtolton · · Score: 5, Insightful

      I think you are missing the point. The point isn't that you can write a library called p2p and write a a two line python program:

      import p2p

      p2p.run()

      the point is that using standard built in libaries of these languages you can build a fully working p2p system in a very short amount of code.

      I do agree though that 15 lines is a bit misleading, although the python program is not putting multiple statements on one line, you can't do that in python. Instead he has removed all whitespace, put all defs and the following body on one line etc.

      Again though, the point *isn't* trying to make a program that is highly "pythonic", it isn't. The point is that using basic libraries that have been in Python for years, you can roll a p2p server in 20 minutes.

      --

      Doug Tolton

      "The destruction of a value which is, will not bring value to that which isn't." -John Galt
    9. Re:Not a good true complexity issue. by ipjohnson · · Score: 1

      While I agree there is underlying code written in a multitude of different languages why does it not count?

      Maybe it speaks volumes about where our coding languages have gone but the fact that you can write it in 15 lines (or 9 depending on which language you prefer :) just goes to show how easy it really is to write a P2P app with today's modern languages and libraries.

      Or are you one of those people that wants to go back to punch card for the authentic programming experience?

    10. Re:Not a good true complexity issue. by Johnathon_Dough · · Score: 3, Insightful
      So? Are they going to have to also make illegal import sys, os, SimpleXMLRPCServer, xmlrpclib, re, and hmac? Or are those going to be on there because they have functions necessary to the OS not related to P2P apps?

      I think the point he was trying to make, is that it is too late to ban. Yeah, it would have been more impressive if he had coded it out of 15 lines of 1's and 0's, however, I think showing that you can take a bunch of embedded functions, and write a script that acts as a P2P app is a worthwhile example.

      --
      If you are one in a million, then there are six thousand people who are just like you.
    11. Re:Not a good true complexity issue. by SilentChris · · Score: 2, Insightful

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

      Uh, why? If a person writes a virus in Visual Basic, no one blames Visual Basic (at least, no one outside techies). Yet the virus itself is clearly harmful. The libraries are just a framework for both good and bad apps.

    12. Re:Not a good true complexity issue. by Anonymous+Crowhead · · Score: 2, Funny

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

    13. Re:Not a good true complexity issue. by Smidge204 · · Score: 2, Insightful

      The problem with that comparison is that things like os.py are standard libraries that are used by a very wide selection of programs. The 15 lines here are actually unique, meaningful code specific to the application's task. The libraries are available to everyone. Nobody counts the code in header files as their own.

      Your "web browser" example is just invoking another program, and so it doesn't do anything unique or application specific.

      So when he says "done in 15 lines of code", it means that all the programmer has to do is type out 15 lines of code, and that using libraries for support functions is pretty much a given.

      Unless you're a pedantic shithead, of course.

      I will grant you that putting multiple commands on one line is cheating, though. However if the symantics of the language allow you to shorthand multiple actions in a single command then it'sa fair game!
      =Smidge=

    14. Re:Not a good true complexity issue. by CableModemSniper · · Score: 4, Insightful

      #!/UpperlevelProgrammingLanguage
      Import webserver
      Run Webserver
      ----
      What, like this?
      #!/usr/bin/env ruby
      require 'webrick'
      s = WEBrick::HTTPServer.new( :Port => 80, :DocumentRoot => File.join(Dir.pwd, "htdocs")
      trap("INT") { s.shutdown }
      s.start

      --
      Why not fork?
    15. Re:Not a good true complexity issue. by Rheagar · · Score: 5, Funny

      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.

    16. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      I don't even need a programming language to have a p2p network -- I just run MS Outlook, no need to click on anything, the preview pane does all the work...and there you have it, instant botnet with filesharing capabilities.

      Lines of code: zero

    17. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      Yes, because nobody ever runs an OS, they are so retro.

    18. Re:Not a good true complexity issue. by jbeaupre · · Score: 1

      Neglecting stuff like OS or processor, how about two categories:
      1) Fewest lines (characters) of custom code
      2) Smallest compiled code size

      Runtime compiled or scripts might only be eligible for the first category.

      --warning, cheap joke coming--

      Then guys can whip it out and compare sizes like real men.

      --
      The world is made by those who show up for the job.
    19. Re:Not a good true complexity issue. by Jerf · · Score: 5, Insightful

      While what you say is true, I think you are partially missing the point, because what you say is part of the point.

      None of the components included in the Python program are specifically P2P. But each of these components are common, powerful, and widely available; almost every, if not every, mainstream language you can think to name has each of these libraries easily available. This isn't news to Prof. Felten, it's an integral part of his point: These readily available libraries, for which no reasonable grounds can be come up with to eliminate them, are trivially combined into a P2P program.

      It is not the same as "import webserver; webserver.run()".

      Moreover, there is nothing XML-RPC or HMAC specific about the code, really, and you can't ban all RPC libraries, all hashing libraries, etc.

      This isn't really a demonstration of the power of Python or anything, and I think Molester sort of misses that point, though turning it into a Perl Golf contest is cool and nerdy and all. (Besides, Pythonistas like me are generally not impressed with such hyper-concision, since one of the reasons we use Python is readability and maintainablity; as a game it is great fun though.) Prof. Felten's point needs to be understood more like an academic proof that a problem is intractable; reduce the problem to something like the halting problem with a 1-to-1 mapping, and you're done. Here, Ed Felten reduces "P2P" to (taking it generically) a language and OS (absolutely vital, can't be banned without banning computers entirely), networking/communication, a bit of string processing (re is convenient but any turing complete language can do that), and a hashing algorithm which probably isn't even vital to the process.

      The point is to show that at the core, P2P can't be banned because there really isn't a "P2P" technology, it is an incredibly simple and straightforward application of the basic capabilities of a computer and a network connection. It has already been shown a rough equivalent can be written in Perl, and any number of others will probably pop up now. Languages like C++ or Java probably can't get down to 10 lines, but they will still be simple programs as programs in those languages go.

    20. Re:Not a good true complexity issue. by Corporal+Punishment · · Score: 1

      I don't think they are cheating. If you can use the installed libs to create something faster/smaller/quicker than by using some other language, then more power to you. I don't think you should have know the complete TCP/IP handshake process in order to create a network app. Of course if you do understand networking at that level, that's all the better.

      Having said that, in python you can create a webserver in two lines of code:


      import BaseHTTPServer
      BaseHTTPServer.test()


      Sorry, couldn't resist. ;)

    21. Re:Not a good true complexity issue. by tigersha · · Score: 1

      I can write a webserver in 2 lines:

      #!/bin/bash
      apache

      See! Easy!

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    22. Re:Not a good true complexity issue. by shura57 · · Score: 2, Insightful

      ...although the python program is not putting multiple statements on one line, you can't do that in python.

      A little off topic, but yes, you can -- just put the semicolon in between:

      $ python
      >>> import os; os.listdir(os.getcwd())

      Also, the following is nothing else but the multiple statements carefully hidden by the tuple packing/unpacking:

      a,b,c = (blah,lambda x:blah,blah-blah)

      I agree with the main point, though.

    23. Re:Not a good true complexity issue. by Aeiri · · Score: 1

      You're going to have to have these, too: `tar zxf gtk-gnutella-0.92.1c.tar.gz`; `cd gtk-gnutella-0.92.1c;./configure;make;make install`; `gtk-gnutella`;

    24. Re:Not a good true complexity issue. by 3terrabyte · · Score: 1
      True, but how long until a square box, labeled P2P, is allowed to drag and drop into your next RAD tool?

      Just like in Delphi, you can drag drop Web browsers, servers, ftp clients, etc right into your app.

      --

      Why are there only 19 people folding@home for slashdot?

    25. Re:Not a good true complexity issue. by linicks · · Score: 1

      somebody please mod this +5 funny

      --

      I got nothing...
    26. Re:Not a good true complexity issue. by fornaxsw · · Score: 1

      Which IDE do you use for writing machine code? I didn't realize that I've been cheating my whole life using standard libraries, and I'd like to set it straight by writing everything from scratch.

    27. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      And amazingly, the application will very likely still suck! Delphi is one amazing piece of engineering, rivalled only by Visual Basic.

    28. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 1, Interesting

      Fair enough if we were doing a coding competition to see who could write the smallest P2P client. But I think that would be missing the point of the article. The purpose of the 15 line P2P client is to demonstrate how easy it is to code a client, not how easy it is to smuggle one on a floppy.

      And as far as that goes, high level language code libraries aren't "hacks", they're a reality that has to be dealt with. The fact is, libraries for doing very compliated things exist and are easy to obtain. They make it possible for even people with limited programming experience to write fairly complicated programs without much effort.

      That's where RIAA and it's band of merry men have made a miscalculation. They believe that developing a P2P client is a difficult task which can only be done by experienced programmers. Thus they would only have to police only a small segment of the population to enforce laws against developing them. But as the 15 line P2P client demonstrates, the increasing complexity of high-level languages (and their included libraries) makes it much easier to develop a client than they think. So enforcement would be like trying to move an ocean with an eyedropper.

    29. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

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

      Uh, why? If a person writes a virus in Visual Basic, no one blames Visual Basic (at least, no one outside techies). Yet the virus itself is clearly harmful. The libraries are just a framework for both good and bad apps.


      Oddly enough, P2P applications are just a framework for both the legal and "illegal" sharing of information...

    30. Re:Not a good true complexity issue. by dtolton · · Score: 1

      I vaguely remember reading that you can put semicolons to do multiple statements, but because it's considered such poor python style I've never used it. However I stand corrected on that point.

      I disagree that tuple unpacking is multiple statements though. That's the equivalent to saying that the function call do_some_operations() is carefully hiding multiple statements. Underneath the hood of python yes, tuple unpacking is multiple statements, but in python itself its nothing more than a variable assignment. What I was addressing were the cases where you would normally have a multiline expression such as a def, and compacted it to a single line. Whereas a tuple unpacked statement is typically written on a single line.

      --

      Doug Tolton

      "The destruction of a value which is, will not bring value to that which isn't." -John Galt
    31. Re:Not a good true complexity issue. by fredrikj · · Score: 1
      A little off topic, but yes, you can -- just put the semicolon in between

      That won't work for indented blocks, however.

      Fortunately, exec comes to the rescue!
      exec "for i in range(2):\n__for j in range(2):\n____for k in range(2):\n______print i, j, k"
      (using __ instead of regular spaces since Slashdot's comment molester deletes spaces)

      Now any Python program can be expressed in one (long) line.
    32. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      #!/bin/bash
      apache


      I think you mean:

      #!/bin/bash
      httpd

    33. Re:Not a good true complexity issue. by skubeedooo · · Score: 1
      P2P [...] is an incredibly simple and straightforward application of the basic capabilities of a computer and a network connection.

      So presumably they could ban it by searching around for and buying the patent that somebody inevitably has.

    34. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      ...and it only took you 4 lines to make an ass of yourself. That's gotta be a record too. What OS/distro are you using where 'apache' is the actual binary file name?

    35. Re:Not a good true complexity issue. by shura57 · · Score: 1

      When I look at this:
      ar,pw,res = (sys.argv,lambda u:hmac.new(sys.argv[1],u).hexdigest(),re.search)
      I see three asignments. One is the list of the command line arguments, another is the function defined right here, and the last one is the existing function. Looks like multiple assignments to unrelated things, if you ask me :-)

      Of course, when function returns a tuple which you unpack it is different matter, but the above clearly qualifies as multiple statements (carefully and smartly hidden, I must say). If he were not aiming for the most compact code, he would have written the same using three lines.

      Not that it matters, really :-)

    36. Re:Not a good true complexity issue. by shura57 · · Score: 1

      Nice! You must be an obfuscation expert :-)

    37. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      Not unlikely at all. In fact, probable.

    38. Re:Not a good true complexity issue. by flumps · · Score: 5, Funny

      no one blames Visual Basic

      Believe me, VB has ALOT to answer for.. *shakes fist*

      --
      "So there he is, risen from the dead. Like that fella, E. T." - Father Ted Crilly
    39. Re:Not a good true complexity issue. by Pxtl · · Score: 1

      Heheh, expect to see that in the next version of VB. XP SP2 bundled in MS's new P2P network, so a custom control is moments away. Ditto Java, with JXTA.

    40. Re:Not a good true complexity issue. by geekoid · · Score: 1

      What we need is some 'you've missed the point' follow up posts...

      If you don't get it, look at the post times.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    41. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      There have been proposals and continuing efforts to make it illegal to publicly distribute any program until it has been "approved" by the FBI.

      You think it's unlikely a politician would do anything that looked stupid? Think again. They excel at it. Look at the DMCA.

    42. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0
      although the python program is not putting multiple statements on one line, you can't do that in python.

      print 'yes';print 'you';print 'can'

      Open mouth, insert foot.

    43. Re:Not a good true complexity issue. by hal2814 · · Score: 1

      Maybe he compiles it himself and decided to just call it apache.

    44. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      The python code has import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac

      That's not "cheating". One of the core philosophies of Python is that it comes with "batteries included". It's part of the value you get from using Python over some other language. Likewise, CPAN is one of Perl's strengths.

      Demonstrating that you can write something using only a small amount of code and a knowledge of the standard libraries isn't "cheating". It's demonstrating how concise your code can be when you know the language and standard libraries well.

    45. Re:Not a good true complexity issue. by b17bmbr · · Score: 1

      i'm teaching the AP Comp Sci class at my high school, and for a demonstration, i wrote a threaded client-server chat program. had one computer as the server, recieving messages, and sending them out to all the clients. the threaded server and client, including swing interface, comes in under 150 LOC. i wanted them to see how threading, vectors, sockets, and I/O work. a few more lines and it could send bytes (binary files) over the same network. in fact, the chat app would work over the internet as long as the router port forwarded port 10000. and any two or more computers could be set up and running in minutes. i don't know where java would fit into your post. it is certainly a high level language. however, assembly wouldn't be as portable, and considering that everything from wrist watches to super-computers runs java, java would be a good choice for p2p apps.

      --
      My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
    46. Re:Not a good true complexity issue. by XO · · Score: 1

      back when Napster was king, I wrote a little client/server-based system, that would keep track of who had what files available for trade, details about the files, and details on how to contact the person who had them.

      Never bothered writing a client, but the server was written in LPC (the LP-Mud language, yes), in like 24 lines, and was definitely more functional than napster's servers were, and could probably scale better as well, not that i ever really tested it for that.

      Hell, my initial plan was just to have it be a central repository of FTP server information.. what would be the legality of that? Apparently it would be totally illegal now, as that's basically what Napster did, and it was deemed illegal (wasn't it?)

      So, having a central list of publicly available files and where to get them is illegal.. hmm..

      Sounds like phone directories have now become illegal too!

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    47. Re:Not a good true complexity issue. by CableModemSniper · · Score: 1
      There's actually a typo, it should be:
      @@ -1,6 +1,6 @@
      #!/usr/bin/env ruby
      require 'webrick'
      -s = WEBrick::HTTPServer.new( :Port => 80, :DocumentRoot => File.join(Dir.pwd, "htdocs")
      +s = WEBrick::HTTPServer.new( :Port => 80, :DocumentRoot => File.join(Dir.pwd, "htdocs"))
      trap("INT") { s.shutdown }
      s.start
      --
      Why not fork?
    48. Re:Not a good true complexity issue. by Cumstien · · Score: 1

      Excellent point. The ease of writing certainly gives access to p2p and invites any moderately experienced programmer to write an app. However, a network of one is not a network. Likewise an overly simple app that doesn't provide at least some basic tools and features makes searching and orginization more difficult. Additionally, security is concern of mine, but maybe not the average p2p user.

      Still I welcome the notion of an easily written p2p app.

    49. Re:Not a good true complexity issue. by PierceLabs · · Score: 1

      You mean not everyone compiles the apache webserver into something that doesn't mention the product/project itself? Madness I tell you, madness! ;)

    50. Re:Not a good true complexity issue. by Anonymous Coward · · Score: 0

      proof that a problem is intractable; reduce the problem to something like the halting problem with a 1-to-1 mapping, and you're done

      1. Intractable doesn't mean uncomputable. Intractable means difficult to compute; uncomputable mean impossible to compute. The halting problem is uncomputable rather than intractable.

      2. You don't reduce your problem to the halting problem, but the other way around: you reduce the halting problem to the problem you are trying to prove uncomputable.

      3. It's not a 1-to-1 mapping, but a polynomial reduction.

      HAND.

    51. Re:Not a good true complexity issue. by CableModemSniper · · Score: 1

      somebody please mod this +5 funny

      Ok.

      --
      Why not fork?
    52. Re:Not a good true complexity issue. by naer_dinsul · · Score: 1

      Holy crap! 150 Libraries of Congress? That's a heckovalotta code!

      --- end sarcasm ---

    53. Re:Not a good true complexity issue. by SilentChris · · Score: 1

      "Oddly enough, P2P applications are just a framework for both the legal and "illegal" sharing of information..."

      Mostly illegal, though. *Prepares to be modded down for going against the Slashdot hivemind*.

  3. P2P only works if there are other peers by xswl0931 · · Score: 2, Insightful

    Anyone can write a P2P client, but who will you network with? Not very useful with the other P.

    1. Re:P2P only works if there are other peers by dtolton · · Score: 1

      You can get a nifty little utility for Python called Py2Exe which converts Python code into a native executable file. It will extact all of the relevant libraries and build a fully working stand alone exe file. Seems like it would be pretty easy to build a network this way, people wouldn't even need python to run it.

      --

      Doug Tolton

      "The destruction of a value which is, will not bring value to that which isn't." -John Galt
    2. Re:P2P only works if there are other peers by Anonymous Coward · · Score: 0

      I'll network with you... what's your IP address, lover?

    3. Re:P2P only works if there are other peers by dreamchaser · · Score: 4, Insightful

      Do the words 'proof of concept' mean anything to you?

    4. Re:P2P only works if there are other peers by Anonymous Coward · · Score: 0
      I'm George W. Bush you insensitive clod!

  4. It could be shorter... by Anonymous Coward · · Score: 0

    if whitespace didn't mean something.

  5. Size complex? by stevenbdjr · · Score: 5, Funny

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

    Anything you can do I can do smaller?

    1. Re:Size complex? by RailGunner · · Score: 1
      A better question - is why did he name the perl script after a perpetrator of illegal sexual contact?

      Oh - it's not Molester, it's Mole-Ster (like Hulkster, brutha). Hm.

    2. Re:Size complex? by ccharles · · Score: 1

      It's because our penises are so huge.

      Disclaimer: I'm not really a PERL developer.

    3. Re:Size complex? by scribblej · · Score: 1

      It's because our pensises are so huge.

      Disclaimer: I *am* a Perl developer, ladies.

    4. Re:Size complex? by Anonymous Coward · · Score: 0

      Anything you can do [..] ... Perl can do on fewer lines.

    5. Re:Size complex? by shrubya · · Score: 2, Insightful

      "I'm not really a PERL developer."

      Obviously not. You think Perl is an acronym.

      BTW, even as a novice Perl developer, I can confirm that repeated use of <> and $_ will add several cm to your manhood.

    6. Re:Size complex? by gr8_phk · · Score: 2, Insightful

      The python one is suffering the same thing. He deliberately squashed it down at the expense of clarity.

    7. Re:Size complex? by hobbesx · · Score: 1

      ACK

      --
      This rating is Unfair ( ) ( ) Fair (*) Funny
      Sigh... If only. Modding would be so much more fun.
    8. Re:Size complex? by vsprintf · · Score: 1

      There are actually (thankfully few) people who write Perl code like that. I inherited some scripts from a guy at work who apparently learned Perl before comments and newlines were allowed. He can make Perl do wonders, but it's easier to write it again from scratch than to figure out what his code does and expand on it.

    9. Re:Size complex? by Anonymous Coward · · Score: 0

      Hmmm... I don't understand Perl. I'm a construction worker. Your idea of huge is my idea of small. And for the record, my penis is huge (to you that's enourmous).

    10. Re:Size complex? by Brendan+Byrd · · Score: 2, Insightful

      BTW, even as a novice Perl developer, I can confirm that repeated use of and $_ will add several cm to your manhood.

      In all seriousness, I hate the use of $_, implied or not. (Especially if it's omitted and used as the default variable.) Yes, it makes the code short, and maybe even use slightly less memory, but I prefer to just create a named variable and use those, instead of looking at:

      while (<>) {
      s/\D+//g;
      alarm;
      reverse log if (exp);
      select pop;
      foreach (split //) {
      print;
      s/\d+/ord.hex.oct/e;
      s/\A/-/g; s/\Z/\n/g;
      print;
      }
      }

      And trying to figure out exactly where $_ gets garbled, or to even figure out what it's doing. Named variables describe what it is. The more you subtract from that, the more unreadable the code becomes. For God's sake, the language was written by a linguist. It was designed to make programs somewhat English-readable. At least take the time to do that, instead of going off on some golfing powertrip.

  6. can you write hello world... by djeddiej · · Score: 0, Offtopic

    in one line of code? I have seen object oriented versions of hello world... http://laguna.fmedic.unam.mx/~daniel/pygtutorial/p ygtutorial/x101.html Is this a first post?

    --
    just a web application developer and instructor in Toronto, ON Canada
    1. Re:can you write hello world... by Anonymous Coward · · Score: 0
    2. Re:can you write hello world... by pseudochaotic · · Score: 1

      It's kind of odd to use a GUI example, isn't it? I would think that making a GUI hello world is a lot more complicated than a normal 'hello world'.

      --
      And the l33t shall inherit the 34r7h.
    3. Re:can you write hello world... by DrEldarion · · Score: 1

      Very easily:

      10 PRINT "Hello World"

    4. Re:can you write hello world... by RetroGeek · · Score: 1


      --

      - - - - - - - - - - -
      I am a programmer. I am paid to produce syntax not grammar. Deal with it.
    5. Re:can you write hello world... by hunterx11 · · Score: 1
      It depends. You can make a GUI "Hello world" in Cocoa without typing a single line of code: main() does contain a call to NSApplicationMain(), but that's part of the template when you start a new project.

      It only took a bit longer than writing a stdout version in vi.

      --
      English is easier said than done.
    6. Re:can you write hello world... by PoesRaven · · Score: 1

      its trivial in shell scripting
      you dont even need a text editor

      just type on any terminal:
      echo "echo \"Hello, world.\"" > hello; sh hello
      that writes a program to say hello world and runs it, all on one line

    7. Re:can you write hello world... by CableModemSniper · · Score: 1
      I can write Hello, world in one line of code by using the superpowerful programming language cat
      helloworld.cat:
      Hello, world!
      Amazing, no? To invoke it just use the cat interpreter, (comes on most modern *nix systems):
      $ cat helloworld.cat
      --
      Why not fork?
  7. P2P Does Not Break the Law by phunster · · Score: 3, Insightful

    P2P Does Not Break the Law
    People Do

    1. Re:P2P Does Not Break the Law by Anonymous Coward · · Score: 5, Insightful

      The point is that when copyright holders attempt to take action against those people, you all start crying "They're suing children!" So they sue the P2P networks instead, and you start crying "Unfair! Go sue the users!" So they...

    2. Re:P2P Does Not Break the Law by MHobbit · · Score: 1

      Amen.

      --
      Debugging? Klingons do not debug. Bugs are good for building character in the user.
    3. Re:P2P Does Not Break the Law by ad0gg · · Score: 2, Insightful

      Nuclear bombs don't kill people, people do.

      --

      Have you ever been to a turkish prison?

    4. Re:P2P Does Not Break the Law by Stween · · Score: 2, Informative

      Of course P2P doesn't break the law. P2P has been around for years, long before illegal sharing of copyrighted content on P2P systems hit the limelight.

      Consider: Usenet, 1979.

    5. Re:P2P Does Not Break the Law by phloydde1 · · Score: 0

      what I wonder is when some lawyer is going to take these p2p copyright cases and use the rulings to sue gun makers...
      it's the same logic.. gun makers knowingly make something that CAN murder someone , so they must be liable for murder...

    6. Re:P2P Does Not Break the Law by Anonymous Coward · · Score: 2, Interesting

      I love how Orrin Hatch, a huge proponent of the NRA and the belief that "guns don't kill people, people kill people" (which I agree with), is the biggest pusher of the Induce Act, which implies that people don't violate copyright, software does. I want to puke.

    7. Re:P2P Does Not Break the Law by cmstremi · · Score: 2, Funny

      What I think you meant to say is:
      "Guns don't kill people. *I* kill people."

      Happy Gilmore's boss (the one Happy shot in the head with a nail) had that on his t-shirt if I remember correctly...

    8. Re:P2P Does Not Break the Law by Throtex · · Score: 1

      About the same time that lawyer gets laughed out of court for failing to understand causation.

    9. Re:P2P Does Not Break the Law by Anonymous Coward · · Score: 0

      Mod up.

      Since 1979 at least.

      AFAIK, in Manframe terms, JES was sharing reports and the ATS (Airline Traffic System) was sharing weather and departures/arrivals reports, before CICS, had P2P elements in the low 70's.

      To correct one incorrect point above, the are not suing kids - they are suing their parents for an intangible, percieved non-physical loss. If not child abuse, it is parent abuse.

    10. Re:P2P Does Not Break the Law by Waffle+Iron · · Score: 1
      The point is that when copyright holders attempt to take action against those people, you all start crying "They're suing children!" So they sue the P2P networks instead, and you start crying "Unfair! Go sue the users!" So they...

      That's the kind of absurd situation you get when you set up an economic system that is dependent on the honesty of children.

      When copyright was invented, copying equipment was too costly for anybody but dedicated publishing companies to afford. The system depended on the publishers' honesty, backed up by the ease of enforcing the law when only a few thousand printing presses were in existence. It worked OK back then.

      Time marches on. Now, most every child in America can get his or her hands on equipment that can effortlessly access and make bulk copies of most media.

      Instead of adjusting the copyright system to account for the new reality, the knee-jerk reaction seems to be trying to revoke everyone's right to own fully general-purpose computers.

    11. Re:P2P Does Not Break the Law by Spy+der+Mann · · Score: 1

      The point is that when copyright holders attempt to take action against those people, you all start crying "They're suing children!" So they sue the P2P networks instead, and you start crying "Unfair! Go sue the users!" So they...

      So they realize that the whole system is crap, and finally accept to sell songs using P2P.

      In my opinion suing sites with torrents is the way to go. That way, it'll be like the good ol' times. Underground networks with warez in the shadows , and the clean networks on the surface.

    12. Re:P2P Does Not Break the Law by Frizzle+Fry · · Score: 1
      That's the kind of absurd situation you get when you set up an economic system that is dependent on the honesty of children.

      Yes, that's why we legalized shoplifting and beating up smaller children for lunch money decades ago.
      --
      I'd rather be lucky than good.
    13. Re:P2P Does Not Break the Law by ad0gg · · Score: 1

      Actually its not in reference to a movie. I made that statement to show how stupid people are when they say "(whatever) doesn't (whatever), people do". Obviously we aren't going to allow people to own nuclear weapons even though by themselves they are relatively harmless. There needs to be resonable expectations when it comes to tools/weapons. When people say, "we have to right to bare arms", i always respond "yes! i have right to own nuclear weapons to protect my family".

      --

      Have you ever been to a turkish prison?

    14. Re:P2P Does Not Break the Law by Waffle+Iron · · Score: 1
      Yes, that's why we legalized shoplifting and beating up smaller children for lunch money decades ago.

      Anti-shoplifting measures take place on the merchant's private property. Because of this, most of the time they are able to take steps to enforce honesty without abridging anybody's rights.

      Stolen lunch money may be a (minor) injustice, but we don't see multibillion-dollar industries attempting to base their earnings on trusting kids with their lunch money. Nobody has proposed Draconian measures to prevent lunch money theft.

      Face it, children are not going to be honest. The only way to enforce this stuff is taking drastic steps to either stamp out unrestricted general-purpose computers, or to slap huge fines and/or jail time on their parents.

      Everything in life is a tradeoff. Copyrights are there to encourage production of more content. Is it really worth such a hit on freedom to get some more media content? I say no. We already have far more than enough content, and most of that is crap. If it's a choice between letting Hollywood shrink a little or living in a police state, I'll take the former.

    15. Re:P2P Does Not Break the Law by vsprintf · · Score: 1

      When people say, "we have to right to bare arms", i always respond "yes! i have right to own nuclear weapons to protect my family".

      That's a pretty strange response to people who want to wear short sleeves.

    16. Re:P2P Does Not Break the Law by eraserewind · · Score: 1

      Yeah, nobody ever posted copyrighted material on USENET. Oh wait...

    17. Re:P2P Does Not Break the Law by Anonymous Coward · · Score: 0

      Sledge Hammer had "Guns don't kill people. Bullets do."

      I think that makes sense... well, unless you've just been clubbed over the head with a shotgun.

    18. Re:P2P Does Not Break the Law by Anonymous Coward · · Score: 0

      How about they... stop suing people?

    19. Re:P2P Does Not Break the Law by drinkypoo · · Score: 1

      the constitutional right to bear arms is intended to both provide for a force to defend the country and to protect you from the government if they decide to become [more of] a fascism. hence assault rifles are justified by either argument. blow your ridiculous comparison to nukes out your nether orifice. the only way you don't need protection from the gov't is if you don't believe in privacy and you agree with every single law. if less of the populace were armed the government would push us all around that much more....

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  8. XANGA LOL by Anonymous Coward · · Score: 0
  9. I wrote a 7-line renderer with physics engine... by Anonymous Coward · · Score: 3, Funny

    ...but it only worked with 1 dimension. I'm working on scaling it up, but I'm worried it might get longer.

  10. You just knew it... by Anonymous Coward · · Score: 0

    *Someone* had to respond with a Perl script. I guess the animosity hasn't yet subsided.

  11. When will this code be on a T-shirt? by QangMartoq · · Score: 5, 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?

    1. Re:When will this code be on a T-shirt? by Anonymous Coward · · Score: 3, Funny
      What a lazy bastard you are! Not only do you think you're entitled to steal music, but you think you're guaranteed a shirt!

      It's too much effort to print a lousy t-shirt yourself, but artists shouldn't get paid for their lives' work?

    2. Re:When will this code be on a T-shirt? by LiquidCoooled · · Score: 1

      I could send you a knitting pattern to make your own, but if i do the KIAA will send out a team of attack grannies.

      --
      liqbase :: faster than paper
    3. Re:When will this code be on a T-shirt? by Photar · · Score: 1

      Pony up $10 buddy.

      My Cafe Press store

      --
      He who knows not and knows he knows not is a wise man. He who knows not and knows not he knows not is a fool.
    4. Re:When will this code be on a T-shirt? by Anonymous Coward · · Score: 0

      did you just steal his code?

    5. Re:When will this code be on a T-shirt? by vsprintf · · Score: 1

      I could send you a knitting pattern to make your own, but if i do the KIAA will send out a team of attack grannies.

      Those of you who think that's funny never had a grandmother who tucked her knitting yarn and needles between the couch cushions.

    6. Re:When will this code be on a T-shirt? by LiquidCoooled · · Score: 1

      The most amusing part is, the knitting pattern world ARE interested in copyright, and even have very detailed copyright instructions for the woodbe knitter.

      I don't think your or my grandmother would ever read these.

      http://www.knitty.com/ISSUEfall03/FEATcopyright.ht ml

      --
      liqbase :: faster than paper
    7. Re:When will this code be on a T-shirt? by vsprintf · · Score: 1

      Ha! Great link, but the image of the knitting needle(s) caused flashbacks. I'm standing while I type this. :)

    8. Re:When will this code be on a T-shirt? by drinkypoo · · Score: 1

      depending on the license you can make it yourself at cafepress. if it's gpl, though, just forget it, as the license will be longer than the code...

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  12. Slashdot editors strike again! by Anonymous Coward · · Score: 5, Funny

    I'm Matthew Skala, the author of MoleSter, and my name was spelled correctly in the item I submitted about this.

    1. Re:Slashdot editors strike again! by Anonymous Coward · · Score: 1, Interesting

      wtf why did you pick "molester' as the name for your product. how about michaeljacksonster?

    2. Re:Slashdot editors strike again! by greenfly · · Score: 1

      I'd be careful. If this program becomes popular, your name might be the first one to come up when someone searches for "molester" and if people use the app to trade kiddie porn you are in even more trouble :p

    3. Re:Slashdot editors strike again! by John+Bokma · · Score: 1

      Couldn't email you, but foreach can be written as for, and do you need the side effects of & for the sub calls? Otherwise that one can be dropped too.

  13. I can beat that by Anonymous Coward · · Score: 5, 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.

    1. Re:I can beat that by idontgno · · Score: 2, Funny
      I have discovered a truly marvelous demonstration of P2P that this margin is too narrow to contain.

      --Fermat's Second-to-Last Conjecture

      --
      Welcome to the Panopticon. Used to be a prison, now it's your home.
    2. Re:I can beat that by Zugok · · Score: 1

      wow, that's incredible bandwidth!

      --
      "I just can't sit while people are saying nonsense in a meeting without saying it's nonsense" J Watson, Sci Am 288:(4)51
    3. Re:I can beat that by AbbyNormal · · Score: 1, Informative

      Or 22 bucks at Netflix and you magically get 3 cds out at a time, delivered to your door, from a rather large library. Ultimate laziness.

      --
      Sig it.
    4. Re:I can beat that by Anonymous Coward · · Score: 0

      Ha... check the price... It's been reduced to 18 per month.

    5. Re:I can beat that by Kethinov · · Score: 1

      Margins be damned.

      The parent poster is jokingly referring to Fermat's Last Theorem which states that xn + yn = zn has no non-zero integer solutions for x, y and z when n > 2. He then wrote, "I have discovered a truly remarkable proof which this margin is too small to contain."

      Fortunately we live in a society where we can figure this stuff out for ourselves. In 1995 Andrew Wiles and Richard Taylor proved Fermat's Last Theorem and published their proof in the Annals of Mathematics.

      Just wait a few centuries. Someone will discover your truly marvelous demonstration on their own, they will!

      --
      You're right, I wouldn't steal a car. But if it were possible, I sure as hell would download one!
    6. Re:I can beat that by legirons · · Score: 1

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

      Well if it's GPL, I ought to contribute a patch... "Passing it across the fence"

    7. Re:I can beat that by furballphat · · Score: 1

      thanks for the heads up

    8. Re:I can beat that by Anonymous Coward · · Score: 0

      You used to get beaten up a lot at school, didn't you?

    9. Re:I can beat that by kid-noodle · · Score: 1

      You leeching bastard! ;)

      --
      fortune -o
    10. Re:I can beat that by Monkelectric · · Score: 1

      Actually, us old timers called that "Sneaker Net"...

      --

      Religion is a gateway psychosis. -- Dave Foley

  14. I'm waiting by stuffduff · · Score: 0, Offtopic

    I'm waiting for the mod chip for my game console.

    --
    "Can there be a Klein bottle that is an efficient and effective beer pitcher?"
  15. I bet 13 of those lines... by Anonymous Coward · · Score: 5, Funny

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

    1. Re:I bet 13 of those lines... by 3terrabyte · · Score: 1

      That was funny! Maybe kazaa is only 15 lines of real code, 400 million lines of malware?

      --

      Why are there only 19 people folding@home for slashdot?

  16. Oh yeah? by KillerDeathRobot · · Score: 1, Funny

    Well I can write "Pointless story" in one line.

    --
    Thinkin' Lincoln - a web comic of presidential proportions
    1. Re:Oh yeah? by Stween · · Score: 1

      Oh come on, this is clearly a joke. Mod up!

  17. A filesharing client named moleSter.. 'molester'? by Anonymous Coward · · Score: 0

    umm.. methinks, not the best name for it

  18. No Napsta Land by zoftie · · Score: 0

    Sure beats Shawn Fanning's code quality and its cross platform!

  19. MoleSter? by Mad_Rain · · Score: 5, Funny

    From the webpage: Every time I look at the word "molester" my brain tries to parse it as "mole-ster" instead of the agentive of "to molest", and now I have an excuse to name a piece of software MoleSter, so I'm going to use it.

    I think that the RIAA and MPAA are going to get a lot of positive spin when people start reading that they're going after all the MoleSters on the Internets.

    --
    "What do you think?" "I think 'What, do you think?!'"
    1. Re:MoleSter? by LiquidCoooled · · Score: 3, Funny

      9 line molesters at that.

      The most worrying part is on the site, he challenges people to make smaller molester clones.

      --
      liqbase :: faster than paper
    2. Re:MoleSter? by Anonymous Coward · · Score: 0

      Matthew Skala mentions this:

      "Won't naming this "MoleSter" give the four-letter organizations ammunition for claiming that file sharers are sexual predators?

      Since this code isn't really much use for actually sharing multimedia files, I think it's unlikely that they will consider MoleSter a threat worth pursuing. Opponents of file-sharing software would probably prefer not to draw any attention to the educational points made by MoleSter."

    3. Re:Molester? by fr2asbury · · Score: 1

      Yeah, that's why I have a tiny camp stove called the "Pocket Rocket." *snicker*

    4. Re:MoleSter? by Webmonger · · Score: 2, Funny

      Maybe he can join forces with the author of EtheRape.

    5. Re:MoleSter? by Anonymous Coward · · Score: 0

      'Scuse me, I'm off to write some P2P apps.

      "Kittens And Puppies"
      "Your Kids"
      "The RIAA"
      "The Republican Party Of The USA"

      This way, you can get all your illegal media supplied by The Republican Party Of The USA and The RIAA. In breaking news, the MPAA has vowed to destroy all Kittens And Puppies, and wipe out Your Kids.

    6. Re:MoleSter? by Brendan+Byrd · · Score: 1

      In the tradition of T-Shirt Hell: the new geek shirt "I Swear...I didn't know she was 9 lines."

  20. Bah! That's nothing! by Anonymous Coward · · Score: 0

    I have just DESTROYED a MINUS TEN line P2P program!

  21. Re:Matt Scala? by Reckless+Visionary · · Score: 1
    who, this guy?

    or did you mean Scalia?

    --
    I think I'll stop here.
  22. Re:China: 15 Lines of Piracy by Anonymous Coward · · Score: 0

    Go away, stupid troll. Take your anti-Chinese rantings elsewhere. We're sick of them and we don't care.

  23. Oh yeah, I got it in 2 lines of shell: by Anonymous Coward · · Score: 4, Funny

    #!/bin/bash
    ### ToDo: Write P2P app here

    1. Re:Oh yeah, I got it in 2 lines of shell: by Anonymous Coward · · Score: 0

      Ofcourse you mean..

      #!/bin/sh

      if [ $# == 1 ]; then
      torrent $0
      else
      echo "Usage: $0
      fi

    2. Re:Oh yeah, I got it in 2 lines of shell: by Anonymous Coward · · Score: 0

      Quick, post it to SourceForge!

    3. Re:Oh yeah, I got it in 2 lines of shell: by Anonymous Coward · · Score: 0

      What about this, then ?

      #!/bin/bash /usr/bin/amule

    4. Re:Oh yeah, I got it in 2 lines of shell: by gotmemory · · Score: 1

      "It's okay to require invoking the interpreter outside of your byte count (thus, no charge for a "#!" line at the start) but not to use other external utilities that have to be exec()ed, nor infrastructure like shell builtins (unless you're writing it in shell..)" 1 line!

    5. Re:Oh yeah, I got it in 2 lines of shell: by SenatorOrrinHatch · · Score: 1

      Now imagine if it said:

      ### ToDo: Prosecute war half a globe away

      and plus, instead of your program crashing, a million people get blown up!

      A million MORE that is!

      There, now we have a 1-1 mapping from programmer's brain to gov't officials brain.

      --
      The Christian in me says it's wrong, but the corrections officer in me says, 'I love to make a grown man piss himself.'
  24. Re:Matt Scala? by RailGunner · · Score: 1
    I doubt there's any relation between Matt Scala and Supreme Court Justice Antonin Scalia.

  25. Yeah he's a laugh riot by Anonymous Coward · · Score: 0

    Molestation and child abuse are hee-larious. Keep sending out the laughs, mr funny computer nerd.

  26. He could be liable... by vivin · · Score: 4, Insightful

    But according to this article from a story that was posted on Slashdot yesterday:

    But if next July's anticipated Supreme Court ruling in the MPAA/RIAA vs Grokster/Streamcast goes in favour of the movie and music industries, the heat is going to be on any technology, no matter how benign the intentions of its developer, that nevertheless makes piracy possible.

    Which is rather stupid and obtuse. If you're trying to pioneer a novel way to transfer data, then it could be used for piracy. Anything that transfers bits and bytes around can be held liable. So setting this precedent is just PLAIN STUPID. How far will *AA go? Let's say this precedent had already been established... then they could go after Brian Cohen. They could hold him responsible for create an application "makes piracy possible, regardless of his benign intentions". This way the *AA could crush anything that they see as a potential threat.

    --
    Vivin Suresh Paliath
    http://vivin.net

    I like
    1. Re:He could be liable... by Anonymous Coward · · Score: 0

      oh I see...

      then I should get rid of this here ftp.exe program?

    2. Re:He could be liable... by mpaon · · Score: 1
      How far will *AA go?

      For one, the FAA can go quite a long way. :)
    3. Re:He could be liable... by Anonymous Coward · · Score: 0

      Lets suppose that was true.

      Blogs would have to go.
      NYT would have to go. (looking good so far)
      Wikis and forums would have to go.
      Google would have to go.
      Slashdot would have to go.

      Infact, any interactive website would have to go.

      Why? because of the ability to do something like this:

      ---Begin-p2p---
      Filename: RandomRIAASong.mp3
      Superhash: 10011100
      Chunk: 099/204
      Data: 9083452389abba383439dd9e0334834
      ---End-p2p---

      Or would they leave data providers alone and just go after the content creation tools?
      I could use google to find all the chunks of a file and put it back together without worrying about it.

    4. Re:He could be liable... by raehl · · Score: 4, Insightful

      This way the *AA could crush anything that they see as a potential threat.

      Hrm... like an operating system that enables file duplication and networking?

    5. Re:He could be liable... by Wybaar · · Score: 1

      Hmm ... you could make a case that CD/DVD manufacturing equipment makes piracy possible ... including the CD/DVD manufacturing equipment the MPAA and RIAA member companies (or the manufacturing companies they hire) use to stamp the CDs. It would be a shame if those companies couldn't use their equipment to stamp CDs for RIAA member companies, or even more interestingly, for Microsoft ... you don't think they create each Windows XP CD individually, do you?

      Individual artists could also make the case that, for example, sound mixers could allow the major record labels to "accidentally" include their copyrighted material in with another artist's songs, and therefore should be banned. This could get interesting.

      --
      Y|
    6. Re:He could be liable... by Jahf · · Score: 1

      I wish someone at the MPAA/RIAA/U.S. Congress would see the analogy between a script like this and, say, a photocopy machine or CD burner.

      Conversely, I would -love- to see them go after Xerox or Panasonic/Sony/etc.

      Yeesh.

      --
      It is more productive to voice thoughtful opinions (reply) than to judge (moderate) others.
    7. Re:He could be liable... by Pax00 · · Score: 2, Insightful

      But if next July's anticipated Supreme Court ruling in the MPAA/RIAA vs Grokster/Streamcast goes in favour of the movie and music industries, the heat is going to be on any technology, no matter how benign the intentions of its developer, that nevertheless makes piracy possible.

      Which is rather stupid and obtuse. If you're trying to pioneer a novel way to transfer data, then it could be used for piracy. Anything that transfers bits and bytes around can be held liable. So setting this precedent is just PLAIN STUPID. How far will *AA go? Let's say this precedent had already been established... then they could go after Brian Cohen. They could hold him responsible for create an application "makes piracy possible, regardless of his benign intentions". This way the *AA could crush anything that they see as a potential threat.


      Well I am glad I didn't invent speach, written word, copy machines, printing presses, casset tapes, floppy disks, etc etc etc

    8. Re:He could be liable... by iminplaya · · Score: 1

      I suppose the developers better not put their name anywhere on their projects anymore to stay off the radar. How far will the *AA go? As far as we let them. We must continue working to insure that our communications can remain anonymous and indecipherable to those not invited. The law be damned. Let's make it impossible to enforce. The crazier they get, the bigger the eventual backlash. We should provoke them so that the rest of the world can see how ludicrous the whole IP thing is, and how it has screwed us over(details all over the net) for the last 300 years.

      --
      What?
    9. Re:He could be liable... by IO+ERROR · · Score: 1
      But if next July's anticipated Supreme Court ruling in the MPAA/RIAA vs Grokster/Streamcast goes in favour of the movie and music industries, the heat is going to be on any technology, no matter how benign the intentions of its developer, that nevertheless makes piracy possible.

      I doubt this will happen. There's plenty of precedent in U.S. case law for this. If the technology has significant legal uses, for which it was designed, then it's safe. BitTorrent does indeed have significant legal uses (distributing free ISOs comes to mind) and was designed for that sort of thing, so it's extremely doubtful Bram Cohen or BitTorrent will be in any legal trouble.

      --
      How am I supposed to fit a pithy, relevant quote into 120 characters?
    10. Re:He could be liable... by Biogenesis · · Score: 1

      So by there logic since they define piracy they cause it's existance therefore they should be destroyed?

    11. Re:He could be liable... by UranusReallyHertz · · Score: 1

      In the real world this kinda shit has been struck down. Gun makers aren't liable for what people do with the guns, knife makers aren't liable, hell even junkfood makers aren't liable.

      --
      Smoking is an expensive, slow, and unreliable method of suicide.
    12. Re:He could be liable... by kubrick · · Score: 1

      Seriously, they would if they could.

      Also, Apple's "Rip. Mix. Burn." advertising campaign didn't win them too many friends among the RIAA members...

      --
      deus does not exist but if he does
    13. Re:He could be liable... by RM6f9 · · Score: 1

      Mr. Boros, please allow me to introduce Mr. Ouro;
      Mr. Ouro, Mr. Boros.

      I'm certain the two of you have much to discuss...

      --
      Take the 90-Day Challenge! http://rwmurker.bodybyvi.com/
    14. Re:He could be liable... by drinkypoo · · Score: 1

      your link displays poor href etiquette. your text implies a link to windows while the link is to the company. anyway you missed something else important that windows xp does; it provides for automatic wardriving by alerting you to available wireless networks.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  27. Re:A filesharing client named moleSter.. 'molester by Anonymous Coward · · Score: 0

    Yeah, I would have called it Michael Jackson.

  28. or in BASH: by Anonymous Coward · · Score: 4, Funny

    #! /bin/bash

    cd /src/mldonkey/distrib/

    # --- start mldonkey ---
    ./mlnet

    1. Re:or in BASH: by RevDobbs · · Score: 1

      also in shell script:

      #!/bin/sh
      /usr/sbin/httpd
      /usr/libexec/ftpd

      The whole point of a network is moving data... if the RIAA/MPAA had any sense, they'd be suing DARPA & Al Gore.

  29. ThinkGeek by Lord_Dweomer · · Score: 4, Funny
    And cue ThinkGeek tshirt slashvertisement in 5...4...3...

    --
    Buy Steampunk Clothing Online!
  30. Whose side is he on again? by Tackhead · · Score: 0, Troll
    > Matthew Scala, a reader of Freedom to Tinker, has responded with the 9 line MoleSter, written in Perl."

    Senator Orrin Hatch (Disney-Utah) thanked Mr. Scala for helping to prove his point that P2P was all about molestation and vowed to redouble his efforts to eliminate this erototoxin-spreading technology from the face of the earth.

    "First Napster - encouraging the taking of naps, a clear incitement to sloth. Now MoleSter - whose purpose is obvious to anyone who reads its name. And these demon-possessed perverts even have languages for it now; they write in 'python' - the language of the Serpent, and they write in 'perl' - a blasphemous reference to the Biblical story of casting pearls before swine. When, oh, when, will our cries be heard? When, oh, when will we be permitted to protect our citizens from such debauchery? When, oh, when, will the check from MPAA and RIAA clear? We must fight terroristm, because it's for the children!"

    1. Re:Whose side is he on again? by Hamster+Of+Death · · Score: 1

      Why modded troll?

      Can you moderators not see the sarcasm dripping off this post?

      I think I'll install napster. I'm tired and I could use a nap at the moment.

    2. Re:Whose side is he on again? by Anonymous Coward · · Score: 0
      > Can you moderators not see the sarcasm dripping off this post?

      Perhaps today's moderators are the sort of folks who think "satire" is the answer to the question "whas the black rubba thing onna wheel?"

  31. Code Size vs. Regulation... by MP3Chuck · · Score: 1

    I don't see the correlation. Were p2p be made illegal(or whatever ... it's hypothetical), it wouldn't really matter whether it was 15 lines or 15 thousand lines.

    1. Re:Code Size vs. Regulation... by 2nd+Post! · · Score: 1

      The only correlation is that the program is so simple in concept that it is essentially stupid to ban.

      The ultimate in stupidity along these lines is if the RIAA and MPAA got PROGRAMMING banned as an activity because programming languages and tools induces copyright infringement.

    2. Re:Code Size vs. Regulation... by Anonymous Coward · · Score: 2, Interesting

      The link is intent. The notion that the RIAA/MPAA have is that makers of P2P applications are doing something complex and difficult, and so banning P2P applications isn't a big deal--it's a specialized activity that's hard to do, and it's relatively easy to police, and to demonstrate intent on behalf of the programmer.

      The goal of showing tha P2P applications are easy to write and can be extremely small is to say that you really can't ban P2P without banning the ability to transfer data over the internet in general. The idea here is that what's "core" to a P2P ap isn't all the fancy bells and whistles--it's a pretty simple and straightforward concept.

      The idea here is that if someone wanted to ban text editors, since they could potentially be used to copy down copyrighted information. They may say that their war is with Microsoft, and specifically Word. But the point is that you don't have to be Microsoft to write a text editor, and all those bells and whistles Microsoft writes aren't what makes it a word processor--it's the really simple concept of modifying text in a file. "edit" isn't nearly as complex, but does the same thing. The problem isn't with the big pieces of software but with the underlying concept.

    3. Re:Code Size vs. Regulation... by almostmanda · · Score: 1

      During prohibition, bottles of grape juice came with labels warning those who bought them not to do this, this, and this because that would turn it into wine, and wine is illegal. If you don't think it's morally wrong, and it's easy to do and hard for authorities to control, laws aren't going to stop you.

      It's not about legality, it's about enforcement. If p2p is THIS easy, it's gonna be hard to fine or imprison everyone who does it, ever. There's only limited amounts of man-power to spend fighting anything illegal, and I doubt much concern is going to be thrown about over 15 lines of code, similar to one person turning a bottle of grape juice into wine.

    4. Re:Code Size vs. Regulation... by imsabbel · · Score: 1

      killing somebody is so simply, too. You dont need complicated guns, your fists and feet do it, too. So dont you see how stupid it is to ban killing people?

      --
      HI O WISE PRINCE. WHT TOOK U SO DAM LONG?
    5. Re:Code Size vs. Regulation... by Kusunose · · Score: 1
      I think you missed the point. If a method used to do an illegal act is so simple to have, banning it or creation of it is stupid. You should just ban the act.

      When killing can be achieved with your fists and feet, it's stupid to ban the posession of fists and feet or creation of people who has them (giving birth). Just ban the killing.

  32. Baah...that's nothing by GillBates0 · · Score: 3, Funny
    Here's a one-line P2P application I wrote in whitespace:

    /*following code does p2p transfer*/

    --
    An Indian-American Hindu committed to non-violent thought/speech/action alarmed by the global explosion of radical Islam
    1. Re:Baah...that's nothing by snorklewacker · · Score: 1

      > Here's a one-line P2P application I wrote in whitespace:

      Just add this to the top of MoleSter instead:

      use Acme::Bleach;

      --
      I am no longer wasting my time with slashdot
    2. Re:Baah...that's nothing by Ziviyr · · Score: 1

      You think thats something...

      Heres an artificial intelligence program that will solve all the problems of humanity, then creat an off-world robot colony which will turn around and wage war against us. Its written in nulls, here it goes...

      ""

      And don't include the quotes when inputting this code.

      --

      Someone set us up the bomb, so shine we are!
    3. Re:Baah...that's nothing by Alsee · · Score: 1

      Here's a one-line P2P application I wrote in whitespace:

      Oh yeah? Well i wrote a one(really really REALLY long)-line P2P application in Brainfuck:

      Lameness filter encountered. Post aborted!
      Reason: Please use fewer 'junk' characters.


      Aww FUCK!

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
    4. Re:Baah...that's nothing by tepples · · Score: 1

      Can you post it on some Geocities site and link it here?

  33. P2P tattoo by Lord_Dweomer · · Score: 3, Interesting
    So I know that you can encode entire programs on barcodes. Well, could someone have a tattoo with this barcode on it for the program and carry it with them wherever they go? Even a temporary tattoo would be cool. Wearable computing takes on a whole new meaning, plus, you'd never be without access to free media.

    --
    Buy Steampunk Clothing Online!
    1. Re:P2P tattoo by pegr · · Score: 1

      Well, could someone have a tattoo with this barcode on it for the program and carry it with them wherever they go? Even a temporary tattoo would be cool. Wearable computing takes on a whole new meaning, plus, you'd never be without access to free media.

      Well, erasing and reusing could be a problem. And you could definately run out of space, though I guess you could eat more to increase your media size!

    2. Re:P2P tattoo by phreakv6 · · Score: 1

      So I know that you can encode entire programs on barcodes. Well, could someone have a tattoo with this barcode on it for the program and carry it with them wherever they go? Even a temporary tattoo would be cool. Wearable computing takes on a whole new meaning, plus, you'd never be without access to free media.

      I cant wait to take a look at my girlfriend's face when she sees me with the barcode for kazaa code all over me.duh

      --
      fifteen jugglers, five believers
  34. Isn't that interesting. by ServerIrv · · Score: 0, Offtopic

    The fact that it's only 15 lines long, doesn't really say anything. How efficient is it? I've fallen into that trap before. Given the same language, a program isn't necessarily more efficient because it has fewer lines. Did you use a vector when a simple array would have worked? Even better, screw using multiple files, because then you don't have to include any inheritance or extra lines for accessing variables in another file. Just create programs with one file. I'm not trying to insinuate that I'm the programming god, but there is sometimes a difference between a well crafted program and a program with a small codebase.

    1. Re:Isn't that interesting. by Anonymous Coward · · Score: 0

      It's moronic pricks and trolls like you that don't even stop to comprehend the content of what they respond to that are the worst of discussion forums everywhere.

      This is not a discussion of efficency. It is of how little effort is required to construct P2P apps in light of various intentions to ban P2P.

  35. Time for an IOPC.org? by wedgehead · · Score: 0

    Does this mean it's time for an International Obfuscated Python Code Contest? (only slightly obfuscated reference to the International Obfuscated C Code Contest )

  36. Duh factor (me, not you) by JCOTTON · · Score: 1, Funny
    Excuse me for asking, but this article implies that you need to have "python" running to use the 15 line code. Here is the command line:

    python tinyp2p.py password server hostname portnum [otherurl]

    I believe that the python interpreter (i am assuming that it runs like an interpreter) may be larger than 15 lines.
    It also assumes that you have a web server running on your box. What other assumptions are unique to this app? That you have a url defined as a domain?

    In other words, I really couldn't run this from a DOS prompt, could I? So, it doesn't really count as a "program". Does it compile into an exe? If not, then what is this article talking about?

    1. Re:Duh factor (me, not you) by Jerf · · Score: 1

      In other words, I really couldn't run this from a DOS prompt, could I? So, it doesn't really count as a "program".

      I hate to do this but: LOL.

      You need to (metaphorically) get out more.

    2. Re:Duh factor (me, not you) by Anonymous Coward · · Score: 0

      It's trivial to show that anything you run in an interpreter could have been complied into a exe.

      And we don't count the complexity of the compiler when we talk about the complexity of a c++ program, do we?

    3. Re:Duh factor (me, not you) by Anonymous Coward · · Score: 0

      Did you actually read the article? You don't need a web server on your box. And the point of the program is to show how simple it is to write a P2P program with already available utilities and that everyone could do it. Everything this program uses is in Python's Standard Library, so...

    4. Re:Duh factor (me, not you) by Anonymous Coward · · Score: 0
      Ehm. Ofcourse you can run it from a DOS prompt. You just need to install python first.

      Please count the lines of source for the following code:

      int main() {
      printf("Hello, world\n");
      }
    5. Re:Duh factor (me, not you) by magefile · · Score: 1

      And I can't run Office, or Halo 2, or 1/2 Life 2, from a bash prompt, but that doesn't mean that they don't count as "programs".

    6. Re:Duh factor (me, not you) by Anonymous Coward · · Score: 1, Insightful
      In other words, I really couldn't run this from a DOS prompt, could I? So, it doesn't really count as a "program".

      OMG.

      Seriously, don't ever post on developers.slashdot.org again.

    7. Re:Duh factor (me, not you) by Anonymous Coward · · Score: 0

      Poof! DENIED!!

      Seriously click on the his link and see his resume, he's serious folks:

      HARDWARE AND SOFTWARE SKILLS

      Hardware:IBM-PC, 3090, 308x
      Languages:ASP, ASP.NET, VB.NET, Visual Basic, HTML, JavaScript, COBOL, CICS
      Op. Sys.:Windows 9x, Windows NT, DOS, MVS/XA
      Databases:Microsoft Access, DB2 including admin (DBA), VSAM, SQL
      Utilities:BMS, TSO, ISPF, EASYTEST, PANVALET, LIBRARIAN, RACF, XPEDITER
      Microsoft:Word, Excel, Access, InterDev, SourceSafe, FrontPage

    8. Re:Duh factor (me, not you) by XO · · Score: 1

      err.... /home/eblade# wine ~/windows/msoffice/word.exe

      There we go ;)

      Not that I actually own word, or have copies of it, because I don't. I don't own anything microsoft, except a mouse.

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    9. Re:Duh factor (me, not you) by magefile · · Score: 1

      Not that I actually own word, or have copies of it, because I don't.

      One could argue that wine is analogous to a VM in this case ... and that since it is required in order to run Word (on *nix), its length should be included.

    10. Re:Duh factor (me, not you) by cbiltcliffe · · Score: 1

      Three.

      And two of them were copied from SCO!!

      --
      "City hall" in German is "Rathaus" Kinda explains a few things......
    11. Re:Duh factor (me, not you) by Anonymous Coward · · Score: 0

      I wouldn't mess with this guy, he's worked for the IRS!

  37. Actually, yes. by Kozz · · Score: 5, Informative

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

    --
    I only post comments when someone on the internet is wrong.
  38. plausible deniability without encryption? by twentycavities · · Score: 1

    Concerning suing users...if someone were to make something like Freenet, only without encryption, would the plausible deniability thing still work? For example, if Soulseek automatically downloaded a Britney Spears song onto my harddrive, then uploaded it to someone else. I'm not really the "true source" of the file, right? Whatever. Discuss!

    --
    Monstromart: Where shopping is a baffling ordeal
    1. Re:plausible deniability without encryption? by YrWrstNtmr · · Score: 1

      If Soulseek automatically d/led a Britney Spears 'song' ont my hard drive, I'd sue them for gross idiocy and abusing my senses.

    2. Re:plausible deniability without encryption? by magefile · · Score: 1

      If you installed it with the intent of providing files that you knew were going to be infringing, it'd still be illegal, and the program would only be acceptable if you approved what went on your box. I think. IANAL, NDIPONTV.

  39. What about the libraries? by Jerrry · · Score: 1

    15 lines, sure, but how many lines of code are in the libraries it imports? More than a few, I suspect.

    1. Re:What about the libraries? by Anonymous Coward · · Score: 0

      Think about it - if you go down that path, any program written has thousands upon thousands of lines of code becuase of the numerous system libraries they use. And the code in the BIOS. And the micro-code in the CPU.

      More than a few, I suspect :s

    2. Re:What about the libraries? by Aeiri · · Score: 1

      How many lines are in stdio.h?

  40. In C#... by Swamii · · Score: 1

    class _{static void Main(){System.Console.WriteLine("Hello world!");}}

    --
    Tech, life, family, faith: Give me a visit
  41. Proof of concept... by d-man · · Score: 2, Funny

    ...that Perl is a true write-only language.

    --
    Unix: Where /sbin/init is still Job 1.
    1. Re:Proof of concept... by Abcd1234 · · Score: 1

      *Insightful*?! Are you kidding? Flamebait, maybe. Damn, in that case, given the IOCCC, there are hundreds of examples of how C is a write-only language.

    2. Re:Proof of concept... by rhaig · · Score: 1

      and you can read that python???

      so much for "it's impossible to write unreadable python"

      --
      "We are not tolerant people. We prefer drastically effective solutions"
    3. Re:Proof of concept... by XO · · Score: 1

      I couldn't even comprehend the "readable" version of the Perl one. Gave me a freakin headache, and it isn't full of ``````````''''''''' like most Perl scripts i've seen are.

      I've never even looked at Python before, and I could kinda follow it a little.

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
  42. Must have... by bcrowell · · Score: 1

    ...the T-shirt!

  43. Well... by Blue-Footed+Boobie · · Score: 1

    Molester? I hardly knew her!

    --
    DAMN YOU OCTODOG! DAMN YOU TO HELL!
  44. Unlikely? by simpl3x · · Score: 4, Insightful

    Until it's required to have DRM in the OS... And, bans on malicious code... Perhaps a ban on compilers...

    Unlikely isn't the word I'd use when we have people who have no clue as to what they're talking about. They'd think they were banning viruses!

    Moderate funny ha ha.

    1. Re:Unlikely? by tepples · · Score: 1

      They'd think they were banning viruses!

      If you think you can legislate viruses out of existence, try telling that to the heads of the Centers for Disease Control and Prevention.

  45. Nice Try, Mr. Felten! by smug_lisp_weenie · · Score: 5, Funny

    Our lawyers are currently perfecting a new TinyLawsuit specifically to defeat your invention. You will like it- Only _10_ lines of legalese!

    The ball is now in your court, Mr. Felten!

    Regards, The RIAA/MPAA

    1. Re:Nice Try, Mr. Felten! by moonbender · · Score: 1

      You will like it- Only _10_ lines of legalese!

      Not a chance. Even Hello World takes up more than that in Legalese.

      --
      Switch back to Slashdot's D1 system.
    2. Re:Nice Try, Mr. Felten! by Anonymous Coward · · Score: 1, Funny

      I'll be happy to sign the TinyPaycheck their going to get. It only has one digit, and it's binary.

    3. Re:Nice Try, Mr. Felten! by Anonymous Coward · · Score: 0

      I made it to a self-modifying legalese-code!

  46. Re:Cheaters, both. by Anonymous Coward · · Score: 0

    By you reckoning, you'd need to write the BIOS code as well - don't nit pick.

  47. Gotta love Perl by johansalk · · Score: 1


    Here is the Perl p2p one

    $p=shift;$a=shift;i(shift);use Socket;socket S,PF_INET,SOCK_STREAM,6; bind S,&a($a);listen S,5;$/=undef;while(@ARGV&&($_="$p $a f".shift)|| accept(C,S)&&($_=)&&close C){m!^(.*?) (.*?) ([e-i])([^/]*)/(.*)$!s&& $1 eq$p&&&$3($2,$4,$5);}sub e{open F,'>',$_[1];print F $_[2];close F} sub f{&s($_,@_)foreach keys %k}sub g{open(F,');close F}sub h{&s($_[0],$_,'i')foreach keys %k}sub i{$k{ $_[0]}=1}sub a{$_[0]=~/^(.*):(\d+)$/&&$2>2e3&&sockaddr_in($2,in et_aton( $1))}sub s{socket X,PF_INET,SOCK_STREAM,6;$w=shift;if(connect X,&a($w) ){print X "$p $_[0] $_[1]/$_[2]";close X}else{undef $k{$p}}}

    1. Re:Gotta love Perl by Man+in+Spandex · · Score: 1

      If Richard Simmon's hair could be done in ascii, that's what it would look like.

    2. Re:Gotta love Perl by prisoner · · Score: 1

      Holy shit! It's hard to believe that this actually does something. I've written quite a bit of code and Lisp is the only language I've used that looks as screwy as this....

    3. Re:Gotta love Perl by mmusson · · Score: 1

      C looks just as bad if you remove all whitespace and put multiple statements on a line.

      --
      SYS 49152
  48. If Michael was editing today... by Anonymous Coward · · Score: 1, Insightful

    ...he'd have modded you down to (Score:-1, Makes Me Look Bad) already.

    Do all Slashdot editors check the comments for criticism of themselves, or is it only Michael Sims? If so, they must have a heap of free time.

    1. Re:If Michael was editing today... by Anonymous Coward · · Score: 0

      I don't think anyone but Michael actually has thirty negative remarks about them in every article they post...

  49. Re:China: 15 Lines of Piracy by Anonymous Coward · · Score: 0

    > Chinese believe that they are entitled to steal softare (i.e. there is nothing wrong with stealing).

    Intellectual property (sic), by nature, cannot be stolen. Your right to run a program is not denied by whoever copies the said program from you. They aren't even stealing credit from Microsoft since they do not remove any copyright holders.

    The whole concept of property regarding intellectual work is flawed, no wonder there are so many people still trying to define the undefinable.

  50. Re:Cheaters, both. by Anonymous Coward · · Score: 0

    Shut up. Please.

  51. Mickey mouse does not write the Law by Anonymous Coward · · Score: 1, Insightful

    People Do

  52. Um, what point is this trying to make? by Dan+East · · Score: 2, Insightful

    TinyP2P requires you specify the server address and port. Um, how is this different then FTPing to a server? Or sending a file over some IM service? Or copying a file over a network share?

    I thought the real point of p2p, as in file sharing, was the ability to search many hosts for something, even though you do not know what hosts exist, ideally without even requiring a central server the hosts must register with.

    Dan East

    --
    Better known as 318230.
    1. Re:Um, what point is this trying to make? by Anonymous Coward · · Score: 0

      The point is preciecly the one you make--transferring data via P2P isn't much different than transfering it via FTP, HTTP, etc.

      The claim is that P2P software, by it's very nature is an inducement to infringe copyrights, and so ALL P2P programs MUST be banned.

      The author's point is that's like arguing that Python, by it's nature, is an inducement to infringe. Or that TCP, by it's nature, is an inducement to infringe. Or Perl.

      Basically, the question is where exactly you'd draw the line with the RIAA/MPAA's argument where P2P could somehow be banned without banning the internet, most programming langauges, or computers themselves....

    2. Re:Um, what point is this trying to make? by Anonymous Coward · · Score: 0

      The point is that it does not rely on central storage, or in some cases on a central server at all. The data doesn't come from a datacenter over blazing-fast fiber, it comes from a computer more like yours with no special claim. This means the server and its bandwidth can be smaller.

      The helper services in P2P software -- discovery of peers, search of files available, etc -- can be implemented P2P or client-server, depending on what you're looking for. Client-server allows some centralization and organization, which might be desirable; P2P allows you to be self-organizing and have no central dependency, if that's a virtue for what you're doing.

    3. Re:Um, what point is this trying to make? by twistedcubic · · Score: 2, Interesting


      TinyP2P requires you specify the server address and port. Um, how is this different then FTPing to a server? Or sending a file over some IM service? Or copying a file over a network share?

      But, does there exist an ftp server you can trust? Seems like all of them have a root exploit discovered periodically. Likewise with the IM programs. However, 15 lines of code is pretty easy to audit.

    4. Re:Um, what point is this trying to make? by Anonymous Coward · · Score: 0

      > TinyP2P requires you specify the server address and port. Um, how is this different then FTPing to a server?

      Because by connecting to one server, you access all connected servers. Dynamic discovery and combining the server into the client is left as an exercise to the reader.

    5. Re:Um, what point is this trying to make? by Anonymous Coward · · Score: 0

      Both TinyP2P and MoleSter already include dynamic discovery of peers. You only need to specify one peer to get started; the software can then find out about other peers and search them.

    6. Re:Um, what point is this trying to make? by Anonymous Coward · · Score: 0

      Try ncftpd.

    7. Re:Um, what point is this trying to make? by Q2Serpent · · Score: 2, Insightful

      Go do some reading. Once you connect to one host, you can get files that any other connected host has on your "network". All of the connected peers share files. See? Peer to peer file sharing.

    8. Re:Um, what point is this trying to make? by Spy+der+Mann · · Score: 1

      I thought the real point of p2p, as in file sharing, was the ability to search many hosts for something, even though you do not know what hosts exist, ideally without even requiring a central server the hosts must register with.

      That's right... The *AA should be searching to ban P2P *NETWORKS*. That's what Napster was about, right?

      An actually good moderated P2P Network would have a database of filenames, hashes and descriptions be submitted. That way, if a user shared an illegal file, the moderators could ban the user.

    9. Re:Um, what point is this trying to make? by SiliconEntity · · Score: 1

      TinyP2P requires you specify the server address and port. Um, how is this different then FTPing to a server?

      I hate it when people write "Um". It always sounds insulting.

      If you read the documentation, you would see that TinyP2P does in fact search many hosts. When you start a server, you give it the URL of another server in the darknet. Then, all the data being served by all the servers in the darknet is available to each client. Even though the client connects to only one server, it can download files that are available from any of the servers.

      One implication is that each user could run a server himself, as a daemon, and then connect to his own server using the client. This would be the classical peer to peer mode. Anything being shared by any of the peers can be retrieved by any of them. Or it can be used in a client-server mode where the servers are running on well connected machines and then clients can connect to a nearby server to do a download.

  53. On a side note... by kaedemichi255 · · Score: 1

    What are some other relatively useful applications with very few lines of source code? Looking at the provided links, it has really gotten me interested!

  54. Why not just put it on one line? by Anonymous Coward · · Score: 0

    It's completely unreadable as it is, why not just forget carriage returns and claim the "P2P in ONE line of code!".

  55. Size shouldn't deter regulation by Woogiemonger · · Score: 1

    Peer to peer tech aside, we regulate far simpler actions every day, or at least attempt to. We have laws against shoplifting, far simpler than writing a 9 to 15 line program. We have laws against pedophiles seducing little boys on the internet. That, I assume, is less complicated than writing a 9 line program. These laws don't catch everyone, but they do serve as a deterrent.

    Why wouldn't laws against P2P apps be effective? I think that the recent crackdowns on file sharing HAS had a significant impact, and I personally am careful about what I download now, because my cable company (Cablevision) sends me a fat envelope with network monitoring logs showing what I downloaded that they think is copyrighted.

    1. Re:Size shouldn't deter regulation by Anonymous Coward · · Score: 2, Insightful

      Because the laws that prohibit shoplifting DON'T prevent you from walking into a store on the theory that MAYBE you might shoplift. They also don't prevent stores from putting merchandise on display on tables near the entrance on the theory that MAYBE that might make it easier for shoplifters. It's the SHOPLIFTING that's the crime.

      The point is the RIAA's argument in the Grokster case isn't about the fact that people trading filed ILLEGALLY is against the law. Their argument is that P2P programs INDUCE people to break the law, and so should be banned--it's not an attack on the people acting illegally but the MEANS to possibly do so.

      To go back to your shoplifting argument, this would be the RIAA arguing that shopping malls have to be banned because they create an environment that makes shoplifting easier. See the problem?

  56. Overhead Is Obviously Not A Consideration by Anonymous Coward · · Score: 0


    So how many pounds of operating systems does it require?

    I am fond of coding, but am not impressed.

    When one can prove something useful with 4K RAM, circa '60s, then I will take notice.

    --
    one of your retired teachers

  57. Molester? by MyoTechie · · Score: 1

    From the article ...don't pronounce it as three syllables. Every time I look at the word "molester"...

    This is a good reason that companies have IT AND Marketing departments...

  58. 2 lines of bash by blixel · · Score: 1

    #!/bin/bash /usr/bin/WhatHeSaid.py

  59. Size matters by AviLazar · · Score: 1

    and each line was over 5,000 characters long...

    --

    I mod down so you can mod up. Your welcome.
  60. Perl is clearly better by dodongo · · Score: 1

    but far be it from me to pick sides; I program in Java ;)

  61. 4 lines of code!!! See below!!! by Anonymous Coward · · Score: 0

    Line 1 - LDA#torrent
    Line 2 - STA#torrent
    Line 3 - INC
    Line 4 - DELRIAAFUCKSLASHDOT

  62. English is shorter... by raehl · · Score: 1

    #!/usr/bin/english
    use Acronyms;
    print "P2P";

    1. Re:English is shorter... by tepples · · Score: 1

      Analogy to English is to define P2P in terms of other words, given that the MPAA is suing to get P2P taken out of the Acronyms package.

  63. ugh by ProfKyne · · Score: 4, Funny

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

    --
    "First you gotta do the truffle shuffle."
    1. Re:ugh by Anonymous Coward · · Score: 0

      Does it? I read through it and was surprised to grok a fair bit of it. In contrast, small-for-the-sake-of-it perl (which I know equally less of) and C (which I am more comfortable in than python) programs usually lose me within the first couple of characters. There's a bit of functional stuff that should make a lot more sense to me than it does (ie: I suspect in this circumstance I'm more lame than it is unreadable - hey I'm currently trying to improve my functional skilz though so lay off! :) ). Even with that you can get a good idea of it.

    2. Re:ugh by ProfKyne · · Score: 1

      No. It's almost readable compared with assembly language, or Perl, perhaps. You shouldn't be able to "grok a fair bit" of Python, you should be able to pretty easily figure out what's going on without even knowing the language. That's one of the big draws of Python. I really couldn't have put it better than Bill Baumgartner.

      --
      "First you gotta do the truffle shuffle."
  64. Molester by KrackHouse · · Score: 1

    Did this remind anybody the Therapists Jeopardy skit with a fake Sean Connery on SNL?

    --
    What if Digg added local news and a Slashdot inspired comment karma system? ---
    http://houndwire.com
  65. Yet Another Social Network Service by eventDriven · · Score: 1

    Put this together with WyPy, an 11 line python wiki, and you have the beginnings of a 36 line YASNS.

  66. It's obvious how they'll respond to this by ShatteredDream · · Score: 1

    They'll just make it illegal to write and publish software without an engineering license. Afterall, no one but freaks does anything complicated and non-sensual for fun...

    Old timers tend to not understand the concept of collaborative coding. My dad is a good example. One time he just looked at me and said that who in their right mind would right a program and NOT charge for it?

    1. Re:It's obvious how they'll respond to this by geekoid · · Score: 1

      " One time he just looked at me and said that who in their right mind would right a program and NOT charge for it?"
      Collabortive coding has nothing to do with charcing. It is just a method for coding a program.
      I have been doing collabortive for years...they're called teams.

      He does have a point. How many plumbers fix pipes for free? If the company I work at stopped compensating me, I would stop coding for them.

      It is nice to know that If IBM called you up to do a big project that would involve hundreds of thousands of lines of code you wouldn't charge them.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  67. Speaking of small.. by Xeo+024 · · Score: 1

    Anyone remember The Product? It's a 63.5 kb first person shooter. Pretty neat.

    Slashdot covered it a few months ago.

  68. Both these programs are full of BS by markdj · · Score: 3, Insightful

    Both these programs remind me of the obfuscated C program contest of years ago. They put multiple lines of code on one text line and use cryptic variable names to save space. They try to be cute to be small. Let's see how small a program can really be written if it is written in a decent style understandable by all. Not everyone knows the more arcane python and perl syntax. But a competent programmer could decipher it if written in a good style. The comment that "any moderately skilled programmer can write one" is BS if it has to be written so cryptically that only the interpreter/compiler can decipher it.

    1. Re:Both these programs are full of BS by markdj · · Score: 1

      I never meant to say that tightly coded programs are difficult to write or because of that P2P is difficult. What I was decrying was that we should be proud of so tightly coded programs. Write them to be understandable by humans as well as machines and then be proud of how small one can be written. The fact that these two programs can be unwound and better written into about 20-30 lines of code still makes them small and marvels of what they do.

    2. Re:Both these programs are full of BS by swiftstream · · Score: 2, Informative

      Years ago?

      This year saw the 17th International Obfuscated C Code Contest. There's some fun stuff in there.

      --
      Be a PATRIOT--because the only thing we have to fear is the lack thereof.
    3. Re:Both these programs are full of BS by punxking · · Score: 2, Interesting

      With all due respect, can we mod the parent obtuse? I'm honestly not trying to troll or flame, but the self-righteousness of the parent post is a bit much considering the whole point was how quickly and easily a p2p app could be created (and by extension then discarded when need be). Whether or not the code is elegant is entirely beside the point. It could even be argued, given that something of this nature is potentially being created to circumvent certain rules or regulations, that the whole point is to make it such that only the interpreter/compiler can decipher it.

      --
      You can have my cynical agnosticism when you pry it from my cold, dead logic.
    4. Re:Both these programs are full of BS by markdj · · Score: 1

      Elegance is not the point. If you think I am obtuse and missing the point, so are others who rave about how small these programs are. I just think that before one raves about how good one's program is, it should be understandable to others. That doesn't require elegance. It IS a big deal that a small program many programmers could write can do P2P. If you want to drive home the point to the uninitiated (those who don't know perl, and python) then write the program so others can read it, understand it and appreciate it. It doesn't take a lot of elegance, nor that many more lines of code.

    5. Re:Both these programs are full of BS by klang · · Score: 1

      RTFA ... The programmer has a fully documented version of the program, and even states the reasons for his tightly packed code.

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

      But writing ultra-short code is fun even if it's silly. No other justification is necessary.

      The reasons?
      Who needs reasons when you got root?

  69. Its not about code by Anonymous Coward · · Score: 1, Insightful

    The issue here is quite philosophical. The very nature of the internet is peer to peer. Media pushers still live in the 20th Century world of a broadcast model and think the internet is like television/radio. It is not, and never will be.
    Until they swallow that simple fact and get out of denial a lot of people are gonna waste a lot of money and time paying for unworkable broken laws.

  70. T-Shirts by gr8_phk · · Score: 1

    That's where the T-shirts with code on them come into play.

  71. P2P too efficient and useful to MPAA to destroy by cryptochrome · · Score: 2, Insightful

    Not only will they not go after Bram and BT because it's just shifting bits around (they might as well go after FTP), I wouldn't be surprised if someone tried to hire him or they built off of exisiting code. BT-style file transfer is just far too efficient and effective to stifle, and with a few modifications could make Video-On-Demand viable.

    Hell, the only reason I can see why Apple's iTunes/Quicktime division isn't all over him already is because they're probably cooking up their own software, service, and hardware on their own.

    --

    ---If you can't trust a nerd, who can you trust?

    1. Re:P2P too efficient and useful to MPAA to destroy by Mike+Rubits · · Score: 1

      He WAS hired - he works for Valve now.

    2. Re:P2P too efficient and useful to MPAA to destroy by Reducer2001 · · Score: 1

      Someone did hire Bram. He's working for Valve software now. Working on Steam, I believe.

      --
      When you get to hell -- tell 'em Itchy sent ya!
    3. Re:P2P too efficient and useful to MPAA to destroy by cryptochrome · · Score: 1

      I hate to reply to my own post (why why why won't /. let us update/edit them) but I managed to find another link I was looking for. I didn't talk about Apple for no good reason - I think drunkenblog hit the nail on the head with this post.

      --

      ---If you can't trust a nerd, who can you trust?

  72. So what? by Microlith · · Score: 1

    I honestly don't believe people here think clearly, whenever a copyright holder goes after people violating their rights they get all up in arms.

    Fact is, I doubt they give two shits about P2P, except that the most popular services are carrying materials they haven't authorized for distribution. If it were about controlling distribution methods, they'd have demanded the entire internet be made illegal years ago.

  73. Won't run by Saeger · · Score: 2, Funny
    My new computer won't run that python p2p app for some odd reason, even though Python is installed.

    I get the following error:

    TCPA ERROR #12: Unsigned script execution blocked; Trusted Computing violation sent to MS-Patriot Log Authority.

    Can anyone help?

    --
    Power to the Peaceful
    1. Re:Won't run by Anonymous Coward · · Score: 0

      d00d you have to install a modchip to run 0-day pirate appz. just like on xbox

    2. Re:Won't run by Anonymous Coward · · Score: 0

      You need to get a developer license if you want to run unsigned code. They start at only $20,000 per year. Well within the reach of any responsible software company that matters.

    3. Re:Won't run by XO · · Score: 1

      What the hell moron moderated this Insightful? I've got mod points, but I've already posted in this thread, so I can't fix it.. Jesus, don't you guys ever -read- posts?

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
  74. Surprize surprize! by bennomatic · · Score: 3, Insightful
    So programs are only actually "programs" if they can be executed from MS DOS? Wow. Tens of thousands of Mac apps are now not "programs". Some of the most popular software in the world are not "programs".

    I guess the people who wrote them are "appers" or "scripters" or "serverers" or "clienters". Certainly not "programmers", since they're not writing "programs".

    OK, I'll stop now. I'm sure you've had the error of your ways pointed out many times. It's OK to make a mistake; what I'm really amused by is the fact that your post has been modded "Interesting".

    --
    The CB App. What's your 20?
  75. You bastard you!! by psamty · · Score: 1

    Making Pretty Python look like Ugly Perl!! Tsk, tsk... Python Golf has been officially outlawed by moi!!

  76. Ban programming unless licensed by the gov! by Anonymous Coward · · Score: 0

    Honorable Representative/Senator

    We the undersigned hope you pass this law to outlaw unregulated programming. Think of the children who are harmed daily so we urge you that you must pass this law so people can't code on their own except under governmental regulations.

    Respectfully
    **AA

  77. Parent is -1, Redundant by miltimj · · Score: 4, Informative

    If you'd read Skala's website, you'd see he already addresses your weak argument:

    You're using Socket.pm, and it's huge, that's cheating!
    Read the fucking code. I'm only using Socket.pm for its defined constants (such as SOCK_STREAM). I could easily eliminate Socket.pm, and save probably another 20 bytes or so, by replacing those constants with the numbers they represent; I have not done so yet only for portability's sake - it might make my code Linux-specific and I'd like to avoid that.

    --
    "Truth is not decided by majority vote" consensus gentium -- Norman Geisler
    1. Re:Parent is -1, Redundant by sicking · · Score: 2, Funny

      You're using Socket.pm, and it's huge, that's cheating!
      Read the fucking code.


      How the hell am I supposed to be able read that code?

      --
      Failing to learn from history dooms you to repeat it.
    2. Re:Parent is -1, Redundant by Anonymous Coward · · Score: 0

      With your eyes.

      -TLMA
      (Too Lazy to Make an Account)

  78. P2P w/0 lines of code. by Anonymous Coward · · Score: 0

    WFW3.11 was P2P. XP has the same functionality as WFW3.11 when it comes to file sharing P2P.

    You have Client Server or P2P. If the files are stored on one large server, it's obviously Client Server. If the files are distributed among many clients, it is P2P.

    If I share my \\pc\c and you share \\yourpc\c and we swap files, we are doing P2P - using Windows with 0 lines of code.

    Point being, if you ban ALL P2P application, Windows is banned. And there is no way to ban ALL P2P traffic as it doesn't look any different from any other traffic. I can do P2P over HTTP tunnels, for example, or STunnel.

  79. Mods: try again please. by Penguinoflight · · Score: 1
    This is in fact likely to happen, and I find the write-up humorous. Orrin Hatch is disliked by geeks as a whole. Disney has pushed copywrite terms to a ludicrus time.

    Here's a title explanation from the article:

    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. Every time I look at the word "molester" my brain tries to parse it as "mole-ster" instead of the agentive of "to molest", and now I have an excuse to name a piece of software MoleSter, so I'm going to use it.
    --
    "And we have seen and do testify that the Father sent the Son to be the Savior of the World"
    1 John 4:14
  80. Re:Cheaters, both. by Anonymous Coward · · Score: 0

    RTFA...

    Quothe Matthew Skala:

    "You're using Socket.pm, and it's huge, that's cheating!
    Read the fucking code. I'm only using Socket.pm for its defined constants (such as SOCK_STREAM). I could easily eliminate Socket.pm, and save probably another 20 bytes or so, by replacing those constants with the numbers they represent; I have not done so yet only for portability's sake - it might make my code Linux-specific and I'd like to avoid that."

  81. I wrote my P2P app in... by tunster · · Score: 1

    ... 0 lines of code. see it here... http://IKnowTelepathy.com

    1. Re:I wrote my P2P app in... by Clete2 · · Score: 0

      Or you could simply network the computers together and copy the files the old-fashioned way :).

    2. Re:I wrote my P2P app in... by WWWWolf · · Score: 1
      .. 0 lines of code. see it here... http://IKnowTelepathy.com

      P2P using Telepathy? Be careful, not only might the music and movie industry sue you, but that Sollog guy might get annoyed as well...

  82. Guns don't kill people by electrichamster · · Score: 2, Funny

    Rappers do.

    1. Re:Guns don't kill people by matticus · · Score: 1
  83. The best one line by kn0tw0rk · · Score: 1

    # All your files are belong to me :)

    --
    See my art -> http://herbevore.deviantart.com
  84. REBOL by netless · · Score: 1

    it would take only one line in rebol probably.

    and no external libs

    1. Re:REBOL by deadzaphod · · Score: 1
      I haven't tried doing a minimal P2P program in rebol yet (I'll probably try it tonight), but I got the webserver down to 308 characters
      secure[net allow library throw shell throw file throw %. [allow read]]p: open/lines tcp://:80 forever[attempt[s: length? b: read/binary to-file next pick parse pick c: p/1 1 none 2 write-io c b: rejoin[#{}"HTTP/1.0 200 OK^M^JServer: Rebol^M^JContent-length: "s"^M^JContent-type: text/html^M^J^M^J"b]length? b close c]]
  85. Gaim Plugin by hamlet2600 · · Score: 1

    Given its small size and the notion behind it of a small network of friends accessing files shared solely for eachother, with some effort could this be the start of the Downhill Battle file sharing proposal?

    --
    Sometimes I wish computers were less friendly.
  86. I think you mean Bram by toby · · Score: 2, Funny

    Brian Cohen was, however, the eponymous hero of Monty Python's Life of Brian. Bloody Romans.

    --
    you had me at #!
  87. P2P ? by abertoll · · Score: 1

    So I take it by his comments that P2P == VPN ? After all, his own description of his software is a VPN.

    --
    "he drew his sword Ringil that glittered like ice... and he wounded Morgoth with seven wounds..."
  88. Obfuscated Python contest? by saddino · · Score: 1

    Next up, obfuscated binary:

    0100101111010110
    1001101010111101
    010101010101 0101
    0111100010010111
    ...

  89. FTP by Anonymous Coward · · Score: 0

    Attempting to ban P2P is rediculous.

  90. Are you related to? by CYDVicious · · Score: 1

    On Skala's page he addresses the question: "Are you related to US Supreme Court Justice Scalia, or some other person with a name equal or similar to "Scala"? No. The correct spelling of my name is all over this Web site." Scrolling to the bottom of that Web site page reveals: "Copyright © 2004 Matthew Skala" To which then reveals /. mispelled Mattew's last name ;) in this story. ~CYD

    --
    //Nothing to see here, please move along.
  91. Banning P2P is just plain stupid by beelsebob · · Score: 1
    I am just as capable of pirating things using P2P as I am using a web server and a web browser. Or using a samba share, and a samba client... Or using raw bit streams across a network... Or going round to a neighbours and getting them to copy it for me. The point is that P2P is not the problem. The problem is that people are willing to break the law, and do.

    Bob

  92. I perfer my by geekoid · · Score: 2, Funny

    "Friend Gives me movie to return to rental place and I forgot to go to the rental place" method.

    I get more movies that way.

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

      but less friends.

  93. Release Candidate 2 by lxt · · Score: 2, Funny

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

  94. Also a valid entry for the Obfuscated Code Contest by d_jedi · · Score: 1

    http://www.ioccc.org/ ..

    if only this were written in C!

    Seriously, though, if anyone working for me wrote code like that.. they'd be fired.

    --
    I am the maverick of Slashdot
  95. Get this to the Supreme court by Free_Trial_Thinking · · Score: 1

    Someone needs to get all this kind of information to the US supreme court before they hear that Grokster case. They need to have a technical understanding of this stuff.

    Professor Lessig,

    I was also thinking you could write an amicus curie brief for the court on this case. What do you think? Maybe someone could send the justices some of your books too like "free culture"?

    People start getting this info the the supreme court. Also could someone get this comment to Dr. Lessig?

    --
    Sorry I'm half joking here, but the justices do need to see stuff like this somehow.

  96. 15 lines? Yeah, but... by Spy+der+Mann · · Score: 1

    From the article:

    (Each line has 80 characters or fewer. The first line doesn't count -- it's a label for human readers and is ignored by the computer.)

    Oh great. It was the ONLY line I could understand!

    Hey I wouldn't have minded if the author wrote a *READABLE* version of the program! It looked more like a contestant for the obfuscated C programming contest.

  97. Simple... he doesn't use any... by Anonymous Coward · · Score: 0

    RTFL.

    He actually talks about that problem on the webpage. The only thing he imports is Socket, and he only uses the constants from it, to maintain cross-platform compatibility. If he dumped the Use Socket line and changed the constants to the numbers they represent, it'd still work but might become Linux specific.

  98. *AA? by giantsfan89 · · Score: 1

    So setting this precedent is just PLAIN STUPID. How far will *AA go? Let's say this precedent had already been established... then they could go after Brian Cohen. They could hold him responsible for create an application "makes piracy possible, regardless of his benign intentions". This way the *AA could crush anything that they see as a potential threat

    I don't know about you, but I'm thinkin the FAA will be pretty ticked.

    --
    Don't ping my cheese with your bandwidth!
  99. huh? by Anonymous+Custard · · Score: 1

    the 9 line MoleSter, written in Perl.

    That can't be perl, there's comments and explanations all over it!

  100. Look closer... by Anonymous Coward · · Score: 0

    I thought the real point of p2p, as in file sharing, was the ability to search many hosts for something, even though you do not know what hosts exist, ideally without even requiring a central server the hosts must register with.

    That's just what these programs are doing. You connect to any host on the network, then can search and download files from any other hosts on the network. No central server.

    A connects to B.
    C connects to A.
    D connects to C.
    D and B can now search for and share files.

    These programs implement that. They are both client and server. That's what P2P is all about.

  101. I hope he's got a good job. by SmittyTheBold · · Score: 3, Funny

    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

    --
    ± 29 dB
    1. Re:I hope he's got a good job. by Anonymous Coward · · Score: 0

      Try actually typing "Matthew Skala" into Google. He's already on record for other things much more potentially damaging than MoleSter.

    2. Re:I hope he's got a good job. by aminorex · · Score: 0, Flamebait

      What's wrong with paedophilia? You would prefer misopaedy? Paedophobia? Paedophiles are people who like children. People who aren't paedophiles should never have children. If no one was a paedophile, the human race would end! Do you want to be responsible for that? People were hung for much less at Nuremburg.

      --
      -I like my women like I like my tea: green-
  102. Who needs code to share files? by Shimmer · · Score: 1

    In Windows, just create a public share on your C: drive. As long as you're not blocking port 445, you can trade files with the whole world that way.

    I'm not saying this is a good idea, just pointing out that you don't need to write a program to do it.

    --
    The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
  103. Line length metric... by FirstTimeCaller · · Score: 1

    This idea of number of lines seems like an odd/arbitrary metric to me. I took a look at MoleSter and I am impressed with its conciseness. But 9 lines seems somewhat arbitrary, as the lines are simply packed and reformated to fit in a certain width.

    It seems to me that number of statements would be a better metric (semi-colons in perl?). For MoleSter this would be about 25 statements (without punishing for subroutines). This method has the advantage of not punishing for using longer variable/function names.

    Of course, it is always debatable exactly what constitutes a statement in each particular language.

    --
    Wanted: witty unique signature. Must be willing to relocate.
    1. Re:Line length metric... by statemachine · · Score: 1

      This idea of number of lines seems like an odd/arbitrary metric to me.

      It's based on an 80 character line width, commonly used for command-line terminals.

  104. They're trying to hold the people who write such apps liable for the criminal behavior of others. It's like suing Ford because a drunk driver killed your kid or suing Lorcin because some psychopath shot your wife.

    Right! It's like suing a gun manufacturer for a hold-up. These tiny P2P programs are the spud guns of file sharing!

    1. Re:Spud! by Anonymous Coward · · Score: 0

      Thats exactly my response!

      P2P is a technology nothing illegal about technology!

      It'd be like taking the person who invented gun powder to court cause its used in guns to kill people which is illegal.

      Stupid Acros (MPIAA, RIAA, etc)

  105. 9 lines is nothing... by Anonymous Coward · · Score: 0

    Did anyone show him how to change the font size and reduce the border size? Maybe also change the kerning and i think we should be able to get that code down to 3, who knows maybe even 1.

  106. Source code Tshirt by slapout · · Score: 1

    Can we sell T-shirts with this code on them? Go nuts, it's public domain. But please don't lead your customers to believe that I'm getting a cut of the proceeds unless you give me one.

    But then won't they have to make the source code available to people who buy the shirt?...Oh wait, it's not GPL...nevermind

    --
    Coder's Stone: The programming language quick ref for iPad
  107. That's perfect! by nazsco · · Score: 2, Insightful

    i never liked email anyway

  108. Didn't MSN have file transfers? by Spy+der+Mann · · Score: 1

    Technically, That's P2P, mind you.

  109. How about, P2P In 2 Lines of... by lazynothin · · Score: 1
    commands?

    Hello people, remember a little command called 'nc'?

    receiving end: nc -p <ListenPort> -l > <FileReceived>
    sending end: nc <IPofReceivingEnd> <ListenPort> < <FileToSend>

    If you're thinking, "the python and perl scripts do much more"... I'm sure you could be creative in your shell scripting to accomplish the same thing using 'nc'. I have, and it works smooth as butter every time. The reason I bring NetCat into the discussion is not to shy folks away from these python and perl scripts. Truth be told, you will benefit in many more ways with the two interpreters vs 'nc'. However, 'nc' is such a small footprint. By using 'nc' you don't have to worry about python or perl being installed. Just a single loney powerful binary file called "nc".

  110. Where's the skill.... by DrStrange · · Score: 1

    ...in taking a program and just removing all the newlines and saying "hey, I did a P2P program in 9 lines"? Its not really 9 lines, its 9 visual lines but far more executable lines.

  111. Here's my one-liner to get anything I want online by Anonymous Coward · · Score: 0

    http://www.froogle.com

  112. I wrote a Java version of this a while back... by KwaiChangLee · · Score: 0

    I needed to move some data off some IBM hardware that was falling apart (literally) onto my new eMac. For various reasons I couldn't just connect a cable between them. So I connected the laptop to my old dialup isp (in another state) and the eMac I had on ADSL. In total I moved about a gig of data with it.

    Don't be too impressed with the Perl version, its actually 42 lines long, but then condensed down to 9 lines through the power of removing whitespace and line breaks.

    Also, from the sounds of it, the Java version beats the living sh!t out of the Perl version as far as performance goes. :D Booyah!

    So here's my Java version (of the mac client, the serversocket was trivial). I don't think this was the final version, so it might have some bugs, but its close. For comparison it would be about 17 lines of code by the way those guys are counting. Total characters with whitespace (but not linebreaks) removed: 1248. It could be made even smaller if I wanted to, eg choosing one letter variable names, not being in a package... you know the drill. I removed the comments to get a better idea of the number of characters.

    package rick.network; import java.io.*; import java.net.*; public class DocPuller { public static String baseDir = "//users//******//laptop//"; public static String laptopAddress = "203.221.67.2"; public static int docsock = 1234; public DocPuller(String fileName) { try { File f = new File(baseDir + fileName); Socket sock = new Socket(laptopAddress, docsock); sock.getOutputStream().write((fileName + "\n").getBytes()); readFile(sock, f); } catch (Exception e) { System.out.println("oops: " + e); } } public static void main(String[] args) { try { if (args.length == 0) { System.out.println("Address: " + InetAddress.getLocalHost()); return; } } catch (Exception e) { System.out.println("oops: " + e); } DocPuller dp = new DocPuller(args[0]); } public void readFile(Socket sock, File f) { try { FileOutputStream fos = new FileOutputStream(f, true); byte[] ba = new byte[100000]; BufferedInputStream bufin = new BufferedInputStream(sock.getInputStream()); int n = 0; n = bufin.read(ba); while (n == ba.length) { fos.write(ba); fos.flush(); n = bufin.read(ba); } if (n > 0) { fos.write(ba, 0, n); fos.flush(); } fos.flush(); fos.close(); } catch (Exception e) { System.out.println("problem while reading/writing file: " + e); } } }

    1. Re:I wrote a Java version of this a while back... by Anonymous Coward · · Score: 0

      Nice.

  113. Heh - 13 lines, take that Python! by KwaiChangLee · · Score: 0

    It feels good to layeth the coding smack down. :D

  114. Can we really free P2P? by fccoelho · · Score: 2, Insightful

    Tinyp2p proves that software aspect of p2p networking is accessible to the vast majority of us and that means that the IP police will never have a single simple target to chase.

    But it is the hardware part of p2p that is scary. All p2p networks can come down if our broadband providers decide to block the ports normally used for it or to take any other restrictive measure.

    The right to digitally communicate and associate, is seriously at risk! I have wrote more extensively about it here: http://slashdot.org/~fccoelho/journal/

  115. Molester? by Max+Threshold · · Score: 1

    Is that the network for kiddie pr0n?

  116. "But is it legal?", asked my professor... by Cryofan · · Score: 1

    ....I also wrote a very small p2p program while I was getting my CS degree in Houston (UHD). It was written in perl and was written specifically for a one-tome demonstration for a pre-senior project class. It was specically written for a particular computer lab/classroom at the school.

    I told one of my professors there what I was doing, and he replied, "But is it legal?"

    In reply to him, I say, yes, Ongard, it is legal. At least so far....

    --
    eat shiat and bark at the moon
  117. no, you have to audit more by Anonymous Coward · · Score: 0

    But it's not "15 lines of code" you have to audit.

    It's those 15 lines, plus the python runtime, plus the source code of the imports: import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac.

  118. Well..... by Savage+Conan · · Score: 1

    ...the government has banned growing a plant (marijuana) which any fool can do with very little effort (or no effort if the wind blows in your favor). For some reason I don't think ease of commiting the act is going to stop a law from being created.

  119. Python version more compact by Anonymous Coward · · Score: 0

    The Perl version is not a more compact achievement. As usual, it just packs a number of Perl statments on one "line." The Python version is more honestly compact *and* more understandable.

  120. It's Proof of something bigger. by Retep+Vosnul · · Score: 0

    The whole debate ( and silly court cases ) about p2p is reaching critical mass soon.
    But is the p2p concept not a simple fact'o'life In this generation ?
    An unstopable thing that the "old" folks fight just like "we" shall fight new things when we get around to it later ?

    It's the 50's just with broadband !

    --
    -- forget /. It's gone.
  121. Glaring Security Hole? by lilmouse · · Score: 1

    Excuse me, but I think the e() has a pretty glaring security hole: What happens if the expected file is called ~/.muttrc? I could lose all my mail!

    Or if it's "molester"? Aha...arbitrary code execution the next time he starts his client!

    --LWM

  122. Cute, but... by 91degrees · · Score: 1

    I don't think anybody is seriously expecting to ban P2P anyway. Bittorrent is genuinely used to distribute Linux distros, foe example, and I wouldn't be surprised if there have been a number of legitimate CDs made available legitimately by amateur bands and movie makers

  123. Your sig... by Anonymous Coward · · Score: 0

    I modded this comment based on your sig. Yes, I know you're not supposed to do that, but I love irony too much. Besides, what the heck else am I gonna do with all these mod points? They give me new ones every other day! ;)

    1. Re:Your sig... by Jahf · · Score: 1

      If you reply to a thread all of your mod's get deleted ... while your reply to me was Anon, I'm guessing you replied to someone else on the thread in person ... so in the end you didn't mod me you replied just as I wanted !

      --
      It is more productive to voice thoughtful opinions (reply) than to judge (moderate) others.
  124. krs-one put it best by asciiRider · · Score: 1

    'everything is legal if the government can see you' - krs-one

  125. This could be useful in China by ColGraff · · Score: 2, Insightful

    These mini-P2P programs may not be useful for serious media sharing, but I can think of a real-world application - distribution of banned text (articles, newspapers, etc.) in the PRC and other repressive states. The software's tiny - small enough that anyone with Python or Perl installed could just keep the program on a folded sheet of paper, type it in when they want to use it, and delete the program when they were done. If you got in trouble, just burn the paper.

    --
    I'm the stranger...posting to /.
  126. P2P is the marijuana of the 21st century by Simonetta · · Score: 2, Insightful

    P2P is the marijuana of the 21st century in the sense that it is an activity done by millions of people who don't think there is anything wrong with doing it. And it has been (actually in this case, will be) made illegal by clueless legislators prompted by outlandish claims by business groups.
    Now you have a classic situation where a vague law can be focused on a large group of people for political reasons. Individuals can be selected either randomly or because of their unrelated political activities or beliefs and be fed into the legal machinery for the 'criminal' activity of using P2P.
    Given the for-profit corporate prison industry in the USA and the oversupply of greedy lawyers, this looks like a new profit center focused on young people in the same way that the marijuana industry turned out to be extremely profitable for the lawyer-corporate prison coalition.
    Make P2P vaguely illegal.
    Make it incredibly easy to do.
    Select 100 young people at random.
    Check for P2P activity.
    If yes, offer them a deal:
    go to prison for your 'crime'
    (the corporate prison makes $30,000 per year)
    -or-
    pay a $10,000 fine to the RIAA and turn in several friends doing P2P. (keeps the chain going).
    -or-
    pay a lawyer $20,000 and get probation. ($10,000 goes to the lawyer and $10,000 goes to the judge), along with turning in several friends using P2P.

    You can see how this can become very profitable for the lawyers, RIAA, and prison corporations. Each will make sizable bribes (campaign contributions) to politicians to keep the laws against P2P quite strict, in the name of fairness to musicians and artists.

    1. Re:P2P is the marijuana of the 21st century by Senobyzal · · Score: 1

      Wow. I thought I was cynical when it came to corporate America and the U.S. government, but sir, I bow before a true master.

  127. Got it down to 12.... by frenetic3 · · Score: 1
    import base64,zlib,sys
    exec compile(zlib.decompress(base64.decodestring("""\
    eJxtUk1vnDAQve+vcDnNKBbJpu3FEqdeWylqVKkSQpED9q4lMG hsWPbfd2zYNGp6QBjPm3kfgxum
    kaII1yDFyM+zG6be/P7x/e fTt2dDiyEp1qGnqe3dqxRkpDgPuj1oktNFkgmiEsDdpabTIns9 vHZa
    zCphSm8ub6X62MgZy7NZO3cyIQJycxmMpvaMh2m9yjWP euMqN/YnGrn2UVX58QoPnbGiDzBVRYGK
    TJzJC+v6aAh2ZV5x NZVHYi8MlR7lGMrehdg5Aj6eTGwvHSDiwVmhqX5sPlUFSzI+Fu ogxHD9JScK
    MtCSFBfnGCd1f1/cMfZzc1eofPrSyNT8VTW3VF a1smFW+mJHMiyYOXhcEj0RrFXdoBK7aqjhKpzn
    QkDBWvld6m kyvoMrCu4Xubw2qXhEoX2XMPu4Fvy7UTfvVgmwJRnN5qSwZduP wSSfwBkZbkGsHxoe
    Yau9g9OROic2XYBtIzIPAPiqesCNEjRy lvnqmK9qXoDGJgXcpuIuSc8nmN+LmqsqTdyVs4zNJvCv
    wMDS AlPOKB84aqgZ2WCelaC5p04Tw5ZFSFmk71RlD5hc3GyHRYWFbZ 94xYZe7Ozb6EYPVha2yKy8
    SAgL57AGgLxE6XyEvERMtIljpj 4vhOVlyC5xO7PMtL2UHUOtT8h/fzw/RpELHBDnvxml/maVT/Io
    d87kIU3768I6ZV15IRfN/zofpfVbhIy6LXbbq/WyuLQF4h87 dj4w""")),'','exec')
    Yeah, I know it's only 3 lines better, but thought I'd do my part for the forces of good :P

    (remove spaces first, save as a .py and call using the arguments given in the TFA)
    --
    "Where are we going, and why am I in this handbasket?"
  128. I'm waiting for by excaliber19 · · Score: 1
    the P2P language:

    p2p.Make() p2p.Connect(myFriends) p2p.Share(pr0n) p2p.Hide(New Regex("[[:alpha:]][[:alpha:]]AA")) p2p.Rawr();

    Look! 5 lines of filesharing goodness!

    1. Re:I'm waiting for by excaliber19 · · Score: 1
      and of course i forgot the formatting...

      p2p.Make()
      p2p.Connect(myFriends)
      p2p.Share(pr0n)
      p2p.Hide(New Regex("[[:alpha:]][[:alpha:]]AA"))
      p2p.Rawr()

  129. But that makes... by Anonymous Coward · · Score: 0

    Soylent Green illegal!

    Soylent Green is illegal! Everybody! Stop eating it! Soylent Green is illegal!

  130. COUNTDOWN ABORTED by Anonymous Coward · · Score: 0

    COUNTDOWN ABORTED

  131. A more legible version of tinyp2p.py by dstone · · Score: 5, 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)

    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.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 B1ackDragon · · Score: 1

      I rather like the TinyP2P way of doing things, running small networks connected together by running several simultaneous servers in a directory. I'd possibly like to tinker around with this, but unfortunately I don't know python... do you know of any links to english explanations of what this program is doing?

      Or.... maybe I should just learn Python ;-)

      --
      The snow doesn't give a soft white damn whom it touches. -- ee cummings
    2. Re:A more legible version of tinyp2p.py by Anonymous Coward · · Score: 0

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

      Oh yeah? Well, with Perl I could do it with 5 lines of code!

      #!/usr/bin/perl -w
      use strict;
      use myp2plibrary;

      my $net = new myp2plibrary;

      As long as you're using a bunch of libraries I don't think it should count as really being that tiny. Though there are some nice algorithms in there.

    3. Re:A more legible version of tinyp2p.py by Anonymous Coward · · Score: 0

      #!/bin/bash gaim

  132. I can write a P2P program in 1 line of code... by ActionJesus · · Score: 1

    It will however be several million characters long.

  133. I can do it in one. by Col.+Bloodnok · · Score: 1

    /etc/init.d/nfs start

  134. Re:In Java... by Anonymous Coward · · Score: 0

    public class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Die C# Die");
    }
    }

  135. Tiny P2P? Tiny Poetry. by Zephiris · · Score: 0

    Haiku about 15 line P2P app, only 3 lines. ^_^

    Slowly Spinning Peers,
    Ugly, but Minimized.
    Exercise in Small.

    --

    "A Goddess rarely smiles for she is forced by others to be an island unto herself." - Zephiris
    1. Re:Tiny P2P? Tiny Poetry. by Anonymous Coward · · Score: 0

      "Ugly, But Minimized" is 6 syllables.

      Try Minimalized.

      8/10: A- keep up the good work!

  136. In other news... by failrate · · Score: 1

    The RIAA and MPAA are now suing eyeballs, because they can be used to watch pirate movies, ears, because they can be used to listen to downloaded mp3s, and brains, because they can be used to store the above without paying licensing or royalties.

    --
    Voodoo Girl is the bomb!
  137. Maybe We Are All Missing the Point by Anonymous Coward · · Score: 0

    Maybe we are all missing the point, as just about every post above me includes "your missing the point" in it somewhere. Alternatively, maybe we have different points!

    As for this argument about what the point is, in my opinion it has nothing to do with how much cheating his code has in it and everything to do with that p2p isn't hard to do, as he claims the point is.

    (point-point-ah, my eye!)

  138. So... by nmb3000 · · Score: 1

    Anyone have a public IP and any good pr0n they want to share?

    --
    "What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
    /)
  139. Future headlines by Atario · · Score: 1

    RIAA And MPAA Team To Crack Down On Secret Piracy Tool: "Copy" Command

    --
    "A great democracy must be progressive or it will soon cease to be a great democracy." --Theodore Roosevelt
  140. Yeh. line. by Kanasta · · Score: 1

    Everything stuffed together to be a :line:
    I'm sure it can all be put into 1 line depending on the language. So what? How about measuring in the number of operations?

  141. P2P and getting payed by N3wsByt3 · · Score: 2, Interesting

    I'ts all very insteresting to read about this, but I'm wondering... seems creating P2P is very simple, yet why takes it so long for people to take up the chalenge of making a 'small social network' P2P-system?

    Wasn't it on this veryè same slashdot, that not too long ago an article was mentioned about a site who was willing to pay a considerable amount of money to any coder willing to work on a OSS P2P system annex IM which was meant to be used in a small network of friends, and thus, below the radar of RIAA and co.

    I gather the author in question isn't very interested in money, at least compared to 'status among peers' (something that seems to be typical of good coders working on OSS projects, like Linus). But I can't imagine that NO coder (at least the last time I checked) has taken that offer up for 1000 bucks, while this one makes a simple P2P prog in a matter of days, just to prove a point, or even just for the fun of it.

    I'm not sure how it was called again, but some probably will remember and maybe post a link to it...now, the only thing to find are skala-type dudes - and getting a nice bonus on top. Volunteers?

    --
    --- "To pee or not to pee, that is the question." ---
  142. Doesn't surprise me! by DNX+Blandy · · Score: 1

    I gotta admit that that's pretty kewl but it's so easy to write P2P software, I write me own Chat, SE Reporting, URL Ripping software, it's so simple. I even go as far as to develop my own encryption algorithm based on RC4 but seriously modified, e.g. rather than having a Key of 256, (0 - 255), I have 65026, (0 - 65025), with a lesser percentage of 0 ascii codes than RC4.

  143. did I ever show you my two line Web Server by pyrrho · · Score: 1

    I wrote it in bash.

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

    --

    -pyrrho

    1. Re:did I ever show you my two line Web Server by pyrrho · · Score: 1

      damn. here it is, I don't want you to miss it.

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

      --

      -pyrrho

  144. If this were a MUD I'd say: by SenatorOrrinHatch · · Score: 1

    Man, those guys must be lvl 40 coders who have amulets of quick typing +8!

    How many lines do we need to program a mind nowadays?

    --
    The Christian in me says it's wrong, but the corrections officer in me says, 'I love to make a grown man piss himself.'
  145. Golf! by jonadab · · Score: 1

    I managed to shave off a few strokes, getting it down to eight lines
    (at no more than 80 chars per line). I'm sure someone can do better,
    but here's what I've got so far:

    $p=shift;$a=shift;i(shift);use Socket;socket S,PF_INET,SOCK_STREAM,6;bind
    S,&a($a);listen S,5;$/=$3;while(@ARGV&&($_="$p $a f".shift)||accept(C,S)&&($_=
    <C>)&&clo se C){m!^(.*?) (.*?) ([e-i])([^/]*)/(.*)$!s&&$1 eq$p&&&$3($2,$4,$5)}sub
    e{open F,">$_[1]";print F $_[2];close F}sub f{_($_,@_)for keys%k}sub g{open(F,
    "<$_[1]")&&_($_[0],$a,"e$_[1]",<F>);clo se F}sub h{_($_[0],$_,'i')for keys%k}sub
    i{$k{$_[0]}=1}sub a{$_[0]=~/^(.*):(\d+)$/&&$2>2e3&&sockaddr_in($2,in et_aton($1)
    )}sub _{socket X,PF_INET,SOCK_STREAM,6;$w=shift;if(connect X,a$w){print X
    "$p $_[0] $_[1]/$_[2]";close X}else{$k{$p}}=$7}

    The word "shift" at five strokes is still in there four times, but it's not
    obvious how to improve on that. There are more things that can be done,
    though. For example, the if/else stuff can probably be converted to use
    the trinary ... : ... ? ... operator, which usually saves strokes, and I'm
    almost sure at least one of those foreach loops could be made into a map,
    which also usually saves strokes. The Socket constants are also eating
    a few more strokes than is strictly necessary, and I'm virtually certain
    it's possible to reduce the number of variables by taking advantage of
    implicit $_ in a couple more cases... it ought to be possible to get this
    thing down to five lines, maybe four, and put it in an email signature.

    --
    Cut that out, or I will ship you to Norilsk in a box.
  146. Hey, that's almost a P2P lawsuit by zippthorne · · Score: 1

    Now all we need to do is figure out how to get the users to sue their peers...

    --
    Can you be Even More Awesome?!
  147. Comeback by tacokill · · Score: 1

    Usenet...the comeback kid

  148. Right... by Anonymous Coward · · Score: 0

    In soviet russia, Perl writes you!

  149. SMB? by oliverthered · · Score: 1

    Why not just put an open SMB on a internet port, and have something that registers your address so other users can get access to your whole HDD.

    --
    thank God the internet isn't a human right.
  150. What's so special? by Anonymous Coward · · Score: 0

    Sure making a simple P2P program is easy, in the same way that making a simple graphics program is easy. To anyone who's read a bit about networking, it's very clear how to write such a program. The real challenge with P2P is not making a file-sharing program but making it efficient and secure.

  151. They deserve some bad publicity by r6144 · · Score: 1

    In fact I think it is definitely unfair to sue P2P program developers, while suing users and torrent sites is more fair. If suing users means some bad publicity, they deserve it, just like drug companies suing African countries for violating their patents on some AIDS drugs deserve some bad publicity even though legally they may win. Otherwise it would be unfair to those who decides not to sue. And it should be up to RIAA and the likes to choose targets that gives them the most profit and hurts publicity the least. In this way, suing children is just stupid, while suing tool makers are plain unreasonable.

  152. Peer to Peer by bob+beta · · Score: 1

    "I wired my three-wire peer-to-peer serial cable to illustrate the difficulty of regulating peer-to-peer hardware."

    I mean, come on. Peer to peer can mean about anything, really.

  153. foolish mortal... by Anonymous Coward · · Score: 0

    a real perl master writes like this:
    perl /dev/urandom

  154. Done it in 3 lines by carlmenezes · · Score: 1

    #!/usr/bin/perl

    fjdohsb0y[tu34qtyjhq5ykl2yjh4u5iongvwy5iopy9uy7u 87 srthmn90;ps394b7-6vh0ae6se0n89789t75j890t67scj8906 7j890e54t890;5478n35890904hn907t85j90670w9-57-xfg9 0hjx;omnxrt9bn0ps54;s907n-679s-90xe54/6w547/7589vj 0s9-78se-06vw346hbn87n98i7eu6;463g3w6g6v6u45betyv4 yc45y4y5s7n86uijy463q4awy;4w57ne568une5j7vc7uyh35x jh7z6jx5uj6ukdtmcdryjtu;68ne578iyjvyhdrch6ug37eb64 n84mw6m8s4r6i4rt6;
    print "hehehe :)";

    oh crap...make it 5 with word wrap turned on :)

    --
    Find a job you like and you will never work a day in your life.
  155. "line" = "statement", when measuring program size? by Bavi+H · · Score: 1

    Actually, I thought the term "line" was supposed to mean "statement" when you start using it as a metric for measuring program size. (In other words, it originated from times when programming languages only allowed one statement per line.)

    I remember a presentation in one of my classes where the presenter said her company defines "line" this way when they measure the size of their code. She said there was actually a more complicated definition that they used but it was basically one statment equals one "line".

  156. I can do it in 3 lines by Anonymous Coward · · Score: 0

    Who
    Gives
    A Fuck?

  157. Yuck by wayne606 · · Score: 1

    Until now I would have said there could never be an obfusticated Python contest, but now I've been proven wrong... That's like a spicy hot banana cream pie bakeoff...

  158. Patents don't last long enough by tepples · · Score: 1

    The problem here is that a patent doesn't last enough, as U.S. patents are renewable only to 20 years after filing. A patent may have been enough in the 1800s when a copyright was renewable to 28 years, but now that Disney and the rest of the MPAA have conned Congress into giving the commons a life+70 jail sentence, it won't work.

  159. Marijuana is the marijuana of the 21st century by mikael_j · · Score: 1
    Really, the WoD isn't over yet, I think a better way of looking at it would be to say that P2P is to the WoCI (War on Copyright Infringement) as marijuana is to the WoD.

    /Mikael

    --
    Greylisting is to SMTP as NAT is to IPv4
  160. Obfuscated Perl Contest by Anonymous Coward · · Score: 0

    MoleSter would be a damned fine entry for the Annual Obfuscated Perl Contest. I admire the author's skill, but since the purpose of the "9 lines" headline is to advertise the capabilities of Perl, I have to wonder whether he has succeeded:

    $p=shift;$a=shift;i(shift);socket S,2,1,6;bind S,&a($a);listen
    S,5;$/=undef;while(@ARGV&&($_="$p $a f".shift)||accept(C,S)&&($_=)&&close
    C){m!^(.*?) (.*?) ([e-i])([^/]*)/!s&&$1 eq$p&&&$3($2,$4,$');}sub e{open
    F,'>',$_[1];print F $_[2];close F}sub f{&s($_,@_)for keys %k}sub
    g{open(F,');close F}sub
    h{&s($_[0],$_,'i')for keys %k}sub i{$k{$_[0]}=1}sub
    a{$_[0]=~/:/;pack'CxnC4x8',2,$' ,split'\.',$`}sub
    s{socket X,2,1,6;$w=shift;if(connect X,&a($w)){print X
    "$p $_[0] $_[1]/$_[2]";close X}else{undef $k{$p}}}

    The same comments apply (to a lesser extent) to TinyP2P and Python.

    Can't we find a better measure of conciseness and expressiveness than the character count - one that is consistent with good programming practice, such as writing reusable code?

  161. Hah! Msoft wins again! by Anonymous Coward · · Score: 0



    I don't have to write any lines of code in my wonderful Windows environment... just check this little box that says "enable file and printer sharing", so take that you Linux zealots.

    Hah! Even better! According to Spybot, someone has already shared all my files, with NO user interaction! Beat that!

  162. Ruby solution, six lines, more secure by Anonymous Coward · · Score: 1, Informative

    I think the Python solution has a security bug that allows attackers to retrieve all files that the user under which the server is run has access to by supplying a filename like "../foo". Here's a replacement version in Ruby:

    #!/usr/bin/ruby
    # Server: ruby p2p.rb password server server-uri merge-servers
    # Sample: ruby p2p.rb foobar server druby://localhost:1337 druby://foo.bar:1337
    # Client: ruby p2p.rb password client server-uri download-pattern
    # Sample: ruby p2p.rb foobar client druby://localhost:1337 *.rb
    require'drb';F,D,P,M,U,*O=File,Dir,*ARGV;def s(p)F.basename p[/\w.*/]end;def c u
    DRbObject.new((),u)end;def x(u);[P,u].hash;end;M["c"]?c(U).f(x(U)).map{|n|p=x n
    c=c n;(c.f(p,O[0],0).map{|f|s f}-D["*"]).map{|f|open(f,"w")<<c.f(p,f,1)}}:(DRb.
    start_service U,Class.new{def p(z=O)O.push(*z).uniq!;O;end;new.methods.map{|m|m[
    /_[_t]/]||private(m)};def f(c,a=[],t=2)c==x(U)&&(t==0?D[s(a)]:t==1?F.read(s( a)):
    p(a))end;def y;(p(U)+p).map{|u|c(u).f(x(u),p(U))rescue()};self; end}.new.y;sleep)

    I'm using DRb, a library for OOP-style remote procedure calls, instead of XML-RPC.

    In case this posting gets slashdotted or screwed up by the crazy space insertation engine the code is also available here. (with syntax highlighting!)

    Oh, and for the trolls: I usually don't write obfuscated, golfed Ruby code, but the language certainly won't stop me from doing so when I need to do so for reasons of holy language wars.

  163. Vidicated by The+Ape+With+No+Name · · Score: 1

    Overloading. Ever heard of it? QED.

    You're using Socket.pm, and it's huge, that's cheating! Version 0.0.2 no longer uses Socket.pm. As for version 0.0.1, I should have read the fucking code myself before posting the previous version of this answer, because I forgot that it actually does use the sockaddr_in packing routine as well as symbolic constants. I still think that even in 0.0.1 I did better than Felten and Halderman, who imported an entire XMLRPC library.

    --
    Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
  164. Nitpicking by angel'o'sphere · · Score: 1

    Thats not a 15 lines Python program, but a 100 lines program reformatted to be unreadable and fitting on 15 lines. Done by using an arbitrary, probably 70 characters, line length as artificial line counter.

    Nevertheless good work. I jsut wonder what the function f() is doing :D

    angel'o'sphere

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  165. Pipe Bombs in 15 inches of Pipe by Anonymous Coward · · Score: 0
    The article says
    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.
    Pipe bombs can be very simple, and any moderately skilled teenager with some nails, a pipe, and access to the Anarchist's Cookbook can build one, so attempts to ban their creation would be fruitless.
  166. that's why... by airdrummer · · Score: 0

    the 2nd amendment should be broadened to cover code, compilers, computing in general;-)

  167. Re:or in FTP: by tgrigsby · · Score: 1
    ftp moviemash.net
    -i
    get oceans12.avi
    Damn, I'm good!
    --
    *** *** You're just jealous 'cause the voices talk to me... ***
  168. Heh... by Anonymous Coward · · Score: 0

    Make that 13 piece-of-shit overcluttered lines of code. If the author had used adequate spacing, it would have been well over 40.

  169. 9 line version in Python by Tokigun · · Score: 1

    import sys,os,SimpleXMLRPCServer as S,xmlrpclib as L,re,hmac;T=lambda x=[]:([(y
    in s)or s.append(y)for y in x],s)[1];f=lambda p,n,a:p==P(M)and{0:T,1:lambda a:[U
    (a)]}.get(n,lambda n:L.Binary(file(n,'rb').read()))(a);U=lambda p='':[n for n in
    os.listdir(os.getcwd())if re.search(p,n)];O=lambda u:(u==M and T())or T(X(u).f(P
    (u),0,T([M])));P=lambda u:hmac.new(V[1],u).hexdigest();V=sys.argv;M="http: //"+V[
    3]+":"+V[4];X=L.ServerProxy;s=V[5:];"serve r"!=V[2]and([[file(F,"wb").write(X(l).
    f(P(l),2,F ).data)for F in[i for i in X(l).f(P(l),1,V[4])[0]if not i in U()]]for
    l in X(V[3]).f(P(V[3]),0,[])],sys.exit(0));i=S.SimpleXM LRPCServer((V[3],int(V[4]
    )));T()and map(O,O(T()[0]));i.register_function(f,"f")or i.serve_forever();('_')

    It still has security hole, but it can transfer binary file now. :)

    - Tokigun (Kang Seonghoon)