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

Post Code

Name: Anonymous 2011-03-04 21:33

One recurring complaint is that nobody talks about code on /prog/. So everyone write go and write some code, any code, that does something, anything, and post it. A small explanation wouldn't go amiss either.

Name: Anonymous 2011-03-18 13:40

>>199

You swine. You vulgar little maggot. You worthless bag of filth. As we say in Texas. I'll bet you couldn't pour piss out of a boot with instructions on the heel. You are a canker. A sore that won't go away. I would rather kiss a lawyer than be seen with you.

You're a putrescent mass, a walking vomit. You are a spineless little worm deserving nothing but the profoundest contempt. You are a jerk, a cad, a weasel. Your life is a monument to stupidity. You are a stench, a revulsion, a big suck on a sour lemon.

You are a bleating foal, a curdled staggering mutant dwarf smeared richly with the effluvia and offal accompanying your alleged birth into this world. An insensate, blinking calf, meaningful to nobody, abandoned by the puke-drooling, giggling beasts who sired you and then killed themselfs in recognition of what they had done.

I will never get over the embarrassment of belonging to the same species as you. You are a monster, an ogre, a malformity. I barf at the very thought of you. You have all the appeal of a paper cut. Lepers avoid you. You are vile, worthless, less than nothing. You are a weed, a fungus, the dregs of this earth. And did I mention you smell?

Try to edit your responses of unnecessary material before attempting to impress us with your insight. The evidence that you are a nincompoop will still be available to readers, but they will be able to access it more rapidly.

You snail-skulled little rabbit. Would that a hawk pick you up, drive its beak into your brain, and upon finding it rancid set you loose to fly briefly before spattering the ocean rocks with the frothy pink shame of your ignoble blood. May you ckoke on the queasy, convulsing nausea of your own trite, foolish beliefs.

You are weary, stale, flat and unprofitable. You are grimy, squalid, nasty and profane. You are foul and disgusting. You're a fool, an ignoramus. Monkeys look down on you. Even sheep won't have sex with you. You are unreservedly pathetic, starved for attention, and lost in a land that reality forgot.

And what meaning do you expect your delusionally self-important statements of unknowing, inexperienced opinion to have with us? What fantasy do you hold that you would believe that your tiny-fisted tantrums would have more weight than that of a leprous desert rat, spinning rabidly in a circle, waiting for the bite of the snake?

You are a waste of flesh. You have no rhythm. You are ridiculous and obnoxious. You are the moral equivalent of a leech. You are a living emptiness, a meaningless void. You are sour and senile. You are a disease, you puerile one-handed slack-jawed drooling meatslapper.

On a good day you're a half-wit. You remind me of drool. You are deficient in all that lends character. You have the personality of wallpaper. You are dank and filthy. You are asinine and benighted. You are the source of all unpleasantness. You spread misery and sorrow wherever you go.

You smarmy lagerlout git. You bloody woofter sod. Bugger off, pillock. You grotty wanking oik artless base-court apple-john. You clouted boggish foot-licking twit. You dankish clack-dish plonker. You gormless crook-pated tosser. You churlish boil-brained clotpole ponce. You cockered bum-bailey poofter. You craven dewberry pisshead cockup pratting naff. You gob-kissing gleeking flap-mouthed coxcomb. You dread-bolted fobbing beef-witted clapper-clawed flirt-gill.

You are a fiend and a coward, and you have bad breath. You are degenerate, noxious and depraved. I feel debased just for knowing you exist. I despise everything about you, and I wish you would go away.

I cannot believe how incredibly stupid you are. I mean rock-hard stupid. Dehydrated-rock-hard stupid. Stupid so stupid that it goes way beyond the stupid we know into a whole different dimension of stupid. You are trans-stupid stupid. Meta-stupid. Stupid collapsed on itself so far that even the neutrons have collapsed. Stupid gotten so dense that no intellect can escape. Singularity stupid. Blazing hot mid-day sun on Mercury stupid. You emit more stupid in one second than our entire galaxy emits in a year. Quasar stupid. Your writing has to be a troll. Nothing in our universe can really be this stupid. Perhaps this is some primordial fragment from the original big bang of stupid. Some pure essence of a stupid so uncontaminated by anything else as to be beyond the laws of physics that we know. I'm sorry. I can't go on. This is an epiphany of stupid for me. After this, you may not hear from me again for a while. I don't have enough strength left to deride your ignorant questions and half baked comments about unimportant trivia, or any of the rest of this drivel. Duh.

the only thing worse than your logic is your manners. I have snipped away most of your of whay you wrote, because, well... it didn't really say anything. Your attempt at constructing a creative flame was pitiful. I mean, really, stringing together a bunch of insults among a load of babbling was hardly effective... Maybe later in life, after you have learned to read, write, spell, and count, you will have more success. True, these are rudimentary skills that many of us "normal" people take for granted that everyone has an easy time of mastering.

P.S.: You are hypocritical, greedy, violent, malevolent, vengeful, cowardly, deadly, mendacious, meretricious, loathsome, despicable, belligerent, opportunistic, barratrous, contemptible, criminal, fascistic, bigoted, racist, sexist, avaricious, tasteless, idiotic, brain-damaged, imbecilic, insane, arrogant, deceitful, demented, lame, self-righteous, byzantine, conspiratorial, satanic, fraudulent, libelous, bilious, splenetic, spastic, ignorant, clueless, illegitimate, harmful, destructive, dumb, evasive, double-talking, devious, revisionist, narrow, manipulative, paternalistic, fundamentalist, dogmatic, idolatrous, unethical, cultic, diseased, suppressive, controlling, restrictive, malignant, deceptive, dim, crazy, weird, dystopic, stifling, uncaring, plantigrade, grim, unsympathetic, jargon-spouting, censorious, secretive, aggressive, mind-numbing, arassive, poisonous, flagrant, self-destructive, abusive, socially-retarded, puerile, clueless, and generally Not Good.

Name: Anonymous 2011-03-18 13:42

>>199,200

nice dubs bro's

Name: Anonymous 2011-03-18 13:45

>>201
http://www.ultimateflame.com/
Disqualified/10.

>>202
Thanks bro.

Name: Anonymous 2011-03-18 13:50

>>193
Portable if all you want is a list of numbers.
guile> (iota 0 50 2)

Backtrace:
In current input:
   1: 0* [iota 0 50 2]

<unnamed port>:1:1: In procedure iota in expression (iota 0 50 ...):
<unnamed port>:1:1: Wrong number of arguments to #<procedure iota (n)>
ABORT: (wrong-number-of-args)


>>197
And loop isn't in Scheme, either. Which really just goes to show that, despite some people's blindness to anything other than the parentheses, Lisp and Scheme are different.

Personally I prefer to think of Lisp not as a language but as an ABSTRACT semantic structure, which languages like CL, Scheme, and so on are constructed on top of. You can't really expect to give Racket source to SBCL and expect the code to run, even though sometimes it might work by sheer chance. By the same reasoning, you might be able to print("Hello") in many different languages, but they're far from similar.

Name: Anonymous 2011-03-18 13:56

>>204
I meant the version of iota that is in srfi-1, which is one of the most commonly supported srfis. If guile wants to include an incompatible version by default, that is its choice.

Name: Anonymous 2011-03-18 13:57

You swine. You vulgar little maggot. You worthless bag of filth. As we say in Texas. I'll bet you couldn't pour piss out of a boot with instructions on the heel. Your a canker. A sore that won't go away. I would rather kiss a lawyer than be seen with you.

Your a putrescent mass, a walking vomit. Your a spineless little worm deserving nothing but the profoundest contempt. Your a jerk, a cad, a weasel. Your life is a monument to stupidity. Your a stench, a revulsion, a big suck on a sour lemon.

Your a bleating foal, a curdled staggering mutant dwarf smeared richly with the effluvia and offal accompanying your alleged birth into this world. An insensate, blinking calf, meaningful to nobody, abandoned by the puke-drooling, giggling beasts who sired you and then killed themselfs in recognition of what they had done.

I will never get over the embarrassment of belonging to the same species as you. Your a monster, an ogre, a malformity. I barf at the very thought of you. You have all the appeal of a paper cut. Lepers avoid you. Your vile, worthless, less than nothing. Your a weed, a fungus, the dregs of this earth. And did I mention you smell?

Try to edit your responses of unnecessary material before attempting to impress us with your insight. The evidence that Your a nincompoop will still be available to readers, but they will be able to access it more rapidly.

You snail-skulled little rabbit. Would that a hawk pick you up, drive its beak into your brain, and upon finding it rancid set you loose to fly briefly before spattering the ocean rocks with the frothy pink shame of your ignoble blood. May you ckoke on the queasy, convulsing nausea of your own trite, foolish beliefs.

Your weary, stale, flat and unprofitable. Your grimy, squalid, nasty and profane. Your foul and disgusting. Your a fool, an ignoramus. Monkeys look down on you. Even sheep won't have sex with you. Your unreservedly pathetic, starved for attention, and lost in a land that reality forgot.

And what meaning do you expect your delusionally self-important statements of unknowing, inexperienced opinion to have with us? What fantasy do you hold that you would believe that your tiny-fisted tantrums would have more weight than that of a leprous desert rat, spinning rabidly in a circle, waiting for the bite of the snake?

Your a waste of flesh. You have no rhythm. Your ridiculous and obnoxious. Your the moral equivalent of a leech. Your a living emptiness, a meaningless void. Your sour and senile. Your a disease, you puerile one-handed slack-jawed drooling meatslapper.

On a good day Your a half-wit. You remind me of drool. Your deficient in all that lends character. You have the personality of wallpaper. Your dank and filthy. Your asinine and benighted. Your the source of all unpleasantness. You spread misery and sorrow wherever you go.

You smarmy lagerlout git. You bloody woofter sod. Bugger off, pillock. You grotty wanking oik artless base-court apple-john. You clouted boggish foot-licking twit. You dankish clack-dish plonker. You gormless crook-pated tosser. You churlish boil-brained clotpole ponce. You cockered bum-bailey poofter. You craven dewberry pisshead cockup pratting naff. You gob-kissing gleeking flap-mouthed coxcomb. You dread-bolted fobbing beef-witted clapper-clawed flirt-gill.

Your a fiend and a coward, and you have bad breath. Your degenerate, noxious and depraved. I feel debased just for knowing you exist. I despise everything about you, and I wish you would go away.

I cannot believe how incredibly stupid Your. I mean rock-hard stupid. Dehydrated-rock-hard stupid. Stupid so stupid that it goes way beyond the stupid we know into a whole different dimension of stupid. Your trans-stupid stupid. Meta-stupid. Stupid collapsed on itself so far that even the neutrons have collapsed. Stupid gotten so dense that no intellect can escape. Singularity stupid. Blazing hot mid-day sun on Mercury stupid. You emit more stupid in one second than our entire galaxy emits in a year. Quasar stupid. Your writing has to be a troll. Nothing in our universe can really be this stupid. Perhaps this is some primordial fragment from the original big bang of stupid. Some pure essence of a stupid so uncontaminated by anything else as to be beyond the laws of physics that we know. I'm sorry. I can't go on. This is an epiphany of stupid for me. After this, you may not hear from me again for a while. I don't have enough strength left to deride your ignorant questions and half baked comments about unimportant trivia, or any of the rest of this drivel. Duh.

the only thing worse than your logic is your manners. I have snipped away most of your of whay you wrote, because, well... it didn't really say anything. Your attempt at constructing a creative flame was pitiful. I mean, really, stringing together a bunch of insults among a load of babbling was hardly effective... Maybe later in life, after you have learned to read, write, spell, and count, you will have more success. True, these are rudimentary skills that many of us "normal" people take for granted that everyone has an easy time of mastering.

P.S.: Your hypocritical, greedy, violent, malevolent, vengeful, cowardly, deadly, mendacious, meretricious, loathsome, despicable, belligerent, opportunistic, barratrous, contemptible, criminal, fascistic, bigoted, racist, sexist, avaricious, tasteless, idiotic, brain-damaged, imbecilic, insane, arrogant, deceitful, demented, lame, self-righteous, byzantine, conspiratorial, satanic, fraudulent, libelous, bilious, splenetic, spastic, ignorant, clueless, illegitimate, harmful, destructive, dumb, evasive, double-talking, devious, revisionist, narrow, manipulative, paternalistic, fundamentalist, dogmatic, idolatrous, unethical, cultic, diseased, suppressive, controlling, restrictive, malignant, deceptive, dim, crazy, weird, dystopic, stifling, uncaring, plantigrade, grim, unsympathetic, jargon-spouting, censorious, secretive, aggressive, mind-numbing, arassive, poisonous, flagrant, self-destructive, abusive, socially-retarded, puerile, clueless, and generally Not Good.

Name: Anonymous 2011-03-18 14:00

>>206

Didn't read.

Name: Anonymous 2011-03-18 14:03

>>201butthurt

Name: sage 2011-03-18 14:09

fukken sage

Name: Anonymous 2011-03-18 14:14

>>209
fukken faggot

Name: Anonymous 2011-03-18 14:17

this thread is cancer

sage.

Name: Anonymous 2011-03-18 14:19

>>211
you are a faggot

bump.

Name: Anonymous 2011-03-18 16:21


#!/bin/bash
fname1=
fname2=x/
while ((1));
do ls -la $fname1 $fname2
s0=$(ls -la $fname1 | cut -d' ' -f5)
s1=$(ls -la $fname2 | cut -d' ' -f5)
sleep 5
p0=$(ls -la $fname1 | cut -d' ' -f5)
p1=$(ls -la $fname2 | cut -d' ' -f5)
if [ "$s0" -eq "$p0" ]
then
 echo error: $fname1 hung at $s0 bytes
fi
if [ "$s1" -eq "$s1" ]
then
 echo error: $fname2 hung at $s1 bytes
fi
echo cleaning up
s0=0; s1=0; p0=0; p1=0
done

Name: Anonymous 2011-03-19 7:56


defaultTeams =: ["neutral"=0 "rescue-passive"=1 "computer"=2 "person"=3 "rescue-active"=3]

loadWorld filename
 -> clearWorld
 -> worldInfo=:["name"=(split \/ filename |> rhd) "file"=filename]
 -> tiles:[] gfxes:[] us:[] players:[]
    setTile:{id x y -> c:(Cell tileId=id seenGfx=gfxes,id terra=tiles,id."mask"
                              params=tileParams.(tiles,id."class"))
                       aset y*ww+x c cells}
    dataHandlers:
      ["Resources" = {n [var value] -> players.n.vars.var =: value}
       "RaceName" = {n [r] -> players.n.vars."race" =: r}]
    handlers:
      ["SetTile" = {[id x y v] -> setTile id x+wm y+wm}
       "SetPlayerData" = {[n type @xs] -> dataHandlers.type n xs}
       "SetStartView" = {[n x y] -> players.n.tile =: [x y]+[wm wm]}
       "SetAiType" = {[n type] -> <:say "ai $n $type":>}
       "LoadTileModels" = {[path] -> tileset =: tilesets.(drop 17 path |> drop ~4 |> asStr)
                               -> tiles   =: tileset."tiles"
                               -> gfxes   =: tileset."gfxes"}
       "DefinePlayerTypes" =
         {[@xs] -> for [n p] in (strip {[_ "nobody"]} ["neutral" @xs].cnt) do
                     players.n =: (newUnit 0 "player")
                     players.n.uid=:n
                     [@!players.n.vars "name"="Player$n" "type"=p
                      "team"=defaultTeams.p "color"=playerColors,n]}
       "CreateUnit" = {[type n tile] -> [@!us [tile+[wm wm] n type ye?]]}
       "SetResourcesHeld" = {[_ amount] -> us=:[@us.rtl [@us.rhd.rtl {u->u.vars."gold"=:amount}]]}
       "PresentMap" = {[d p w h uid] -> ["description"=d @!worldInfo]
                                     -> ww=:w+2wm -> wh=:h+2wm -> cells=:(Vector ww*wh)}
       ]
    filename.fget |> map asChr |> map {\,->\Space; \{->\(; \}->\); x->x} |> split \Newline
    |> map {[@xs @"--" @_]->xs; xs->xs}
    |> fe {[@name \( @xs] -> f:handlers.(asStr name).(_ error "loadWorld: cant handle @name")
                             as:(parseST [\( @xs])
                             f as}
 -> for [x y] in [ww-wm 0 wm wh].rectPoints setTile 0 x y
 -> for [x y] in [0 wh-wm ww wm].rectPoints setTile 0 x y
 -> for [x y] in [0 0 wm wh].rectPoints setTile 0 x y
 -> for [x y] in [0 0 ww wm].rectPoints setTile 0 x y
 -> for [id u] in players u.vars."type".{"person" -> thisPlayer=:id
                                                  -> deployUnit u.tile u
                                        ; _ -> aset id u units}
 -> for [xy p u f] in us deployUnit xy (newUnit p u).f
 -> no

Name: Anonymous 2011-03-19 8:05

Just realized, I can replace

 -> for [x y] in [ww-wm 0 wm wh].rectPoints setTile 0 x y
 -> for [x y] in [0 wh-wm ww wm].rectPoints setTile 0 x y
 -> for [x y] in [0 0 wm wh].rectPoints setTile 0 x y
 -> for [x y] in [0 0 ww wm].rectPoints setTile 0 x y

with

 -> map rectPoints [[ww-wm 0 wm wh] [0 wh-wm ww wm] [0 0 wm wh] [0 0 ww wm]]
    |> fold conc |> map [x y]~>(setTile 0 x y)

Name: Anonymous 2011-03-19 9:48

>>214-215
WARNING BLOAT!

Name: Anonymous 2011-03-19 15:09

バンプ·コード

#lang racket
(require (for-syntax syntax/stx))
#|
;; single case macro
(define-macro (id . args) ; supports (id) now.
  #:capture (ids ...)     ; optional, parens optional for single capture
  #:keyword (kws ...)     ; like #:capture
  #:fender fen            ; fender expression, optional.
                          ; Here you put some conditions like (identifier? #'my-arg)
  body ...)               ; implicit quasisyntax.

;; multi-case macro
(define-macro id
  #:capture (ids ...)
  #:keyword (kws ...)
  ; no fender expression here.
  ((a)                         ; no macro-case needed, I just dropped the (define-macro id (args) . b) syntax.
   #:capture (ids ...)         ; local captures, optional and optional parens.
   #:fender fen                ; local fender expression, optional
   body ...)                   ; implicit quasisyntax
  (() body ...)                ; properly handles the nil case everywhere.
                               ; it is also a (), now, no a "nil" anymore,
                               ; this enables you to do:
  (id                          ; identifier syntax,
   #:fender (identifier? #'id) ; using this fender expression,
   2)                          ; you can return anything you want when the macro is ``called''
                               ; as an identifier.
|#
(define-syntax (define-macro stx)
  (define (map-datum x)
    (map (λ (x) #`(#,x (datum->syntax stx '#,x))) (stx->list x)))
  (define (parse-kw stx fender? keyword?)
    (syntax-case stx ()
      ((#:fender f . r)
       (if fender?
           (cons (cons 'fender #'f) (parse-kw #'r fender? keyword?))
           (raise-syntax-error 'define-macro "bad syntax (fender expression not allowed when defining a multi-case macro)" stx)))
      ((#:capture v . r)
       (cons (cons 'capture (if (stx-list? #'v) #'v #'(v))) (parse-kw #'r fender? keyword?)))
      ((#:keyword k . r)
       (if keyword?
           (cons (cons 'keyword (if (stx-list? #'k) #'k #'(k))) (parse-kw #'r fender? keyword?))
           (raise-syntax-error 'define-macro "bad syntax (keyword declarations not allowed in a multi-case macro)" stx)))
      (r (stx-null? #'r) '())
      (r (list (cons 'body #'r)))))
  (define (parse-case stx)
    (syntax-case stx ()
      ((a . r)
       (let* ((kws (parse-kw #'r #t #f))
              (fen (cond ((assq 'fender kws) => cdr) (else #'(void))))
              (cap (cond ((assq 'capture kws) => cdr) (else '())))
              (body (cond ((assq 'body kws) => cdr) (else (raise-syntax-error 'define-macro "bad syntax (empty body)" #'(a . r))))))
         (list (cons 'args #'a) (cons 'capture cap)
               (cons 'fender fen) (cons 'body body))))))
  (syntax-case stx ()
    ((~ (m . a) . b)
     (let* ((kws (parse-kw #'b #t #t))
            (fen (cond ((assq 'fender kws) => cdr) (else #'(void))))
            (cap (cond ((assq 'capture kws) => cdr) (else '())))
            (key (cond ((assq 'keyword kws) => cdr) (else '())))
            (body (cond ((assq 'body kws) => cdr) (else (raise-syntax-error 'define-macro "bad syntax (empty body)" stx)))))
       #`(define-syntax (m stx)
           (syntax-case stx #,key
             ((m . a)
              #,fen
              (with-syntax #,(map-datum cap)
                #,(list #'quasisyntax (cons #'begin body))))))))
    ((~ m . b)
     (let* ((kws (parse-kw #'b #f #t))
            (cap (cond ((assq 'capture kws) => cdr) (else '())))
            (key (cond ((assq 'keyword kws) => cdr) (else '())))
            (body (cond ((assq 'body kws) => cdr) (else (raise-syntax-error 'define-macro "bad syntax (empty body)" stx)))))
       #`(define-syntax (m stx)
           (syntax-case stx #,key
             #,@(map
                 (λ (x)
                   (let* ((this (parse-case x))
                          (args (cdr (assq 'args this)))
                          (lcap (cdr (assq 'capture this)))
                          (fen (cdr (assq 'fender this)))
                          (body (cdr (assq 'body this))))
                     #`((m . #,args)
                        #,fen
                        (with-syntax #,(append (map-datum cap) (map-datum lcap))
                          #,(list #'quasisyntax (cons #'begin body))))))
                 (stx->list body))))))))

(define-macro aif
  #:capture it
  ((p t f)
   (let ((it p))
     (if it t f)))
  ((r p t f)
   #:fender (identifier? #'r)
   (let ((r p))
     (if r t f))))

(define-macro acond
  #:keyword (else => ->)
  (() (void))
  (((else . b))
   (begin . b))
  (((e => f) (rest ...) ...)
   (aif e (f it)
        (acond (rest ...) ...)))
  (((e p => f) (rest ...) ...)
   (let ((it e))
     (if (and it (p it))
         (f it)
         (acond (rest ...) ...))))
  (((p -> r . b) (rest ...) ...)
   #:fender (identifier? #'r)
   (aif r p (begin . b)
        (acond (rest ...) ...)))
  (((p . b) (rest ...) ...)
   #:capture it
   (aif it p (begin . b)
        (acond (rest ...) ...))))

Name: Anonymous 2011-03-19 15:44




    ░░░░░░░░░░░░░░░▄░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░▄▀█░░░░░░░░░░░░░░░
    ░░░░░░░░░░░▄▀░░█░░░░░░░░░░░░░░░
    ░░░░░░░░░▄▀░░▄▀░░░░░░░░░░░░░░░░
    ░░░░░░░░█▄░▄▀░░░░░░░░▄█▄░░░░░░░
    ░░░░░░░░█░▀▄░░░░░░░▄▀░█░▀▄░░░░░
    ░░░░░░░░▀▄░░▀▄░░░▄▀░░▄▀▄░░▀▄░░░
    ░▄░░░░░░░░▀▄░░▀▄▀░░▄▀░░░▀▄░░▀▄░
    ░█▀▄░░░░░░░░▀▄▀█▀▄▀░░░░░░░▀▄░█░
    ░█░░▀▄░░░░░▄▀░░█░░▀▄░░░░░░░░▀█░
    ░░▀▄░░▀▄░▄▀░░▄▀░▀▄░░▀▄░░░░░░░░░
    ░░░░▀▄░░█░░▄▀░░░░░▀▄░▄█░░░░░░░░
    ░░░░░░▀▄█▄▀░░░░░░░░▄▀░█░░░░░░░░
    ░░░░░░░░▀░░░░░░░░▄▀░░▄▀░░░░░░░░
    ░░░░░░░░░░░░░░░▄▀░░▄▀░░░░░░░░░░
    ░░░░░░░░░░░░░░░█░▄▀░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░█▀░░░░░░░░░░░░░░

Name: Anonymous 2011-03-19 15:48

There's not Java code in this thread ;_;

Name: Anonymous 2011-03-19 16:06

>>219
I was going to post something back around the 100 mark but decided the thread would already showcasing enough bad code.

Name: Anonymous 2011-03-19 16:13

Bump over the spam.

Name: Anonymous 2011-03-19 16:29

>>221
HEIL NIGGERS.

    ░░░░░░░░░░░░░░░▄░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░▄▀█░░░░░░░░░░░░░░░
    ░░░░░░░░░░░▄▀░░█░░░░░░░░░░░░░░░
    ░░░░░░░░░▄▀░░▄▀░░░░░░░░░░░░░░░░
    ░░░░░░░░█▄░▄▀░░░░░░░░▄█▄░░░░░░░
    ░░░░░░░░█░▀▄░░░░░░░▄▀░█░▀▄░░░░░
    ░░░░░░░░▀▄░░▀▄░░░▄▀░░▄▀▄░░▀▄░░░
    ░▄░░░░░░░░▀▄░░▀▄▀░░▄▀░░░▀▄░░▀▄░
    ░█▀▄░░░░░░░░▀▄▀█▀▄▀░░░░░░░▀▄░█░
    ░█░░▀▄░░░░░▄▀░░█░░▀▄░░░░░░░░▀█░
    ░░▀▄░░▀▄░▄▀░░▄▀░▀▄░░▀▄░░░░░░░░░
    ░░░░▀▄░░█░░▄▀░░░░░▀▄░▄█░░░░░░░░
    ░░░░░░▀▄█▄▀░░░░░░░░▄▀░█░░░░░░░░
    ░░░░░░░░▀░░░░░░░░▄▀░░▄▀░░░░░░░░
    ░░░░░░░░░░░░░░░▄▀░░▄▀░░░░░░░░░░
    ░░░░░░░░░░░░░░░█░▄▀░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░█▀░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
    ░█▄░█░█░▄▀▀▄░░█░░█░█▀▀░▀█▀░█░░░
    ░█░█▄░█░█░▄▄░░█▄▄█░█▄▄░░█░░█░░░
    ░█░░█░█░▀▄▄▀░░█░░█░█▄▄░▄█▄░█▄▄░
    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

Name: Anonymous 2011-03-20 9:07

// ==UserScript==
// @name    Swastika Hider
// @description    Hide Unicode swastikas on world4ch.
// @match    http://dis.4chan.org/*;
// @include    http://dis.4chan.org/*;
// ==/UserScript==
posts = document.getElementsByClassName('post');

for (i = 0; i < posts.length; i++) {
  post = posts[i];
  content = post.childNodes[3].innerHTML;
  if (content.indexOf("\u2591") != -1)
    post.style.display = "none";
}

Name: Anonymous 2011-03-20 10:39

>>223
What if I'm doing some Ascii Art and need U2591?

Name: Anonymous 2011-03-20 11:06

>>224
Then you're a black Hitler.

Name: Anonymous 2011-03-20 11:28

>>225
I'm not black, maybe Hitler.

Name: >>223 2011-03-20 12:06

>>224
There's no reason for you to post ASCII art.

Name: Anonymous 2011-03-20 12:10

if (content.indexOf("\u2591") != -1)
Is this how the JavaScripters do things?

Name: Anonymous 2011-03-20 12:16

>>228
JS is bloated. Something like:

find \u2591 content |> {ye? ->

would be more than enough.

Name: Anonymous 2011-03-20 12:19

>>229
Except that's preposterous.

Name: Anonymous 2011-03-20 12:23

>>229
does your dsl have a teledildonics support.

Name: Anonymous 2011-03-20 21:10


loadPud path
 -> clearWorld -> worldInfo=:["name"=(split \/ filename |> rhd) "file"=path]
 -> tiles:[] gfxes:[] us:[] players:[] us:[]
    setTile:{x y id -> c:(Cell tileId=id seenGfx=gfxes,id terra=tiles,id."mask"
                               params=tileParams.(tiles,id."class"))
                       aset y*ww+x c cells}
    era:{[n @_] -> tileset =: tilesets.(pudTilesets,n)
                -> tiles   =: tileset."tiles"
                -> gfxes   =: tileset."gfxes"}
    handlers:
     ["DESC"={xs -> [@!worldInfo "description"=(take (pos 0 xs) xs |> utf8)]}
      "ERA "=era "ERAX"=era
      "DIM "={[w:@U2 h:@U2 @_] ->ww=:w+2wm ->wh=:h+2wm ->cells=:(Vector ww*wh)}
      "OWNR"={xs
        -> for [i p] in (map pudPlayers,? xs).cnt do
            t:unitTypes."player"
            u:(newUnit 0 t."color"=:p.{"neutral"->'yellow; _->playerColors,i})
            p.{no? -> u."nobody" =: ye}
            players.i =: [@u "name"="Player$i" "playable"=p.{"person"}
                             "rescueable"=p.{"rescue_passive"; "rescue_active"}
                             "tile"=[wm wm] "team"=pudTeams.p]}
      "SIDE"={xs-> for [i s] in (map ["human" "orc" "neutral"],? xs).cnt
                      players.i."side" =: s}
      "SGLD"={xs-> for [i a] in (asPiles 2 xs).cnt players.i."gold"=:a.parseU2}
      "SLBR"={xs-> for [i a] in (asPiles 2 xs).cnt players.i."wood"=:a.parseU2}
      "SOIL"={xs-> for [i a] in (asPiles 2 xs).cnt players.i."oil"=:a.parseU2}
      "AIPL"={xs-> for [i 1] in xs.cnt players.i."passive"=:ye}
      "MTXM"={xs-> w:ww-2wm h:wh-2wm p:0
                 for (y:0; y<h; !y+1) for (x:0; x<w; !x+1 !p+2)
                   setTile x+wm y+wm (or xs,(p+1)<<8 xs,p)}
      "UNIT"={xs -> for [x:@U2 y:@U2 i o d:@U2] in (asPiles 8 xs)
                      o:o+1 xy:[x+wm y+wm]
                      pudUnits,i.{no?-> error "Invalid unit slot: $i"
                                 ;"start"-> players.o."tile"=:xy
                                 ;t-> [@!us [xy o t d]]}}
      ]
 -> path.fget.{:r [m:4++_ l:@U4 d:l++_ @xs] -> [[m.utf8 d] @xs.r]}
    |> {[["TYPE" _]@xs]->xs; _ -> error "Invalid PUD file: $filename"}
    |> map {[t d] -> [t d.len] -> if h:handlers.t (h d)}
 -> map rectPoints [[ww-wm 0 wm wh] [0 wh-wm ww wm] [0 0 wm wh] [0 0 ww wm]]
    |> fold conc |> map [x y]~>(setTile x y 0)
 -> for [_ u] in players do
      u."enemies" =: (map {[_ p] -> p."team" != u."team"
                                    && p."team"!=0 && u."team"!=0
                                    |> {ye? -> 1<<p."id"}}
                          players
                      |> fold `+`)
      u."playable".{ye? -> thisPlayer=:u."id"
                        -> deployUnit u."tile" u
                   ; _ -> u."nobody".{ye? -> delUnit u."id"
                                     ;_ -> aset u."id" u units}}
 -> for [xy o t d] in us.{-> u:(newUnit o t)
                          -> u."resource".{r:ye? -> u.r =: d}
                          -> deployUnit xy u}
 -> no

Name: Anonymous 2011-03-20 22:06

-> no
No.

Name: Anonymous 2011-03-20 22:08

Here's a simple Python webserver I just wrote. It currently only supports GET requests.

#
# httpd.py
#

import socket, sys, thread

def do_request(method, path, headers):
  if method == 'get':
    # handle get request
    if path == '/':
      path = '/index.html'

    # open file
    try:
      f = open(root + path, 'r')

      # opened file successfully
      response = 'HTTP/1.0 200 OK\r\n'

      # TODO: add needed headers

      response += '\r\n'

      # send file contents
      for line in f:
        response += line.rstrip() + '\r\n'

      return response

    except IOError:
      # send 404 response
      return 'HTTP/1.0 404 Not Found\r\n'

  else:
    return ''

def handle(conn, addr):
  # create a file object for the socket
  f = conn.makefile()
  conn.close()

  line = f.readline().lower().strip().split()

  while True:
    # read request
    method, path, http_ver = line

    # read headers
    headers = []
    h = f.readline().lower().strip().split()

    while h != []:
      headers += [(h[0], ''.join(h[1:]))]
      h = f.readline().lower().strip().split()

    # handle request
    f.write(do_request(method, path, headers))

    # check whether to keep the connection open
    if http_ver != 'http/1.1' or ('connection:', 'close') in headers or 'keep-alive:' in map(lambda (a, b): a, headers):
      break

    # get rid of empty lines before the next request
    line = []

    while line == []:
      line = f.readline().lower().strip().split()

  # close file and return
  f.close()

# default settings
host = ''
port = 8000
root = '.'

# parse command line arguments
argv = sys.argv[1:]

while argv:
  if argv[0] == '-h':
    # print help and exit
    print 'options: -h display this help'
    print ' -p [port] set port'
    print ' -H [hostname] set hostname'
    print ' -r [dir] set root directory'
    exit()

  elif argv[0] == '-p':
    # set port number
    if len(argv) == 1:
      print '\'-p\' requires an argument'
      exit()

    port = int(argv[1])
    argv = argv[2:]

    continue

  elif argv[0] == '-H':
    # set hostname
    if len(argv) == 1:
      print '\'-H\' requires an argument'
      exit()

    host = argv[1]
    argv = argv[2:]

    continue

  elif argv[0] == '-r':
    # set root directory
    if len(argv) == 1:
      print '\'-r\' requires an argument'
      exit()

    root = argv[1]
    argv = argv[2:]

# open a port
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.bind((host, port))
conn.listen(1)

# accept requests and handle in a new thread
while True:
  thread.start_new_thread(handle, conn.accept())

Name: Anonymous 2011-03-21 11:14

bump pants

Name: Anonymous 2011-03-21 11:22

>>234
Cool security flaws bro

Name: Anonymous 2011-03-21 12:36


          ∧_∧  / ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
          ( ´∀`) < COOL FREE SECURITY FLAWS >>234
        /    |    \________
       /       .|     
       / "⌒ヽ |.イ |
   __ |   .ノ | || |__
  .    ノく__つ∪∪   \
   _((_________\
    ̄ ̄ヽつ ̄ ̄ ̄ ̄ ̄ ̄ | | ̄
   ___________| |
    ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| |

Name: Anonymous 2011-03-21 12:49

>>236
No shit, it's nowhere near complete. And I probably won't ever finish it, but it's not supposed to be perfect.

Name: Anonymous 2011-03-21 15:07

>>235
MULTI♂GAY♂PANTS

Name: Anonymous 2011-03-21 15:35


          ∧_∧  / ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
          ( ´ω`) < Sup.
        /    |    \________
       /       .|     
       / "⌒ヽ |.イ |
   __ |   .ノ | || |__
  .    ノく__つ∪∪   \
   _((_________\
    ̄ ̄ヽつ ̄ ̄ ̄ ̄ ̄ ̄ | | ̄
   ___________| |
    ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| |

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