Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

~/bin/kopipe

Name: Anonymous 2008-06-15 13:08

Paste yours!

#!/usr/bin/python

import sys

def clipserver(input):
    import gtk   # import only if it's needed
   
    targets = ["STRING", "TEXT", "COMPOUND_TEXT", "UTF8_STRING"]
   
    clip = gtk.Clipboard()
    clip.set_with_data([(name, 0, targets.index(name)) for name in targets],
        lambda clip, sel, info, data: sel.set("STRING", 8, data),
        lambda clip, data: gtk.main_quit(), input)
   
    gtk.main()

def daemonize():
    import os
    os.fork() and sys.exit(0)
    os.fork() and sys.exit(0)

def handleinterrupt():
    import signal
    signal.signal(signal.SIGINT, lambda num, frame: sys.exit(0))

def read():
    if len(sys.argv) > 1:
        input = open(sys.argv[1]).read()
    else:
        input = sys.stdin.read()
    return input

def main():
    handleinterrupt()
    input = read()
    daemonize()
    clipserver(input)

if __name__ == '__main__':  # lol python
    main()


Mine features:
 • Lambda abuse
 • Unix/X11 dependency
 • Clever hacks everywhere
 • Forced indentation
 • Pseudo-functional style

Name: Anonymous 2008-06-15 13:37

*grabs dick*

Name: Anonymous 2008-06-15 13:38


                                        (3 4)
                                          │
                                          │
                                          ▼
((1 2) 3 4)┏━━━┳━━━┓                  ┏━━━┳━━━┓    ┏━━━┳━━━┓
      ────►┃ ● ┃ ●─╂─────────────────►┃ ● ┃ ●─╂───►┃ ● ┃ ╱ ┃
           ┗━┿━┻━━━┛                  ┗━┿━┻━━━┛    ┗━┿━┻━━━┛
             │                          │            │
             ▼                          ▼            ▼
   (1 2)   ┏━━━┳━━━┓    ┏━━━┳━━━┓     ┏━━━┓        ┏━━━┓
      ────►┃ ● ┃ ●─╂───►┃ ● ┃ ╱ ┃     ┃ 3 ┃        ┃ 4 ┃
           ┗━┿━┻━━━┛    ┗━┿━┻━━━┛     ┗━━━┛        ┗━━━┛
             │            │
             ▼            ▼
           ┏━━━┓        ┏━━━┓ 
           ┃ 1 ┃        ┃ 2 ┃
           ┗━━━┛        ┗━━━┛


     Figure 2.5:  Structure formed by (cons (list 1 2) (list 3 4)).

Name: Anonymous 2008-06-15 13:39

hax my anus

Name: Anonymous 2008-06-15 13:48

>>3
I came

>>2,4
Faggots

Name: Anonymous 2008-06-15 15:15

Thread is now about anus haxing

Name: Anonymous 2008-06-15 15:25

hax my anus

Name: Anonymous 2008-06-15 15:42

Name: Anonymous 2008-06-15 15:53

>>1
HAHA YOU CAN ONLY LAMBDA AN EXPRESSION

Name: Anonymous 2008-06-15 15:55

Look at it this way.

On most browsers, you can bring up your browsing history by pressing Control-H. (No, this is not going to become a discussion of werecows.) On Firefox, this brings up a sidebar that shows up on the left side of the window. If you put your mouse over the edge of the sidebar, the cursor will turn into a different kind of arrow. By clicking and dragging it, you can move the edge of the sidebar back and forth. You are, to put it another way, manipulating the border between the normal window and the history window. By moving the mouse, you can increase the portion of the window devoted to either part. In a more extreme view of this situation, you're increasing or decreasing the amount of existence the sidebar has.

Now, let's apply this idea to something more abstract. Look out your window. If you don't live in a highly urbanized area, you should be able to see the horizon. Think of this as the border between the land and the sky. The land and sky are obviously distinguishable thanks to this boundary. Now, if you were to "drag" the sash between the sky and the land, or to manipulate the border between land and sky, you would end up causing the sky to become larger and the land to become smaller, or vice versa. An effect of this might be to cause something that was just on the ground to suddenly be hundreds of feet in the air. Truly a frightening situation to be in. So, look at it this way - manipulating the border between two physical things shifts whatever balance there is in the interaction between those things. Alternatively, by manipulating the border between two things, you can change the manner in which they exist.

Still, this isn't *that* abstract, since it's still dealing with real things in the real world. Many believe that in this world, there are those things that are true, and those that obviously aren't. This divides reality into two extremes: truth and falsehood. But, since we have two extremes, logically one can imagine a boundary between those two extremes - the border between truth and lies. If one were to manipulate this border, suddenly things that were pure fantasy (flying pigs, for the sake of argument) have become reality - or things from reality have ceased to exist. This is how Yukari is said to have invaded the moon - by manipulating the border between truth and lies, as applied to the reflection of the moon on a pond, she was able to make the reflection of the moon into a manifestation of the actual moon, and so send her youkai army onto it. This is what's truly amazing about Yukari's power - the ability to manipulate the border between completely abstract concepts allows her to fundamentally change reality as we know it (at least in terms of two abstract concepts).

Name: Anonymous 2008-06-15 16:36

>>9
You can lambda an expression, but you can't lambda a fish

Name: Anonymous 2008-06-15 16:48


import os
while 1:
    os.fork()

Name: Anonymous 2008-06-15 17:01

>>12
Now try doing that in Haskell.

Name: Anonymous 2008-06-15 17:19

>>13

import Control.Concurrent

forever $ forkOS $ putStrLn "have you read your YAHT today?"

Name: Anonymous 2008-06-15 17:23

>>13
import Control.Monad
import System.Posix
main = forever (forkProcess main)

Name: Anonymous 2008-06-15 17:37

>>15
I came.

Name: Anonymous 2008-06-15 18:23

>>15
What's forever?

Name: Anonymous 2008-06-15 18:24

>>1
Is that some Ruby?

Name: Anonymous 2008-06-15 18:32

>>18
5/10 pretty obvious but it still made me RAGE a bit

Name: Anonymous 2008-06-15 18:34

>>18
no

Name: Anonymous 2008-06-15 18:35

>>18
Are you demented or blind?

Name: Anonymous 2008-06-15 18:38

I sometimes tell my Haskell to count the length of an infinite list just to make my laptop warm and put it on my lap. When I close my eyes, it feels almost like a girl is sitting there ;_;

Name: Anonymous 2008-06-15 18:42

src/char_sql/inter.c:840: undefined reference to `inter_quest_parse_frommap'

Name: Anonymous 2008-06-15 19:16

>>22
I lol'd.

Name: Anonymous 2008-06-16 5:07

>>24
There's nothing funny in being alone.

Name: Anonymous 2008-06-16 5:39

>>22
Comments like this are why I still read /prog/

Name: Anonymous 2008-06-16 5:41

Name: Anonymous 2008-06-16 7:22

>>22
/jp/?

Name: Anonymous 2008-06-16 9:21

>>22,24-26,28
Same person, constant toll.

Name: >>24 2008-06-16 9:59

>>29
Wrong.

Name: Anonymous 2008-06-16 13:26

>>30,24 are the same person and we have been trolled constantly

Name: Anonymous 2008-06-16 13:34

#!/bin/dash

pastaroot="$HOME/text/copypasta"

error() {
    echo "Copypasta error: $1"
    exit 1
}

exists() {
    test -e "$1" || error "\`$1' doesn't exist."
}

nexists() {
    test ! -e "$1" || error "\`$1' already exists."
}

optarg() {
    test "$1" || error "Option requires an argument."
}

edit() {
    if test -n "$EDITOR"
    then
        exists "$1"
        "$EDITOR" "$1"
    else
        error "EDITOR is not set."
    fi
}

delete() {
    exists "$1"
    rm -i "$1"
}

cd "$pastaroot" || error "Copypasta root doesn't exist."

# XXX: Creating/deleting directories not supported.
case "$1" in
    -a)
        optarg "$2"
        nexists "$2"
        touch "$2"
        edit "$2"
        ;;
    -d)
        optarg "$2"
        delete "$2"
        ;;
    -e)
        optarg "$2"
        edit "$2"
        ;;
    -h|--help|'')
    cat <<-EOF
        Usage:
          $(basename $0) COMMAND [ARGS]
          $(basename $0) NAME

        Commands:
          -a name          Add
          -d name          Delete
          -e name          Edit
          -h, --help       Help
          -l               List
          -n name newname  Rename
          -r name          Replace
          -s string        Search
EOF
        ;;
    -l)
        find . -type f | cut -b3- | sort
        ;;
    -n)
        optarg "$2"
        optarg "$3"
        exists "$2"
        nexists "$3"
        mv "$2" "$3"
        ;;
    -r)
        optarg "$2"
        delete "$2"
        add "$2"
        ;;
    -s)
        optarg "$2"
        # XXX: Will fail if no files exist.
        grep --color -H -n -R "$2" *
        ;;
    *)
        # XXX: There is no facility for files starting with `-'.
        exists "$1"
        cat "$1"
        ;;
esac

Name: Anonymous 2010-11-15 3:14

Name: Anonymous 2011-07-20 15:28

 

Name: Sgt.Kabukiman愲ڄ 2012-05-24 6:12

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Name: bampu pantsu 2012-05-29 3:52

bampu pantsu

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List