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-06 2:00

Some shitty code I've written recently:

Python:
fragment = "(%s)" % reduce(lambda x, y: x + y, ["%s, " % user for user in self.channels[channel].userdict.keys()])[0:-2] # SHOULD I FEEL BAD?

PHP:
$_ = array_map(
        function ($info) { preg_match("/\"symbol\": \"(\w+)\".+\"close\": \"([0-9.]+)\"/", $info, $m); return $m; },
        array_filter(
            $_,
            function ($mkt) use ($ooh) {
                return array_reduce(array_map(
                                    function ($sym) use ($mkt) {
                                        return strpos($mkt, $sym) !== false;
                                        },
                                    $ooh),
                                    function ($a, $b) { return $a or $b; });}));

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