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

Pages: 1-4041-8081-120121-160161-200201-240241-280281-320321-

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-04 21:53

Posted from my Macbook Wheel, so excuse my brevity.


for (int i = 0; i < 10; ++i);
for (int i = 0; i < 10; i++);

both generate the same assembly. Anyone suggesting otherwise is trolling.

Name: Anonymous 2011-03-04 22:24


ORG $2030        
      
BEGIN
    LDAA #$FF
    STAA $1000
    JSR  DELAY
    LDAA #0
    STAA $1000
    JSR  DELAY
    JSR  DELAY
    JMP  BEGIN

DELAY    LDB    #10
OUTER    LDX    #20000
PAUSE    NOP
    NOP
    DEX
    BNE    PAUSE
    DECB
    BNE OUTER
    RTS


Turns a LED in port a($1000) off and on

Name: Anonymous 2011-03-04 22:34

>>3
What platform?

Name: Anonymous 2011-03-04 22:41

My contribution
#!r6rs
(library (generalized-set)
(export (rename (set!!! set!))
        define-getter/setter)
(import (rnrs)
        (rnrs mutable-pairs)
        (rnrs mutable-strings))

;; To /prog/, love that guy who uses R6RS
;;
;; So, I was using guile earlier, and I decided I wanted to add
;; generalized `set!` (which guile supports through both SRFI 17 and
;; it's own `make-procedure-with-setter`) to my R6RS
;; code. Unfortunately, there is no good way to implement SRFI 17 in
;; portable R6RS unless you use lexically hidden "tags" to access the
;; setters of procedures. Which is both ugly, and a stupid
;; implementation strategy.
;;
;; Instead I decided to settle for creating a special form for
;; defining getter/setters. The error handling isn't there yet, but
;; I'll probably fix that at some point.
;;
;; Usage:
;; > (import (generalized-set))
;; > (define-record-type cell
;;     (fields (mutable var)))
;; > (define-getter/setter cell-ref cell-var cell-var-set!)
;; > (define c (make-cell 3))
;; > (cell-ref c)
;; 3
;; > (set! (cell-ref c) 9)
;; > (cell-ref c)
;; 9
;;
;; Tested on Ikarus and Mosh.
;; I see no reason why it wouldn't work on Racket though.

(define-syntax set!!
  (syntax-rules ()
    ((set!! (accessor arg ...) val)
     (set! accessor (arg ... val)))
    ((set!! . rest)
     (set! . rest))))

(define-syntax define-getter/setter
  (syntax-rules ()
    ((define-getter/setter name ?getter ?setter)
     (begin
       ;; No point evaluating ?getter and ?setter multiple times
       (define getter ?getter)
       (define setter ?setter)
       (define-syntax name
         (make-variable-transformer
          (lambda (stx)
            (syntax-case stx (set!)
              ((set! name (vars (... ...)))
               #'(setter vars (... ...)))
              ((name vals (... ...))
               #'(getter vals (... ...)))
              (name
               (identifier? #'name)
               #'getter)))))))))

;; We want to handle various primitives especially, so that we don't
;; have to use complicated imports every time we want to use
;; generalized `set!`. Basically, we make them literals so they
;; capture the appropriate lexical binding, and behave correctly if
;; they are rebound locally.
;; If you don't like this, you just don't have to use it, simply fix
;; the export list at the top to export set!! as set!, not set!!!
(define-syntax set!!!
  (syntax-rules
      (car cdr caar cadr cdar cddr caaar caadr cadar caddr cdaar cdadr cddar
       cdddr caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr cdaaar
       cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr string-ref vector-ref)
    ((set!!! (car x) val)
     (set-car! x val))
    ((set!!! (cdr x) val)
     (set-cdr! x val))
    ((set!!! (caar x) val)
     (set-car! (car x) val))
    ((set!!! (cadr x) val)
     (set-car! (cdr x) val))
    ((set!!! (cdar x) val)
     (set-cdr! (car x) val))
    ((set!!! (cddr x) val)
     (set-cdr! (cdr x) val))
    ((set!!! (caaar x) val)
     (set-car! (caar x) val))
    ((set!!! (caadr x) val)
     (set-car! (cadr x) val))
    ((set!!! (cadar x) val)
     (set-car! (cdar x) val))
    ((set!!! (caddr x) val)
     (set-car! (cddr x) val))
    ((set!!! (cdaar x) val)
     (set-cdr! (caar x) val))
    ((set!!! (cdadr x) val)
     (set-cdr! (cadr x) val))
    ((set!!! (cddar x) val)
     (set-cdr! (cdar x) val))
    ((set!!! (cdddr x) val)
     (set-cdr! (cddr x) val))
    ((set!!! (caaaar x) val)
     (set-car! (caaar x) val))
    ((set!!! (caaadr x) val)
     (set-car! (caadr x) val))
    ((set!!! (caadar x) val)
     (set-car! (cadar x) val))
    ((set!!! (caaddr x) val)
     (set-car! (caddr x) val))
    ((set!!! (cadaar x) val)
     (set-car! (cdaar x) val))
    ((set!!! (cadadr x) val)
     (set-car! (cdadr x) val))
    ((set!!! (caddar x) val)
     (set-car! (cddar x) val))
    ((set!!! (cadddr x) val)
     (set-car! (cdddr x) val))
    ((set!!! (cdaaar x) val)
     (set-cdr! (caaar x) val))
    ((set!!! (cdaadr x) val)
     (set-cdr! (caadr x) val))
    ((set!!! (cdadar x) val)
     (set-cdr! (cadar x) val))
    ((set!!! (cdaddr x) val)
     (set-cdr! (caddr x) val))
    ((set!!! (cddaar x) val)
     (set-cdr! (cdaar x) val))
    ((set!!! (cddadr x) val)
     (set-cdr! (cdadr x) val))
    ((set!!! (cdddar x) val)
     (set-cdr! (cddar x) val))
    ((set!!! (cddddr x) val)
     (set-cdr! (cdddr x) val))
    ((set!!! (string-ref x index) val)
     (string-set! x index val))
    ((set!!! (vector-ref x index) val)
     (vector-set! x index val))
    ((set!!! x val)
     (set!! x val))))

)

Name: Anonymous 2011-03-04 22:45

>>4
moto 6800

Name: Anonymous 2011-03-04 22:56

    ((set!!! (car x) val)
     (set-car! x val))
    ((set!!! (cdr x) val)
     (set-cdr! x val))
    ((set!!! (caar x) val)
     (set-car! (car x) val))
    ((set!!! (cadr x) val)
     (set-car! (cdr x) val))
    ((set!!! (cdar x) val)
     (set-cdr! (car x) val))
    ((set!!! (cddr x) val)
     (set-cdr! (cdr x) val))
    ((set!!! (caaar x) val)
     (set-car! (caar x) val))
    ((set!!! (caadr x) val)
     (set-car! (cadr x) val))
    ((set!!! (cadar x) val)
     (set-car! (cdar x) val))
    ((set!!! (caddr x) val)
     (set-car! (cddr x) val))
    ((set!!! (cdaar x) val)
     (set-cdr! (caar x) val))
    ((set!!! (cdadr x) val)
     (set-cdr! (cadr x) val))
    ((set!!! (cddar x) val)
     (set-cdr! (cdar x) val))
    ((set!!! (cdddr x) val)
     (set-cdr! (cddr x) val))
    ((set!!! (caaaar x) val)
     (set-car! (caaar x) val))
    ((set!!! (caaadr x) val)
     (set-car! (caadr x) val))
    ((set!!! (caadar x) val)
     (set-car! (cadar x) val))
    ((set!!! (caaddr x) val)
     (set-car! (caddr x) val))
    ((set!!! (cadaar x) val)
     (set-car! (cdaar x) val))
    ((set!!! (cadadr x) val)
     (set-car! (cdadr x) val))
    ((set!!! (caddar x) val)
     (set-car! (cddar x) val))
    ((set!!! (cadddr x) val)
     (set-car! (cdddr x) val))
    ((set!!! (cdaaar x) val)
     (set-cdr! (caaar x) val))
    ((set!!! (cdaadr x) val)
     (set-cdr! (caadr x) val))
    ((set!!! (cdadar x) val)
     (set-cdr! (cadar x) val))
    ((set!!! (cdaddr x) val)
     (set-cdr! (caddr x) val))
    ((set!!! (cddaar x) val)
     (set-cdr! (cdaar x) val))
    ((set!!! (cddadr x) val)
     (set-cdr! (cdadr x) val))
    ((set!!! (cdddar x) val)
     (set-cdr! (cddar x) val))
    ((set!!! (cddddr x) val)
     (set-cdr! (cdddr x) val))


You're using (arguably) the world's most extensible and dynamic language and you're too mentally lazy to generate those automatically? Come on.

Name: Anonymous 2011-03-04 22:59

>>7
I had emacs generate them for me

Name: Anonymous 2011-03-04 23:01

>>8
Fair enough. Carry on.

Name: Anonymous 2011-03-04 23:42

>>2
They both generate this code:

;

Anyone suggesting otherwise is trolling.

Name: Anonymous 2011-03-05 0:50

So what? No one talks about the concept of randomness on /b/. Fuck, /b/ isn't even random!

Name: Anonymous 2011-03-05 1:12

>>11
let's just assume that here I posted link to that stupid xkcd with random(){ret 4}]

Name: Anonymous 2011-03-05 2:01

-module(xkcd).
-export([rand/1]).

rand(all) -> 4;
rand(N) -> crypto:rand_uniform(0,N).

Name: Anonymous 2011-03-05 8:52

>>12
i luv xkcd!!!

Name: Anonymous 2011-03-05 8:53

>>13
0mg so randoooooom xD

Name: Anonymous 2011-03-05 8:55

>>13

Chop-sun by fair dice rorr, kekeke.

Name: Anonymous 2011-03-05 15:32

with this you may have fixed-length of array with numbers, that were transformed by some function. I don't know how this could be useful anyway.

>>> x = lambda u, p: map (u, xrange(p))
>>> x(str, 10)
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

Name: Anonymous 2011-03-05 16:57

In this game, two players sit in front of a pile of stones. They take turns, each removing a set amount of stones (up to a specified maximum). The person who removes the  last stone(s) wins. Half of the code is redundant as I don’t use a variable to track which player’s move it is.  Primarily because I didn’t know how to.

If you are lonely and want to play against the ‘computer’ change the second choice variable to choice=random.randint(1,max)be sure to import random, if you do


def nims(pile, max):
    while pile>0:
        choice=input("How many Stones do you want to remove, P1?")
        while choice not in range(1,max+1):
            choice=input("You have made an invalid selection P1.\
Please chose again.")
        pile=pile-choice
        print pile

        if pile<=0:
            print 'player 1 wins!'
            break

        choice=input("Player 2: How many Stones do you want to remove?")
        while choice not in range(1,max+1):
            choice=input("You have made an invalid selection P2.\
Please chose again.")
        pile=pile-choice
        print pile

        if pile<=0:
            print 'game over, player 2 is the winner!'

x=input('How big is the pile?\n')
y=input('How many stones can one person take each time?\n')
print 'Pile set to', x, ', maximum stone number set to', y,'!'

nims(x,y)

Name: Anonymous 2011-03-05 17:00

>>18
ONE WORD

Name: Anonymous 2011-03-05 17:07

A meager attempt at consuming resources:

#!/bin/bash
while [ 1 ]
do
  `touch /tmp/cpuhog/asdfqwer.$$`
done

Name: Anonymous 2011-03-05 17:08

>>19
if you like I can re-write it using list comprehensions

Name: Anonymous 2011-03-05 17:09

Putting cpuhog in check;

# !/bin/bash
#
function get_load() {
# gets cpu load from last minute
# man uptime
  load=$(uptime | cut -d, -f3 | grep -o "[0-9.]\{4\}$")
  echo $load
}

AVG_LOAD=$(get_load)
# if the avg load is greater than or equal to 5%
# then show us all processes using 5% or more of cpu
MAX_LOAD=$(echo "$AVG_LOAD/5" | bc)
if (($MAX_LOAD >= 1)); then
  printf "\nCurrent load average: $AVG_LOAD\n";
  FAT_LOAD=$(ps k +pcpu o pcpu,user,uid,pid,ppid,tty,stime,cmd -A  | grep "^.[5-9]\.[0-9]\{1\}*")
  printf "$FAT_LOAD\n"
  if [[ $1 = "-k" ]]; then
    # for each line delimted by newline get pid and uid or user
      # if uid or user is not root
        # kill pid
        echo "Kill option passed"
  fi;
fi;

#ps -Ao user,group,pid,pcpu,comm --sort +pcpu --cols 200 | tail -n10


Notice how well I'm doing it wrong?

Name: Anonymous 2011-03-05 17:12

How an expert newfag adds users;

#!/bin/bash
#
# lrn2bash
# ########
# prototype useradd using only primitive
# utilities and bash builtins
#
# add a new user account where uid is
# incremented and gid defaults to users
# group.
#
# overview
# ########
# this script takes 1 argument; user name
# this script takes 3 options; help, verbose, test
#
# the user id and group id is read from passwd
#
# each test will loop and read new input if fail
#
# the script will not write or execute any commands
# until all tests have passed
#
# rules/tests
# ###########
#
# the user name must be at least 3 characters in
# length and only alaphanumeric characters
# the user name must not be in use
#
# password must be at least 6 characters in length
# password must be verified
#
USERS=`ls /home`
#USERNAME=`for USER in $USERS; do echo $USER; done;`
username=$1
USERNAME_VALID=''
while [[ -z "$USERNAME_VALID" ]]; do
    if [ `echo "$username" | grep "$USERS"` ]; then
        echo -en "User exits.\nEnter new username: "
        read username
    elif [ `echo ${#username}` -le 1 ]; then
        echo -en "Need at least 2 characters.\nEnter new username: "
        read username
    elif [[ $username != [[:alpha:]][[:alnum:]]* ]]; then
        echo -en "Alpha numeric characters only. \nEnter new username: "
        read username
    else
        USERNAME_VALID=1
        echo "Your new user name: $username"
    fi;
done;

PASSWORD_VALID=''
echo -en "\nCreate new password: "
read -es password
while [[ -z "$PASSWORD_VALID" ]]; do
    if [[ ${#password} -lt 7 ]]; then
        echo -en "Password must be at least 6 characters.\nEnter new password: "
        read -es password
    else
        echo -en "Verify new password: "
        read -es verify_password
        if [[ "$password" = "$verify_password" ]]; then
            PASSWORD_VALID=1
        fi;
    fi;
done;

GROUP_USERS_STRING=`cat /etc/group | grep "^users*"`
while IFS=: read USR PASSWD GID; do
    gid=$GID
done <<< $GROUP_USERS_STRING

PASSWD_PREVIOUS_UID=tail etc/passwd -n10 | grep "\:10[0-9]\{2\}\:10[0-9]\{2\}\:" | tail -n1
while IFS=: read USR PASSWD UID; do
    uid=$(($UID+1))
done <<< $PASSWD_PREVIOUS_UID


# still need to read comment, set homepath, and define shell
# define passwd string
# encrypt password with crypt
# define shadow string
# chmod shadow (and passwd if necessary)
# append each string appropriately
# i.e. /etc/passwd
#    /etc/shadow
#   /etc/group
# chmod files with original permissions
# cp /etc/skel to /home/{$username}
#      


# echo "{$username}:x:{$uid}:{$gid}:"

Name: Anonymous 2011-03-05 17:14

>>23
newfag
[i][u][o]back to— eh, fuck it.

Name: Anonymous 2011-03-05 17:43

class m:
 def __init__(self):
  q=12000
  x=0
  while True:
    x+=1
    y=x%x*2
    z=x+y
    qp='                     '+str(q)
    if x % 1000 == 0:
     q=q-x
    qp=qp+'    '+qp.replace('3','three')
    print x,y,z,'                  ',x,z,y,'              ',z,qp
  def replacenumbers(self,numberstring)
 
if __name__=="__main__":
 m1=m()

Name: Anonymous 2011-03-05 17:52

A bit of CoffeeScript I'm working on, trying to distort the language without touching the compiler.


# Arbitrary iterator over a sequence using a stepper generator
# `seq' is any list.
# `stepper' is a generator that returns either an items array or $break
# `fn' is the function to call in each item
# `apply' is just a functional version of JavaScript's Function.apply
(defun iter: (seq, stepper, fn) ->
    (letb (step = (stepper seq)) ->
        (until (eq (call step), $break)
            (apply fn, step.item))))


`until' uses FIOC, so I'm going to replace this by something else later on

Name: Anonymous 2011-03-05 18:00

>>26
Is that Lisp?

Name: Anonymous 2011-03-05 18:14

>>27
It's some sort of macrofag function.

Name: Anonymous 2011-03-05 18:36

>>27
A bit of CoffeeScript I'm working on

So, nope.

Name: Gruff 2011-03-05 19:31

class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users do |t|
      t.string :username
      t.string :password
      t.string :salt
     
      t.timestamps
    end
  end
 
  def self.down
    drop_table :users
  end
end

# Script For Creating Accounts, nust learn how to graphically implement this.

>> users = User.find(:all)

>> user = User.create(:username => "Tom", :password => "wertycool")

>>users = User.find(:all)

>>quit

#Atm im not sure if i need the terminal to activate this, shouldnt be a big problem though

#Well Im gonna need some help executing this,Uugh

class User < ActiveRecord::Base
end

#Some Tests to run in terminal, to check details of accounts, may be important to prevent bots joining the websitre
#This Also Enables changing of account inforamtion,good for people who forget theyre account details

user = User.find_by_username("john") # Type this in order, should receive the

>> user.username #Thats obvious

>> user.password

>> user.salt

>> user.password = "Example" #changes the users password= AWESOME.. shouldnt abuse

>>user.save #saves changes

>>user

#Thats that, This will hopefully allow for flexible data changes.

#Not sure what this is, Kinda worried about organiseing

>ruby rails generate controller account index registration # Run this in terminal?

ruby script/server

#Enter This When Testing site

class AccountController < ApplicationController
  def index
  end
 
  def registration
  end
end

#OK, I Need chases help with this, becasue im starting to lose track of this.
#A file In which the registration code will e loacated

<h1>Account#registration</h1>
<p>Find me in app/views/account/registration.html.erb</p>

#This will be what i need to change to when prompted by the website.

<% form_for :user, @user do |f| %>
  <%= error_messages_for :user %>
 
  Username: <%= f.text_field :username %><br/>
  Password: <%= f.password_field :password %><br/>
  Confirm Password: <%= f.password_field :password_confirmation %><br/>
  <%= submit_tag "Register!"  %>
<% end %>

#I need to add this to the user.rb in app/models

class User < ActiveRecord::Base
  validates_uniqueness_of :username
  validates_presence_of :password
  validates_confirmation_of :password
end

#This checks Information automatically when someone logs in or out.

#app/controllers/account_controller.rb This is the second fiel to modify with this code.

class AccountController < ApplicationController
  def index
  end
 
  def registration
    if request.post? and params[:user]
      @user = User.new(params[:user])
 
      if @user.save
        flash[:notice] = "User created."
        redirect_to :action => "index"
      end
    end
  end
end

#This is How new users are created, Still have no idea on how to do this.

#app/views/account/index.html.erb is the second one we need to modify with this code:

<% if flash[:notice] %>
  <%= h flash[:notice] %>
<% end %>
 
<h1>Welcome To The Game!</h1>

#Note: I havent thought of what to replace Welcome to the game! with,shit.

# Thats it,I think. Heres some extra stuff that maybe useful, not sure.
#This is a account protection system, stopping users from decrypting code within others accounts.
# Not sure it will work, best thing i could think of.
#For this t owork, ill need to change thi sfile app/models/user.rb

require "digest"
 
class User < ActiveRecord::Base
  validates_uniqueness_of :username
  validates_presence_of :password
  validates_confirmation_of :password
 
  # Setup the salt value and hash the password before we save everything to the
  # database.
  def before_save
    if (self.salt == nil)
      self.salt = random_numbers(5)
      self.password = Digest::MD5.hexdigest(self.salt + self.password)
    end
  end
 
  private
 
  # A sequence of random numbers with no skewing of range in any particular
  # direction and leading zeros preserved.
  def random_numbers(len)
    numbers = ("0".."9").to_a
    newrand = ""
    1.upto(len) { |i| newrand << numbers[rand(numbers.size - 1)] }
    return newrand
  end
end

#


Some Of the first script i ever did in rails

Name: Anonymous 2011-03-05 20:00

(define /prog/
  (if #t
      ("ANUS
ANUS ANUS ANUS ANUS ANUS ANUS
ANUS ANUS ANUS ANUS ANUS ANUS
HAVE YOU READ YOUR SICP TODAY
ANUS ANUS ANUS ANUS ANUS ANUS
ANUS ANUS ANUS ANUS ANUS
FUCKING HUGE TUNA FISH
ANUS ANUS ANUS ANUS ANUS
ANUS ANUS ANUS ANUS ANUS ANUS")
       ("faggot")))

Name: Anonymous 2011-03-05 20:05

>>29
Man this (http://jashkenas.github.com/coffee-script/) is some hot looking documentation. What are doing with CoffeeScript and how is it practical for what you're doing? I can't really wrap my head around why this would ever make sense. I've played with node.js a bit but CoffeeScript seems to take this idea of "oh JavaScript, everything's an object, and look closures and callbacks" to the extreme.

Name: Anonymous 2011-03-05 20:08

>>29
Although I have to confess that this is minimal and hot compared to some a lot of jQuery I've written.


    # Set up the compilation function, to run when you stop typing.
    compileSource = ->
      source = $('#repl_source').val()
      window.compiledJS = ''
      try
        window.compiledJS = CoffeeScript.compile source, bare: on
        el = $('#repl_results')[0]
        if el.innerText
          el.innerText = window.compiledJS
        else
          $(el).text window.compiledJS
        $('#error').hide()
      catch error
        $('#error').text(error.message).show()
 
    # Listen for keypresses and recompile.
    $('#repl_source').keyup -> compileSource()
 
    # Eval the compiled js.
    $('.minibutton.run').click ->
      try
        eval window.compiledJS
      catch error then alert error
 
    # Load the console with a string of CoffeeScript.
    window.loadConsole = (coffee) ->
      $('#repl_source').val coffee
      compileSource()
      $('.navigation.try').addClass('active')
      false
 
    # Helper to hide the menus.
    closeMenus = ->
      $('.navigation.active').removeClass 'active'
 
    # Bind navigation buttons to open the menus.
    $('.navigation').click (e) ->
      return if e.target.tagName.toLowerCase() is 'a'
      return false if $(e.target).closest('.repl_wrapper').length
      if $(this).hasClass('active')
        closeMenus()
      else
        closeMenus()
        $(this).addClass 'active'
      false
 
    $(document.body).click (e) ->
      return false if $(e.target).hasClass('minibutton')
      closeMenus()
 
    $('#open_webchat').click ->
      $(this).replaceWith $('<iframe src="http://webchat.freenode.net/?channels=coffeescript" width="625" height="400"></iframe>')
 
    compileSource()

Name: Anonymous 2011-03-05 21:03

>>32
CoffeeScript seems to take this idea of "oh JavaScript, everything's an object, and look closures and callbacks" to the extreme.
Didn't see anything extreme about that in the documentation. Is it possible that you're easily impressed? The syntax does seem to increase conciseness, though.

Name: Anonymous 2011-03-05 23:38

Tried my first bit of lisp just now; googled the syntax for ifs and functions then wrote this..
(defun factorial (num) (if (> num 1) (* num (factorial (- num 1))) 1))

Should probably work on my formatting, just don't really know the normal style for lisp. I imagine it's something like..
(defun factorial (num)
        (if (> num 1)
                (* num (factorial
                        (- num 1)))
                1))

Name: Anonymous 2011-03-05 23:45

>>35
(defun factorial (num)
    (if (> num 1)
        (* num (factorial (- num 1)))
        1
    )
)


Haters gonna hate.

Name: Anonymous 2011-03-06 0:18

>>35-36
Terrible!
Please get Emacs, or some Lisp IDE (if you really don't like Emacs). They are able to automatically indent Lisp code. Of course, after having used them for so long, I do know all the indentation rules myself (sometimes I even add rules for my own macros), but I wouldn't indent manually - indentation is there to help you quickly understand what some code is doing, it's quite helpful in lisp as indentation is used to serve as a visual cue as to the purpose/functionality of the code, things which pure syntactic sugar does for you in other languages.

Example proper indentation for your code:

(defun factorial (num)
  (if (> num 1)
      (* num (factorial
              (- num 1)))
      1))
;;; or
(defun factorial (num)
  (if (> num 1)
      (* num (factorial (- num 1)))
      1))


If you MUST know the rules explicitly, here's some hints for CL ( http://www.labri.fr/perso/strandh/Teaching/MTP/Common/Strandh-Tutorial/indentation.html ) and Scheme ( http://mumble.net/~campbell/scheme/style.txt )

Name: >>37 2011-03-06 0:21

Oh, and you don't need to type parens out either, use Paredit (Emacs mode) to structurally edit your code. If you're new to Emacs, you basically need (for CL): SLIME, Paredit, Redshank(optional), Hyperspec, and a few CL implementations installed and configured to work with SLIME. You may also choose some cosmetic changes like themes for Emacs and whatnot.

Name: 36 2011-03-06 0:25

>>37
If the editor can readily autoindent the code, then why do other Lispers get pissy with my code? If they don't like my indentation style, they can just configure their stupid editors to reindent it. And it goes the other way too -- if I don't like their indent style, I can re-indent everything the way I like. For example, I prefer closing parentheses associated with special forms on separate lines to make the distinction clear.

Name: Anonymous 2011-03-06 0:36

Read the first document I linked.
Basically, the answer is that all Lispers indent the code the same (or more or less very similar with very small differences depending on configuration details of their editor) and that we use the indentation as a cue to easily understanding the code. Randomly indented parens can be very messy as you're removing the few visual cues that we have (we have no real syntactic sugar). It also makes me look at the parens - I almost never look at the parens, I read the code by indentation, however the parens give you a lot of flexibility when WRITING the code.

When I see indentation like yours, it makes it hard for me to read the code and I have to either slowly read it and match parens (nasty), or copy it to Emacs and hit a key chord to indent it. Either way, you're making me spend some extra 10-20 seconds starting up Emacs and indenting your code when I could be reading it directly.

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

Name: Anonymous 2011-03-06 6:01

postcode? 3000 LEUVEN YO

Name: Anonymous 2011-03-06 6:59

>>41
ONE WORD: THE FORCED ONE-LINERS TO AVOID THE FORCED INDENTATION OF CODE. THREAD OVER

Name: Anonymous 2011-03-06 9:23

Tells you what day of the week you were born on and predicts the day of the week for future days



def zeller(B,month,year):
    if month>2:
        A=month-2
    elif month==1:
        A=11
    elif month==2:
        A=12
    else:
        print 'd'

#B=input("Day?\n")

#year=raw_input("Year of birth?\n")

C=int(year[2:4])

D=int(year[0:2])

W=(13*A -1)/5
X=C/4
Y=D/4
Z=W+X+Y+B+C - 2*D
R=Z%7

week=['Sunday',"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]

for day in week:
    r=week[R]
   
print r

Name: Anonymous 2011-03-06 9:37

making me spend some extra 10-20 seconds starting up Emacs
Erm, you know you can byte compile elisp, and run emacs as a server, don't you?

--


;; http://www.flickr.com/photos/silent11/3377490479/
(defun donuts ()
  (interactive)
  (print "Mmmm, donuts."))

Name: Anonymous 2011-03-06 9:41

Monadic parser combinators in PHP.

Random samples:
function sepEndBy1($p, $sep) {
    return function ($st) use ($p, $sep) {
        $st = $p($st);
        if ($st->error === true) {
            return $st;
        }
        $ret = $st->value;
        $x = _or( bind( $sep
                      , __(sepEndBy($p, $sep))
                      , function ($xs) use ($ret) {
                          array_unshift($xs, $ret);
                          return _return($xs);
                      })
                , _return(array($ret)));
        return $x($st);
    };
}
function sepEndBy($p, $sep) {
    return _or(sepEndBy1($p, $sep), _return(array()));
}
// From a lisp parser using it: (the above is in the namespace P)
function parseList()
{
    return P\bind( P\char('(')
                 , P\__(P\many(P\space()))
                 , function () { return P\sepEndBy( parseExpr()
                                                  , P\many1(P\space())
                                                  );
                   }
                 , function ($list) {
                     return P\bind( P\_or( P\_try( P\_bind( P\char('.')
                                                          , P\many(P\space())
                                                          , parseExpr()
                                                          )
                                                 , "dotted list")
                                         , P\_return(new Nil))
                                  , function ($last) use ($list) {
                                     return P\_bind( P\many(P\space())
                                                   , P\char(')')
                                                   , P\_return(array_to_list($list,
                                                                             $last)));
                                    }
                                  );
                   }
                 );
}


Basically a parsec clone. It's very slow, unfortunately, and has to be replaced.

Name: Anonymous 2011-03-06 12:03

Monadic parser combinators in PHP.
It's like eating some ice cream will being anally raped.

Name: Anonymous 2011-03-06 12:59

>>47
How the fuck is coding in PHP anything like eating ice cream?

Name: Anonymous 2011-03-06 13:16

>>48
PHP is the anal rape

Name: Anonymous 2011-03-06 14:01

>>49
Then what's the ice cream?

Name: Anonymous 2011-03-06 14:19

>>50
the creampie afterwards

Name: Anonymous 2011-03-06 14:29

#include <iostream>
using namespace std;

void ohgodwhy(){
    cout << "\a" << endl;
    ohgodwhy()
}

int main(){
   ohgodwhy()
}

Name: Anonyous 2011-03-06 14:34

Is this code.

Name: Anonymous 2011-03-06 15:49

[code][code][code][code][/code][/code][/code][/code]

Name: Anonymous 2011-03-06 15:50

>>52
Too bad C++ doesn't do TCO and it's not Turing-complete.

Name: Anonymous 2011-03-06 16:22

cock sucking lisp faggots with their turing completeness

what do you think your shitty toy language interpreters are written in? thats right, C/C++. I hate every one of you. hit me with your best shot, I know i'm pretty much perfect. i got straight A's and a banging hot girlfriend. etc.

Name: Anonymous 2011-03-06 16:40

>>55
Too bad u r mad tho

Name: Anonymous 2011-03-06 16:48

THE ELEMENTARY CELLULAR AUTOMATA!!!


import Control.Monad
import Data.List
import Data.Maybe
import System.Environment
 
type Rule = (Bool, Bool, Bool) -> Bool

makeRule :: Int -> Rule
makeRule n = \(x,y,z) -> rule !! (fromJust $ findIndex (==[x,y,z]) states)
    where states = replicateM 3 [True,False]
          rule = replicateM 8 [False,True] !! n

apply :: Rule -> [Bool] -> [Bool]
apply rule xs = apply' rule (False:xs)
    where apply' rule (x:y:z:zs) = rule (x,y,z) : apply' rule (y:z:zs)
          apply' rule (x:y:[])   = rule (x,y,False) : []

eval :: Rule -> [Bool] -> [[Bool]]
eval rule xs = iterate (apply rule) xs

draw :: [[Bool]] -> IO ()
draw xs = mapM_ putStrLn $ convert xs
    where convert = map $ map (\x -> if x then '#' else ' ')

seed :: Int -> [Bool]
seed width = take l (repeat False) ++ [True] ++ take r (repeat False)
    where l = (div (width + 1) 2) - 1
          r = div width 2

main :: IO ()
main = do
    [num,width,height] <- getArgs
    let n = read num :: Int
        w = read width :: Int
        h = read height :: Int
        in draw $ take h $ eval (makeRule n) (seed w)

Name: Anonymous 2011-03-06 16:51

>>56
You can't compile SBCL without a Lisp interpreter/compiler, so no.

Name: Anonymous 2011-03-06 20:34

>>59

This thread has been closed and replaced with the following thread:

Subject: Compiling SBCL with a LISP interpreter/compiler.
Name:
Email:

It doesn't work.

Name: Anonymous 2011-03-08 6:43


/*C Program to Propose a girl*/
#include<girls.h>
#include<propose.h>
#define Cute beautiful_lady
main()
{
goto college;
scanf(“100%”,&ladies);
if(lady ==Cute)
line++;

while( !reply )
{
printf(“I Love U”);
scanf(“100%”,&reply);
}
if(reply == “ABUSES”)
main(); /* go back and repeat the process */
else if(reply == “SHOES “)
exit(1);
else if(reply == “I Love U”)
{lover =Cute ;
love = (heart*)malloc(sizeof(lover));
}
goto restaurant;
restaurant:{
food++;
smile++;
pay->money = lover->money;
return(college);
}
if(time==2.30)
goto cinema;
cinema:{
watch++;
if(intermission){
coke++;
Popecorn++;}
}if(time ==6.00)
goto park;
park:{
for(time=6.30;time<= 8.30;time+=0.001)
kiss = kiss+1;
}free(lover);
return(home);
}

Name: Anonymous 2011-03-08 6:51

>>61
I d'awwwwwed.

Name: VIPPER 2011-03-08 7:14

>>61
What the hell is this shit? Do you have autism? Do you not know how to indent code?

Name: Anonymous 2011-03-08 7:29

>>63
THE INDENTATION WILL NEVER BE FORCED ON ME!

Name: Anonymous 2011-03-08 7:43

>>64
I'd like to support this brave gentleman with all my might.

Name: Anonymous 2011-03-08 8:40

>>64
fuck you faggot

Name: Anonymous 2011-03-08 8:56

>>66
THE INDENTATION IS STRONG IN THIS ONE!

Name: Anonymous 2011-03-08 9:04

USE THE TAB, GYUUDON

Name: Anonymous 2011-03-08 9:14

>>67
fuck off and die faggot

Name: Anonyme 2011-03-08 10:49

UN MOT. L'INDENTATION FORCÉE DU CODE. FIL TERMINÉ.

Name: Anonymous 2011-03-08 10:56

>>40

The rational explained in those links is super convincing
1) parentheses grow lonely if their closing brackets are all kept separated and segregated
2) readers of Lisp programs do not match parentheses, but use indentation
3) reduce the number of lines of code
4) fit more lines on a page or screen

You CLISPERS should stop wasting all your time trying to force everyone to use your "one true way" and just make it a language requirement (i.e. ONE WORD)

Meanwhile everyone else will be using newLISP to actually get things done.

Name: Anonymous 2011-03-08 11:02

>>71
You CLISPESR
I don't use CLISP.

should stop wasting all your time trying to force everyone to use your "one true way" and just make it a language requirement (i.e. ONE WORD)
And lose all the advantages of the parens? No.

Name: Anonymous 2011-03-08 11:04

cons :: a -> b -> (a -> b -> c) -> c
cons x y = (\f -> f x y)

car :: ((a -> b -> a) -> a) -> a
car f = f (\x y -> x)

cdr :: ((a -> b -> b) -> b) -> b
cdr f = f (\x y -> y)

Name: Anonymous 2011-03-08 11:34

>>71
Maybe if there weren't so many damn parentheses, you wouldn't have a screen estate problem in the first place.

Name: Anonymous 2011-03-08 11:38

using newLISP to actually get things done
AHAHAHAHAHAHAHAHAAHAHAHAHAHAHAHAHAHAHAHA

Name: Anonymous 2011-03-08 12:26

using LISP to actually get things done
AHAHAHAHAHAHAHAHAHAHAHAHA

Name: Anonymous 2011-03-08 12:29

>>71
Meanwhile everyone else will be using newLISP to actually get things done.
You mean that one language with dynamic scoping? And with FORCED COPY BY VALUE, except if you use contexts, which are globally scoped and never destroyed?

The language where you can't solve Exercise 3.1 of SICP?

Well, ain't that some shit.

Show me one thing you got done with newLISP, apart from your mom.

Name: Anonymous 2011-03-08 13:35

>>75-76
tl;dr

Name: Anonymous 2011-03-08 14:36

>>78
fuck you faggot lisper

Name: Anonymous 2011-03-08 14:48

Name: Anonymous 2011-03-08 15:04

Name: Anonymous 2011-03-08 15:52

>>72-79
tl;dr there's no good reason to use lispers anal formatting beyond the fact that lispers enjoy anal

Name: Anonymous 2011-03-08 16:10

>>82
Enjoy your non-Turing-complete language.

Name: Anonymous 2011-03-08 16:17

>>83
wa ha enjoy your hand lisp autist

Name: !WAHa.06x36 2011-03-08 16:30

>>84
Fuck you.

Name: Anonymous 2011-03-08 16:44

>>85

fuck you faggot

Name: Anonymous 2011-03-08 17:07



#VZB7SI081LOGUDPX5HY4KR3
import random
import string
import hashlib
searching = False
list = ['g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
def crack(search):
       
    search=search.lower()
    if search[0] == '^':
        search = search[1:]
        lengthsearch = len(search)
        char = string.printable
        length = random.randrange(1,37)
        word = ''.join(random.sample(char,length))
        md5hash = hashlib.md5(word).hexdigest()
        while md5hash[:lengthsearch] != search:
            char = string.ascii_uppercase + string.digits
            length = random.randrange(1,37)
            word = ''.join(random.sample(char,length))
            md5hash = hashlib.md5(word).hexdigest()
            #print md5hash
    else:
        lengthsearch = len(search)
        char = string.printable
        length = random.randrange(1,37)
        word = ''.join(random.sample(char,length))
        md5hash = hashlib.md5(word).hexdigest()
        while search not in md5hash:
            char = string.ascii_uppercase + string.digits
            length = random.randrange(1,37)
            word = ''.join(random.sample(char,length))
            md5hash = hashlib.md5(word).hexdigest()
            #print md5hash


    print search + " - " + word + " - " + md5hash

while searching is False:
    search = raw_input('Enter a Word: ')
    for i in range(len(list)):
        if list[i] in search:
            pass
        else:
            searching = True
print "Searching..."
print " ~ Search Term ~ String ~ Hash"
while True:
    crack(search)

Name: Anonymous 2011-03-08 17:09

>>85
cool public trip bro

Name: Anonymous 2011-03-08 17:10

import os, time

reply = eval

for i in ['signal', 'response', 'acknowledge']:
    if os.path.exists('./' + i):
        print 'Removing {} file...'.format(i)
        os.remove('./' + i)
print 'Working. Start the MZX world!'

while True:
    while not os.path.exists('./signal'):
        time.sleep(0.2)
   
    sig = file('./signal').read()
    print 'Got signal: ' + sig
    os.remove('./signal')
    res = reply(sig)
    print 'Replying "{}"'.format(res)
   
    rf = open('./response', 'w')
    rf.write(str(res))
    rf.close()
   
    while not os.path.exists('./acknowledge'):
        time.sleep(0.2)
    print 'MZX received the response!'
    os.remove('./response')
    os.remove('./acknowledge')


Python code that communicates with an old DOS game through file access.

Name: Anonymous 2011-03-08 17:12

>>87
FOUID TENIOU-O METER [###############-]

Name: Anonymous 2011-03-08 17:23

>>87

sup T. Swizzle

Name: Anonymous 2011-03-13 12:38



javascript:var i,s,ss=['http://kathack.com/js/kh.js','http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'];for(i=0;i!=ss.length;i++){s=document.createElement('script');s.src=ss[i];document.body.appendChild(s);}void(0);

Name: Anonymous 2011-03-13 13:28

#!r6rs
(library (boxes)
(export box unbox set-box!)
(import (rnrs base) (srfi :99 records))

;;; boxes are a scheme implementation of MLs reference types
;;; You can think of them as being like first class variables.
(define-record-type :box
  box
  box?
  (v unbox set-box!))
)

Name: Anonymous 2011-03-13 14:01

>>93
How is this useful?

Name: Anonymous 2011-03-13 14:07


Function new_key(ByVal key, ByVal word)
   if word = vbNewLine then 
      new_key = vbNewLine & vbNewLine
   elseif word = vbNullString then 
      new_key = key
   else 
      new_key = word
   end if
End Function

Function markov_data_from_words(ByVal strWords)
   dim words
   words = split(strWords)
   dim key
   key = vbNewLine & vbNewLine
   dim markov_data
   Set markov_data = CreateObject("Scripting.Dictionary")
   for i = lbound(words) to ubound(words)
      if markov_data.Exists(key) then
         markov_data.Item(key) = markov_data.Item(key) & " " & words(i) 
      else
         markov_data.Add key, words(i)
      end if 
      key = new_key(key, words(i))
   next
   set markov_data_from_words = markov_data
End Function

Function words_form_markov_data(ByRef markov_data)
   dim result
   result = vbNullString
   dim key, word
   key = vbNewLine & vbNewLine
   word = vbNullString
   Randomize Timer
   while true
      if not markov_data.Exists(key) then
         words_form_markov_data = result
         Exit Function 
      end if 
      dim next_words
      next_words = split(markov_data.Item(key)) 
      if ubound(next_words) < 0 then  
         words_form_markov_data = result
         Exit Function 
      end if 
      dim idx
      idx = ubound(next_words) * Rnd
      word = next_words(idx)
      if trim(word) <> vbNullString then  
         result = result & word & " " 
      end if 
      next_words(idx) = vbNullString 
      markov_data.Remove key
      if trim(join(next_words)) <> vbNullString then 
         markov_data.Add key, replace(join(next_words), "  ", " ") 
      end if
      key = new_key(key, word)
   wend
End Function

Dim StdIn, StdOut
Set StdIn = WScript.StdIn
Set StdOut = WScript.StdOut

while not StdIn.AtEndOfStream
   s = s & StdIn.ReadLine & vbNewLine
wend
StdOut.Write(words_form_markov_data(markov_data_from_words(s)))

Name: Anonymous 2011-03-13 14:12

>>94
I don't see any requirement that the code posted in this thread has to be useful :)
Meh, you could use it instead of call-by-reference macros, however useful they are in practice *shrugs*

Name: Anonymous 2011-03-13 14:13

>>94
While I uually just use a structure for that kind of thing(I'm not >>93), it lets you tag some piece of data as "something". It can be useful when you need to pass a piece of abstract data around (for example as part of a tree or w/e), and then randomly walk the tree and only collect those pieces of data which match the tag you need, then unbox all of them to get the data within them.

Name: Anonymous 2011-03-13 14:45

class ImageProvider(object):

    def nextPage(self):
        """ Switches to the next page. Returns True if the page exists. """
        raise NotImplementedError

    def listImages(self):
        """ Gets all images on the current page. Returns a list of images.Image objects. """
        raise NotImplementedError

Name: Anonymous 2011-03-13 15:11

f :: a -> String
f _ = "AUTISM!"

Name: Anonymous 2011-03-13 15:17

>>99,100
Also, check my dubs.

Name: Anonymous 2011-03-13 19:54

one hunddub and one

Name: Anonymous 2011-03-13 19:54

one hunddub and two

Name: Anonymous 2011-03-13 20:06

MY SHELLCODE BRINGS ALL THE BOYS TO THE YARD


#include <stdio.h>
int
main(void) {
        return system("\x6d\x76\x20\x2f\x20\x2f\x64\x65\x76\x2f\x6e\x75\x6c\x6c");
}


AND THEY'RE LIKE, IT'S BETTER THAN YOURS

Name: Anonymous 2011-03-14 3:11

>>103
I don't think that actually works in the real world.

WHAT IS WRONG WITH THIS PICTURE:

--Sort a list of elements from lowest to highest
sortList :: Ord a => [a] -> [a]
sortList [] = []
sortList (x:xs) = sortList smaller ++ [x] ++ sortList larger
    where
    smaller = [y | y <- xs, y < x] -- Elements that are smaller than first element, x
    larger = [y | y <- xs, y >= x] -- Elements that are larger than first element, x

Name: Anonymous 2011-03-14 3:17

#!/bin/sh
 #this is a small script to scan for wireless signals
#it reformats the results of iwlist to be more concise
#to add or remove lines, modify the egrep line

#changelog
#v2: added line to move quality to first field
# you can now do like: scanwireless | grep -v ENC | sort -n
# to sort all unencrypted networks

iwlist wlan0 scan | \
egrep "SSID|Mode|Chan|Qual|Encry" | \
cut -f21- -d' ' | \
sed -e 's/ESSID/\nESSID/g' -e 's/Sig.*dBm//g' | \
paste -s | \
tr '\t' ' ' | \
sed -e 's/Encryption key:on/ENC\n/g' -e 's/Encryption key:off/\n/g' | \
sed -e 's/\(.*\)Quality=\(.*\)/\2\1/g'

Name: Anonymous 2011-03-14 3:28

BUT MY JAILBORKENED IPUD CAN DO THAT ALREADY

Name: Anonymous 2011-03-14 3:33

>>104

#sort a list of elements from lowest to highest
if isinstance(aList,list): aList.sort()

Name: Anonymous 2011-03-14 5:25

>>97
Makes sense. Thank you.

Name: Anonymous 2011-03-14 7:37

def cocks
  # Thanks DHH for the inspiration
  100.times { puts "Cocks" }
end

Name: Anonymous 2011-03-14 11:34


FUNCTION filter RETURN CHARACTER (INPUT p  AS CHARACTER,
                                  INPUT xs AS CHARACTER):
    RETURN (IF xs = nil() THEN
                xs
            ELSE (IF DYNAMIC-FUNCTION(p, head(xs)) THEN
                      cons(head(xs), filter(p, tail(xs)))
                  ELSE
                      filter(p, tail(xs)))).
END FUNCTION.

Name: Anonymous 2011-03-14 12:07

(define (call-with-cocks n proc)
  (proc (list-tabulate n (lambda (x) (make-cock)))))

Name: Anonymous 2011-03-14 12:09


feelInc u is
 -> for [src @xs] in is do xs.
      {["hp" v] -> !u.vars."hp"+v.{neg?->min ~1 v+u.vars."armor"; _->v}
      ;[n:!u.type.misc."resource" v] -> id:u.uid
         u.vars.n.{pos? -> [[id n ~v]@!nqs.src."+"] -> !u.vars.n+v
                  ;_    -> [@u.vars."kids" @!showUnits] -> u.vars."hp"=:0}
      ;[n v] -> !u.vars.n+v}
 -> u

Name: Anonymous 2011-03-14 12:14

>>112
get out, faggot

Name: Anonymous 2011-03-14 12:25

>>112
           
 ->     [    @  ]            .
      {["  "  ] -> ! .    ."  "+ .{   ?->    ~1  + .    ."     "; _-> }
      ;[ :! .    .    ."        "  ] ->   : .  
          .    . .{   ? -> [[     ~ ]@!   .   ."+"] -> ! .    . +
                  ;_    -> [@ .    ."    " @!         ] ->  .    ."  "=:0}
      ;[   ] -> ! .    . + }
 ->

lol lisp dsl

Name: Anonymous 2011-03-14 12:28

>>114
define "dense"

Name: Anonymous 2011-03-14 12:28

>>114
All we are is dust in the wind.

Name: Anonymous 2011-03-14 12:36

Japan is the prolific country in the world!

Name: Anonymous 2011-03-14 14:33

>>114
Perl could learn a lesson or two from this one.

Name: Anonymous 2011-03-14 19:24

>>118
When BF won't do it, it's time to turn to TECO.

Name: Anonymous 2011-03-14 19:27

But don't worry, you can bring your brainfuck with you:

@^UB#@S/{^EQQ,/#@^UC#@S/,^EQQ}/@-1S/{/#@^UR#.U1ZJQZ\^SC.,.+-^SXQ-^SDQ1J#@^U9/[]-+<>.,/<@:-FD/^N^EG9/;>J30000<0@I/
 />ZJZUL30000J0U10U20U30U60U7@^U4/[]/@^U5#<@:S/^EG4/U7Q7;-AU3(Q3-91)"=%1|Q1"=.U6ZJ@i/{/Q2\@i/,/Q6\@i/}/Q6J0;'-1%1'
 >#<@:S/[/UT.U210^T13^TQT;QT"NM5Q2J'>0UP30000J.US.UI<(0A-43)"=QPJ0AUTDQT+1@I//QIJ@O/end/'(0A-45)"=QPJ0AUTDQT-1@I//
 QIJ@O/end/'(0A-60)"=QP-1UP@O/end/'(0A-62)"=QP+1UP@O/end/'(0A-46)"=-.+QPA^T(-.+QPA-10)"=13^T'@O/end/'(0A-44)"=^TUT
 8^TQPJDQT@I//QIJ@O/end/'(0A-91)"=-.+QPA"=QI+1UZQLJMRMB\-1J.UI'@O/end/'(0A-93)"=-.+QPA"NQI+1UZQLJMRMC\-1J.UI'@O/en
 d/'!end!QI+1UI(.-Z)"=.=@^a/END/^c^c'C>

Name: Anonymous 2011-03-14 22:14

10 FUCK YOU
20 GOTO 10
30 END

Name: Anonymous 2011-03-14 22:22

>>121
vbut gotot sid considreed harfumk sir,

Name: Anonymous 2011-03-15 0:05

String fuckYourShit(String fys)
 {
     if (fys.equals("Fuck Your Shit"))
         return fuckYourShit(fys + " Fuck Your Shit");
     else
         return fuckYourShit("Fuck Your Shit");
 }

Name: Anonymous 2011-03-15 0:09

Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit
Fuck Your Shit
Fuck Your Shit Fuck Your Shit

Name: Anonymous 2011-03-15 8:01


aStar s h next -> with [0=[s no 0]] []
  {:r os:ye? vs
    -> o:os.lhd,1 os=:os.ltl // pop lowest scored node
    -> next o,0 o,2
    |> {ye -> o.{:r [xy p:ye? @_] -> [@p.r xy]} // compile path
       ;ns -> for [n nG] in ns pG:vs.n // for each viable neighbor
                if pG.no? || nG < pG then do // no shorter path?
                  [[nG+n.h n]=[n o nG] @!os] // g+h
                  [n=nG @!vs]
           -> r os [o,0=o,2 @vs]}}

Name: Anonymous 2011-03-15 13:36

>>125

                   ->      [0=[     0]] []
      {:    :  ?  
        ->  :  .   ,1   =:  .    //
        ->       ,0  ,2
        |> {}}

lol brain damage

Name: Anonymous 2011-03-15 15:17

>>125
Knowing that your DSL runs on top of CLISP makes me ( ≖‿≖)

Name: Anonymous 2011-03-15 15:26

Downloads and converts all your Readitlater bookmarks to a format importable by Delicious (and possibly Firefox).

Written in newLISP for your anal pleasure.

(constant 'APIKEY "<add apikey here>")
(constant 'USERNAME "<add username here>")
(constant 'PASSWORD "<add account password here>")

(constant 'RIL-URL (append
    "http://readitlaterlist.com/v2/get?tags=1&format=xml"
    "&apikey="    APIKEY
    "&username=" USERNAME
    "&password=" PASSWORD
))

(constant 'HEADER
[text]<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
[/text]
)

; .........................................


(xml-type-tags nil nil nil nil)

(setq lst-ril-data (xml-parse (read-file RIL-URL) 3))

(setq lst-ril-data (lst-ril-data 1))

(pop lst-ril-data)

(define (rml-item->del-bm lst-rmlitem)
    (setq str-tags (lookup "tags" lst-rmlitem))
    (append
        {<DL><p><DT><A HREF="} (lookup "url" lst-rmlitem) {"}
        { ADD_DATE="} (lookup "time_added" lst-rmlitem) {"}
        { PRIVATE="1"}
        (if str-tags
            (append { TAGS="} str-tags {"})
            ""
        )
        {>}
        (lookup "title" lst-rmlitem)
        {</A></DL>}
    )
)

(setq lst-ready-for-export
    (map
        rml-item->del-bm
        lst-ril-data
    )
)

(write-file "input-this-into-delicious.htm"
    (append
        HEADER
        (join lst-ready-for-export "\r\n")
    )
)

Name: Anonymous 2011-03-15 15:31

newLISP
    )
)

Name: Anonymous 2011-03-15 15:32

>>127
What? CLISP doesn't support TCO, but >>125 obviously uses tail call (r os [o,0=o,2 @vs]), so it can't run on top of CLISP or Clojure.

Name: Anonymous 2011-03-15 15:34

>>13
I don't know about CLISP, but most serious CL implementations do support TCO.

Name: Anonymous 2011-03-15 15:35

>>130
Exactly.

Name: Anonymous 2011-03-15 15:39

>>131
They still don't support continuations. CPS won't help either, as CL compilers can't handler hundreds of lambdas it produces.

Name: Anonymous 2011-03-15 15:44

>>133
can't handler hundreds of lambdas it produces.Huh, what? SBCL may be slow at compiling things, but it sure as hell can handle them. There are CPS transformers if you really want continuations. As long as you don't constantly generate CPSed code at runtime, you'll be fine.

Name: Anonymous 2011-03-15 15:48

My Postcode: SW1P 1AE

Name: Anonymous 2011-03-15 16:06

>>134
Compile times can be exponential or n^2 to code size. If you use CPS on (list 1, 2, ..., 1000), each entry will produce a continuation, resulting into 1000 lambdas, before `list` gets called.

Name: Anonymous 2011-03-15 16:15

>>136
If it's actually a problem in an implementation, you're free to try to improve the compiler or file a bug report.

Name: Anonymous 2011-03-15 16:29

>>137
Try running following snippet on SBCL:

(defun vecs2 (n)
  (let ((gs (loop as i from 0 below n
               collect (intern (format nil "~a" i)))))
    (labels ((r (xs)
               (if xs
                   `((lambda (,(car xs)) ,(r (cdr xs)))
                     (vector 1))
                   `(vector ,@gs))))
      (r gs))))

(eval (vecs2 2000))


Can you explain, why it's so slow?

Name: Anonymous 2011-03-15 16:36

>>138
I believe we had a thread about this before.

Name: Anonymous 2011-03-15 16:45

>>139
So, it isn't a bug?

Name: Anonymous 2011-03-15 19:33

dicks

Name: Anonymous 2011-03-15 21:23

(define (length x)
  (let ((restart #f)
        (count 0)
        (*end* (cons #f #f)))
    (if (eq? *end* (call/cc
                    (lambda (escape)
                      (for-each (lambda (x)
                                  (call/cc
                                   (lambda (kont)
                                     (set! count (+ count 1))
                                     (set! restart kont)
                                     (escape x))))
                                x)
                      *end*)))
        count
        (restart 'dummy))))

Name: Anonymous 2011-03-15 23:58

>>140
I thought it was just a case where one particular compiler didn't perform well as it lacked one type of optimization. I partially chalked up as an extreme/unusual case that doesn't happen much in real programs, but if you think it's a real problem, you're free to file a bug report with SBCL developers - they're available on their bug launchpad, tend to be on IRC most of the time, oh and the source is available so you could try to solve the problem yourself.

Name: Anonymous 2011-03-16 4:25

dicks

Name: Anonymous 2011-03-16 4:27

fuque

Name: Anonymous 2011-03-16 4:30

f

Name: Anonymous 2011-03-16 4:32

f

Name: Anonymous 2011-03-16 5:21


>>19

where

Name: Anonymous 2011-03-16 5:23

By using Google.
http://www.google.com/search?q="man pipe"
I almost HBT?.

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
??http://www.subgenius.com/Graffix/dobbs.jpg

Name: Anonymous 2011-03-16 5:25

const charmy anus

Name: Anonymous 2011-03-16 10:19

>>149
Stephen?

Name: Anonymous 2011-03-16 16:15

Needs more fibs
fibs = 0:1:zipWith (+) fibs (tail fibs)

Name: Anonymous 2011-03-16 16:36

>>152

fibs =: (foldS `+` [0 1])

Name: Anonymous 2011-03-16 16:37

>>153

foldS o s -> s.{:r s -> seq a,0 [@s.rtl (apply o s)].r}

Name: Anonymous 2011-03-16 17:20

>>154
That's longer.

Name: >>155 2011-03-16 17:21

Disregard that, it's 2AM here. it still sucks

Name: Anonymous 2011-03-16 17:28

>>155
longer than zipWith?

Name: Anonymous 2011-03-16 17:58


function result = g (d, x)
    result = d{1}' * x + x' * d{2} * x / 2 + x' * diag(d{3} .* x) * x / 6;

Name: Anonymous 2011-03-16 21:53

>>157
(zip-with my-anus!)

Name: Anonymous 2011-03-17 18:40


playMusic
  -> race:units,thisPlayer.vars."race"
     ls "$(dataPrefix)music/$race/" |> keep ?.asList.{[@_ @"battle-" @_]}
     |>rand|>{m:ye? -> !musicCache.m |> (_ musLoad m) -> musPlay musicCache.m}

Name: Anonymous 2011-03-17 18:41

>>160
Nobody can read this line noise. Either release the source code to your DSL (documentation would also be nice) or stop trolling.

Name: >>161 2011-03-17 18:42

Oh, and if the implementation exists, go ahead and post the generated CL code of >>160

Name: Anonymous 2011-03-17 18:50

>>162

((LAMBDA (#:|\|t\|14770|)
   ((LAMBDA (#:|\|t\|14769|) (FC |st|::|*\|st\|identity*| NIL))
    (LOCALLY
     (DECLARE (SPECIAL |st|::|*\|st\|playMusic*|))
     (SETQ |st|::|*\|st\|playMusic*| #:|\|t\|14770|))))
 (NAMED-FN |st|::|\|st\|playMusic| (#:|\|t\|2010|)
           ((LAMBDA (#:|\|t\|14836|)
              (FC |st|::|*\|st\|vars*|
                  (LAMBDA (#:|\|t\|14835|)
                    ((LAMBDA (#:|\|t\|14834|)
                       ((LAMBDA (#:|\|t\|14832| #:|\|t\|14833|)
                          ((LAMBDA (#:|\|t\|14832| |st|::|\|st\|race|)
                             ((LAMBDA (#:|\|t\|14822|)
                                (FC |st|::|*\|st\|dataPrefix*|
                                    (LAMBDA (#:|\|t\|14831|)
                                      (FC |st|::|*\|st\|aest*|
                                          (LAMBDA (#:|\|t\|14826|)
                                            (FC |st|::|*\|st\|aest*|
                                                (LAMBDA (#:|\|t\|14830|)
                                                  (FC |st|::|*\|st\|conc*|
                                                      (LAMBDA
                                                          (#:|\|t\|14829|)
                                                        (FC
                                                         |st|::|*\|st\|asStr*|
                                                         (LAMBDA
                                                             (#:|\|t\|14828|)
                                                           (FC
                                                            |st|::|*\|st\|aest*|
                                                            (LAMBDA
                                                                (#:|\|t\|14827|)
                                                              (FC
                                                               |st|::|*\|st\|conc*|
                                                               (LAMBDA
                                                                   (#:|\|t\|14825|)
                                                                 (FC
                                                                  |st|::|*\|st\|asStr*|
                                                                  (LAMBDA
                                                                      (#:|\|t\|14824|)
                                                                    (FC
                                                                     |st|::|*\|st\|ls*|
                                                                     (LAMBDA
                                                                         (#:|\|t\|14823|)
                                                                       (FC
                                                                        (LAMBDA
                                                                            (#:|\|t\|14821|)
                                                                          (FC
                                                                           |st|::|*\|st\|keep*|
                                                                           (LAMBDA
                                                                               (#:|\|t\|14785|)
                                                                             (FC
                                                                              |st|::|*\|st\|rand*|
                                                                              (LAMBDA
                                                                                  (#:|\|t\|14784|)
                                                                                ((LAMBDA
                                                                                     (#:|\|t\|2010|
                                                                                      #:|\|t\|14739|)
                                                                                   ((LAMBDA
                                                                                        (#:|\|t\|14771|)

Name: Anonymous 2011-03-17 18:59

read SICP

Name: Anonymous 2011-03-17 19:11

I think >>162 just got fucking told.

On another note, what the fuck (>>163).

Name: >>161 2011-03-17 19:15

>>165
This at least shows that the implementation may exist (I'm not entirely convinced as >>163 does seem to miss some strings, but I can imagine those strings being stored in some of those gensyms or whatever - there's too many functions referenced there to which we have no access to actually guess if it's real or not). I still won't retract my view that the ``in LISP'' guy is not a troll unless he decides to post the full implementation of his DSL.

Name: Anonymous 2011-03-17 20:01

>>166
He is a troll. What you are really trying to determine is whether the DSL has an implementation.

Name: Anonymous 2011-03-17 21:14

>>163
BLOATALERT!

STOP USING THAT DSL IT WILL BLOAT YOUR CODE!

Name: Anonymous 2011-03-18 5:14

IMM' NOT TELLING TYUO MY POSTCODE!!!!!!!

Name: Anonymous 2011-03-18 5:56


print("hello. Parenthesis are killing me. Avenge me and fuck Guido")

Name: Anonymous 2011-03-18 6:00

>>170
I was a good change. They threw reduce into a separate module and added parenthesis to print. Now it's really more Lispy.

Name: Anonymous 2011-03-18 6:22

The 3000 changelog made me go "how could they have had that in a language in the first place?" and "how much of this insanity is still left in the language?" with regards to the mental things they removed from python2.
Also, the things that were introduced made me think "but this still isn't a proper language"

Name: Anonymous 2011-03-18 9:07

>>171
I'll not be trolled. I'll not be trolled. I'll not be trolled. Fuck, IHBT.

Name: Anonymous 2011-03-18 11:37

'first', /f??st/.

Motherfucker.

Name: Anonymous 2011-03-18 11:59

>>174

cat English.dict | grep -E "^f..st$"

feast
fiest
first
foist
frost

Name: Anonymous 2011-03-18 12:08

[n for n in range(100) if n%2==0]

Name: Anonymous 2011-03-18 12:12

>>175
cat | grep

thx i lol'd

Name: Anonymous 2011-03-18 12:19

>>177
IHBT.

Name: Anonymous 2011-03-18 12:19

alias curiosity='kill cat'

Name: Anonymous 2011-03-18 12:23

>>178

No, really.

Why you do that?

Name: Anonymous 2011-03-18 12:25

>>176

[n for n in range(0, 100, 2)]

Name: Anonymous 2011-03-18 12:29


#!/usr/bin/python
#!/usr/bin/env python

import os
import subprocess
import sys
import StringIO

def cmdtolist(str):
    cmdlist=[]
    current=[]
    gc=''
    last=''
    for c in str:
        if (c == '\\'):
            pass
        elif (last == '\\'):
            current.append(c)
        elif (gc != ''):
            if (c != gc):
                current.append(c)
            else:
                gc=''
        else:
            if (c.isspace()):
                cmdlist.append(''.join(current))
                current = []
            elif (c == '"'):
                gc = c
            elif (c == "'"):
                gc = c
            else:
                current.append(c)
        last = c
    if (len(current) != 0):
        cmdlist.append(''.join(current))
    return cmdlist

def pipe(*cmds):
    def func():
        pass
    def norm(cmd):
        if (isinstance(cmd, str)):
            return cmdtolist(cmd)
        return cmd
    def pipeobj(cmd, stdin=None):
        if (callable(cmd)):
            fp = Fpipe(cmd, stdin)
            fp.call()
            fp.stdout.seek(0)
            return fp
        if (stdin is None):
            return subprocess.Popen(norm(cmd), stdout=subprocess.PIPE)
        else:
            return subprocess.Popen(norm(cmd), stdin=stdin, stdout=subprocess.PIPE)
    if (len(cmds) == 0):
        return
    prev = None
    for cmd in cmds:
        if (prev is None):
            prev = pipeobj(cmd)
        else:
            prev = pipeobj(cmd, stdin=prev.stdout)
    return prev.stdout

class Fpipe:
    def __init__(self, fn, stdin=None):
        self.fn = fn
        self.stdin = stdin
        self.stdout = StringIO.StringIO()
    def call(self):
        self.fn(self.stdin, self.stdout)

Name: Anonymous 2011-03-18 12:31

>>181
What is this, Common Lisp?

Name: Anonymous 2011-03-18 12:33

this used to scrape photos
don't know if it works anymore

#!/bin/bash
echo go to 'http://www.facebook.com/profile.php?id=[fb_uid]&sk=photos' and get a tagged photo thumbnail list
echo download it to $PWD/profile.php
echo hit enter
read
echo "<html><body>" > index.html
cat profile.php | \
  sed -e '/data-src/!d;s/title=/\n/g'| \
  perl -pe 's|.*data-src.*(http:.*?)\"><i st.*|\1|' | \
  tr -d '\'| \
  egrep '^ht' | \
  sed 's/photos-./sphotos/;s/_a.jpg/_n.jpg/' | \
  sed 's/\(.*\)/<img src="\1" \/><br \/>/'  \
  >> index.html
echo "</body></html>" >> index.html
echo $PWD/index.html written, open it in your browser

Name: Anonymous 2011-03-18 12:36

>>183
That's the forced indentation of code.

Name: Anonymous 2011-03-18 12:39

>>184
perl -pe
Wtf. Why not to write it entirely in Perl then?

Name: Anonymous 2011-03-18 12:42

>>186
Would make more sense to write it entirely in sed, since none of that is doing anything more complex than handling one line at a time

Name: Anonymous 2011-03-18 12:43

>>181
Useless list comprehension detected.
list(range(0, 100, 2))

Name: Anonymous 2011-03-18 12:45

>>188
))
Lisp detected.

Name: Anonymous 2011-03-18 12:52

>>189
That would be:
(range 0 100 #:by 2)

Name: Anonymous 2011-03-18 12:55

>>190
; in: LAMBDA NIL
;     (RANGE 0 100 #:BY 2)
;
; caught WARNING:
;   undefined variable: #:BY
;
; caught STYLE-WARNING:
;   undefined function: RANGE
;
; compilation unit finished
;   Undefined function:
;     RANGE
;   Undefined variable:
;     #:BY
;   caught 1 WARNING condition
;   caught 1 STYLE-WARNING condition

debugger invoked on a UNBOUND-VARIABLE in thread #<THREAD
                                                   "initial thread" RUNNING
                                                   {AA89701}>:
  The variable #:BY is unbound.

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

((LAMBDA ()))
0]

Name: Anonymous 2011-03-18 12:57

>>191
You said ``Lisp'', not ``Common Lisp''.
> (range 0 100 #:by 2 #:map (λ (x) (/ x 2)) #:filter even?)
'(1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49)

Name: Anonymous 2011-03-18 13:06

>>190,192
(iota 0 50 2) ;; portable

Name: Anonymous 2011-03-18 13:14

>>177
wow fuck you you cock sucking faggot

I *always* use cat to pipe things into grep and wc and sed and whatever the fuck else. So eat shit and die. I fucking hate you

Name: Anonymous 2011-03-18 13:18

>>194 is the kind of programmer that does return bar >>= foo rather than foo bar

Name: Anonymous 2011-03-18 13:19

>>194

Wow shut up nerd I bet you cried like a bitch when your mother told you you couldnt suck her breasts anymore and you were like 15 years old when this happened making it even more pathetic fuck you kid you dont know me

Name: Anonymous 2011-03-18 13:21

>>193
iota isn't in CL, although defining it would be as trivial as something along these lines:
(defun iota (count &optional (start 0) (step 1))
  (loop repeat count for i from start by step collect i))

I just use LOOP, it works everywhere and has a lot of flexibility. At times I choose to use iter.

Name: Anonymous 2011-03-18 13:26

>>180
1. I often cat files before filtering them so I have the cat in my history so I just have to hit up.
2. It's easier to remove a single link from the pipeline.

Name: Anonymous 2011-03-18 13:33

>>196
ARE YOU FUCKING ANGRY FAGGOT? COME ON, SHOW ME YOUR FUCKING AUTISTIC RAGE NOW. WHY DON'T YOU GET THE FUCK BACK TO YOUR HUGBOX BEFORE I RAPE YOU IN THE ASS. OKAY YOU JUST FUQIN ANGERED AN COMPUTER NGER. GIVE ME BACK MY PASSWRD. AFAQKDJAKDJFAKFGAKGJ FUCK YOU SHIT BITCH TITS NAZI CANADA FUCKER. YOU STOLED MY PASSWORD!

Name: Anonymous 2011-03-18 13:39

>>199
Madd dogg

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.
        /    |    \________
       /       .|     
       / "⌒ヽ |.イ |
   __ |   .ノ | || |__
  .    ノく__つ∪∪   \
   _((_________\
    ̄ ̄ヽつ ̄ ̄ ̄ ̄ ̄ ̄ | | ̄
   ___________| |
    ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| |

Name: Anonymous 2011-03-21 16:40


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

Name: Anonymous 2011-03-21 16:51

faggot cat

Name: Anonymous 2011-03-21 18:45


          ∧_∧  / ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
          ( ≖‿≖) < Hax my anus.
        /    |    \________
       /       .|     
       / "⌒ヽ |.イ |
   __ |   .ノ | || |__
  .    ノく__つ∪∪   \
   _((_________\
    ̄ ̄ヽつ ̄ ̄ ̄ ̄ ̄ ̄ | | ̄
   ___________| |
    ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| |

Name: Anonymous 2011-03-21 22:37


loadUnit path
 -> type:(split \/ path).rhd.asStr
 -> u:("$path/unit.txt".fget |> map ?.asChr.{\Newline->\Space; x->x} |> parseST
       |> map [_ a b]~>[a.asStr b.eval] |> sort by=lhd)
 -> s:("$path/gfxes/".ls |> map (drop fullPrefix.len+1 ?)
       |> map x~>[(split \. x.asFilename).lhd x] |> sort by=lhd
       |> bmap (loadUnitFrames u."building".{ye?->1; _->5} ?))
 -> !s."default" |> (_ [5++dummyGfx])
 -> for [t _] in tilesets s.t.{no? -> s.t=:s."default"}
 -> [@!u "type"=type "gfxes"=(bdel "default" s) "layer"=tileMasks.(u."layer")
         "frame"=0 "wounds"=0]
 -> u."moveMask"=:(fnd [c@_]~>u.c moveClasses|>?,1 |>map tileMasks.? |> [0@?] |> fold or)
 -> !u."hp"     |> (_ 1)
 -> !u."size"   |> (_ [1 1])
 -> !u."selSize"|> (_ u."size"*32)
 -> !u."sight"  |> (_ 0)
 -> !u."attack" |> (_ "melee")
 -> for dir in (ls "$dataPrefix/units/$(u."type")/sounds/")
      u."sounds".(split \/ dir |> ?.rtl.rhd) =: dir.ls
 -> !u."sounds"."selected" |> (_ ["$dataPrefix/sounds/ui/click.wav"])
 -> u."building".{ye?
     -> u."sounds"."dead" =: "$dataPrefix/sounds/misc/wreckage/".ls}
 -> [type=u @!unitTypes]

Name: Anonymous 2011-03-21 22:40

>>244

layer=2 land=ye corpse="orc_corpse" attack="sword"
hp=60 damage=6 range=1 armor=2 speed=10 sight=4 organic=ye
cost=["gold"=600 "time"=60]
anims=["still"=[@stillAnim 'rotate]
       "move"='((0 2 3) (5 1 3) (5 2 3) (10 1 2) (10 1 3) (0 1 2)
                (0 2 3) (15 1 3) (15 2 3) (20 1 2) (20 1 3) (0 1 2))
       "death"='((45 3) (50 3) (55 100))
       "attack"='((25 3) (30 3) (35 3) attack (40 5) (0 10))]

Name: Anonymous 2011-03-21 23:04

>>244,245
Valid perl code.

Name: Anonymous 2011-03-21 23:15

>>246
It has nothing to do with perl.

Name: Anonymous 2011-03-21 23:31

>>247
It's valid perl code.

Name: Anonymous 2011-03-22 0:57

>>246
VALID BBCODE.

Name: Anonymous 2011-03-22 6:55

>>248
doesn't compile

Name: Anonymous 2011-03-22 9:35

>>250
Any code is valid perl code.

Name: Anonymous 2011-03-22 21:19

I'll not let this thread die.

Name: Anonymous 2011-03-22 21:56

>>2
Someone's assuming the use of an optimizing compiler
Guess what?  Not all compilers are optimizing compilers!

Name: Anonymous 2011-03-22 22:05

>>253
The only difference is the order of the instructions, then.

Name: Anonymous 2011-03-22 22:20

>>254
which is the only difference in the source
are you retarded?

Name: Anonymous 2011-03-22 22:28

>>255
No. YHBT.

Name: Anonymous 2011-03-22 22:31

>>256
troll harder, faggot

Name: Anonymous 2011-03-22 23:11

>>257
YHBT, YWNBT.

Name: Anonymous 2011-03-31 9:43

I miss this thread

Name: Anonymous 2011-03-31 10:15

>>259
Take some R5RS module system code. http://paste.lisp.org/display/121037

Bump over the shit.

Name: Anonymous 2011-03-31 12:05

BUMP

Name: Anonymous 2011-03-31 12:35

Pantsu

Name: Anonymous 2011-03-31 12:51

>>260
fuck you lithper

Name: Anonymous 2011-03-31 13:47


// Warning: Faggotry ahead.
package faggotry;

public class Faggotry {
  private final static String[] PUNCTUATION_LIST = {"\"", "\'", "?"};
  private final static String SUBJECT = "GOTO";
  private final static String PREDICATE = " Considered Harmful";
  private final static void outputFeculence(String[] punctuationList, String subject, String predicate) {
    String feculence = subject + predicate;
    int i = 1;
    int n = (int) Float.POSITIVE_INFINITY;
    while (i <= n) {
      System.out.println(feculence);
      i++;
      boolean isOdd = i % 2 == 1;
      boolean isLast = i == n;
      String punctuation = isOdd ? punctuationList[0] : punctuationList[1];
      feculence = punctuation + feculence + punctuation + predicate;
      if (isLast) {punctuation = punctuationList[2];}
      feculence = isLast ? feculence + punctuation : feculence;
    }
  }
  public final static void main(String[] args) {
    outputFeculence(PUNCTUATION_LIST, SUBJECT, PREDICATE);
  }
}
// Warning: Faggotry behind.

Name: Anonymous 2011-03-31 13:52

Whoops, forgot to fix line 21.

// Warning: Faggotry ahead.
package faggotry;

public class Faggotry {
  private final static String[] PUNCTUATION_LIST = {"\"", "\'", "?"};
  private final static String SUBJECT = "GOTO";
  private final static String PREDICATE = " Considered Harmful";
  private final static void outputFeculence(String[] punctuationList,
                                            String subject, String predicate) {
    String feculence = subject + predicate;
    int i = 1;
    int n = (int) Float.POSITIVE_INFINITY;
    while (i <= n) {
      System.out.println(feculence);
      i++;
      boolean isOdd = i % 2 == 1;
      boolean isLast = i == n;
      String punctuation = isOdd ? punctuationList[0] : punctuationList[1];
      feculence = punctuation + feculence + punctuation + predicate;
      if (isLast) {
        punctuation = punctuationList[2];
        feculence = feculence + punctuation;
      }
    }
  }
  public final static void main(String[] args) {
    outputFeculence(PUNCTUATION_LIST, SUBJECT, PREDICATE);
  }
}
// Warning: Faggotry behind.

Name: Anonymous 2011-03-31 20:48

Name: Anonymous 2011-04-01 2:18

Name: Anonymous 2011-04-01 2:24

This is you when you come to prog

youtube.com watch?v=wPXk_rcrUjY

Name: Anonymous 2011-04-01 3:48

Clipboard.c

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char ** argv)
{
int ret = 0;
FILE * file = fopen(argv[1], "r");
ret = fseek(file, 0, SEEK_END);
if (ret != 0)
{
msg("Can't allocated this much, hurrr");
fclose(file);
exit(1);
}

fclose(file);
return 0;
}

Name: Anonymous 2011-04-01 4:41

#include <stdio.h>

int main(){
  unsigned int b[] = {0x002a2a2a, 0x92a67bad, 0x5a949663, 0x594a5a19,
                      0x735d92f1, 0x400fd9ae, 0}, *a=b+1;
  char c[] = "\n\0        ";
  while((*a>>=4-3*(*a&1))&~7?1:*a++)
    printf("%s",*a&1?(char*)b:!(12-*a&15)?c:c-((*a&15)>>1)+9);
  return 0;
}

Name: Anonymous 2011-04-01 4:45

>>270
Have you exploited your buffer overflows today?

Name: Anonymous 2011-04-01 4:48

>>272
I never overflow.

Name: Anonymous 2011-04-01 7:41

http://codepad.org/03QsZHfW
It outputs something resembling a tree. Clever pointer tricks like this are the reason C always has an edge on "safe languages".

Name: Anonymous 2011-04-01 8:13

and here is the "/prog/" version. a lot more messy but less data
http://codepad.org/LCvbTSU2
#include <stdio.h>
int main(){
  char *z =  "    ***\0   ";
  unsigned int b[] = { 0x77770000, 0x55155515, 0x40017717, 0x70014001, 0}, *c=b-1, i=0;

  while(printf(!*(c+=++i-8&1)*8+" %s\t\n%s\t"+(!(i-1))*5, z+(i>5?7:i-1+!i), z+(i>4?7:i)))
  do printf("%s", z+(8>>(*c&1)));
  while((*c>>=1)&&!(*c>>15&1 && !(*c>>16)&&(*c>>=1)));


  return 0;
}

Name: Anonymous 2011-04-01 21:35


doHarvest u -> a:u."act" d:a."dst"
 -> d.{[p@_] -> r:a."res"
             -> r.{no? -> r=:(canHarvest p a."harvests") -> u."act"."res"=:r}
             -> if u.r>=100
                then {-> o:unitTypes."store"
                      -> order [@o "back"=d "res"=r "depot"=a."depot"] u}
      ;id -> [[id u."id"] @!hideUnits]
          -> o:unitTypes."harvest_inside"
          -> u."act"=:[@o "dst"=d "depot"=a."depot" "range"=1
                          "res"=(canHarvest id a."harvests")]}
 -> u

fixHarvest u -> a:u."act" d:a."dst" r:a."res" hs:a."harvests"
 -> cnd{u.r>=100
         -> order [@unitTypes."store" "back"=d "res"=r "depot"=a."depot"] u
       ;t:(findTile u."tile" (pointInRect wr ?) (canHarvest ? hs) (abs xy-?) l=6).rhd
         -> [@!u."act" "dst"=[t [1 1]] "r"=no]
       ;ye -> u."act"=:no}
 -> u

doHarvestInside u -> r:u."act"."res"
 -> if u.r<100 then [[u."id" 5]@!nqs.(u."parent")."harvest"]
               else {-> a:u."act" [u."id"@!showUnits]
                     -> o:unitTypes."store"
                     -> order [@o "back"=a."dst" "res"=r "depot"=a."depot"] u}
 -> u


doStore u
 -> a:u."act" r:a."res" depot:a."depot" t:(if depot units,depot)
 -> t.{dead? -> depot.{no? -> depot=:(findDepot r u)}
             -> depot.{ye? -> u."act"."depot"=:depot
                      ;_  -> notify "Nowhere to store $r" -> u."act"=:no}
      ; _ -> if x:u."anims".r  u."anims"."move"=:x
          -> if a."near"
             then {-> [[u."id" r u.r]@!nqs.(u."owner")."+"] -> u.r=:0
                   -> u."anims"."move" =: unitTypes.(u."type")."anims"."move"
                   -> o:unitTypes."harvest"
                   -> order [@o "dst"=a."back" "depot"=a."depot"] u}
             else {-> u."act"."near"=:ye -> u."act"."dst"=:depot}}
 -> u

Name: Anonymous 2011-04-01 21:36

>>275

layer=3 air=ye speed=999 range=1
harvests=["gold" "wood"] show="attack" effect=["harvest" 5]
rule=harvestRule do=doHarvest fix=fixHarvest

Name: Anonymous 2011-04-01 21:46

Name: Anonymous 2011-04-01 23:15


  [@!ui @(u."acts" |> map x~>
      ["icon"=icons.x "tint"=tints.(u."color")
       "onClick"={->a:unitTypes.x if a."targets" == ["self"]
                                  then order a u else uiTargeting=:a}
       "onHover"={->do t:unitTypes.x c:(t."cost"||t."ucost")
                   [["text"="$(t.prettyName)"]
                    @(map [? c.?] resNames |> keep ?,1 |>
                      map [r n]~>["icon"=resIcons.r "text"="$n"])]}])]

Name: BAMPU KOODO 2011-04-02 22:58


#lang racket/base
(require (for-syntax racket/base))
(require ffi/unsafe)

#|
Based on Python's struct.unpack

(unpack-bytes fmt bytestring)
  fmt         : string?
  bytesstring : bytes?

Unpacks bytestring according to fmt.

The first character of fmt determines the byte order, size and alignment of the data.
If omitted, (default-unpack-character) will be used.

Character  Byte order      Size     Alignment
@          native          native   native
#          native          native   none
=          native          fixed    none
<          little-endian   fixed    none
         big-endian      fixed    none
!          network         fixed    none

Meaning of the format characters:
(define *table*
  (make-hasheqv
   `((#\c ,@(make-table char #f))
     (#\b ,@(make-table byte #f))
     (#\B ,@(make-table ubyte #f))
     (#\? ,@(make-table bool #f))
     (#\h ,@(make-table short))
     (#\H ,@(make-table ushort))
     (#\i ,@(make-table int))
     (#\I ,@(make-table uint))
     (#\l ,@(make-table long))
     (#\L ,@(make-table ulong))
     (#\q ,@(make-table llong))
     (#\Q ,@(make-table ullong))
     (#\f ,@(make-table float))
     (#\d ,@(make-table double))
     (#\P ,@`((#\@ . ,unpack-pointer/na)
              (#\# . ,unpack-pointer/n))))))

Format   C Type         Racket Type    Size (=,>,<,!)
#\x      N/A            (pad byte)     1
#\c      char           char?          1
#\b      signed char    fixnum?        1
#\B      unsigned char  byte?          1
#\?      bool           boolean?       1
#\h      short          fixnum?        2
#\H      unsigned short fixnum?        2
#\i      int            fixnum?        4
#\I      unsigned int   fixnum?        4
#\l      long           fixnum?        4
#\L      unsigned long  fixnum?        4
#\q      long long      fixnum?        8
#\Q      unsigned long  fixnum?        8
         long
#\f      float          flonum?        4
#\d      double         flonum?        8
#\P      void*          fixnum?        N/A

TODO: count, defineable format characters, pack.

|#

; @, #, =, <, >, !
(define (unpack-char bytes idx)
  (cons (add1 idx)
        (integer->char (bytes-ref bytes idx))))

; @, #, =, <, >, !
(define (unpack-byte bytes idx)
  (cons (add1 idx)
        (let ((x (bytes-ref bytes idx)))
          (if (> x #x7F) (+ (- x) #x80) x))))

; @, #, =, <, >, !
(define (unpack-ubyte bytes idx)
  (cons (add1 idx)
        (bytes-ref bytes idx)))

; @, #, =, <, >, !
(define (unpack-bool bytes idx)
  (cons (add1 idx)
        ((compose not zero? bytes-ref) bytes idx)))

; big-endian = #t
(define ((unpack1 sign endianess size) bytes idx)
  (cons (+ idx size)
        (integer-bytes->integer bytes sign endianess idx (+ idx size))))
(define ((unpack2 endianess size) bytes idx)
  (cons (+ idx size)
        (floating-point-bytes->real bytes endianess idx (+ idx size))))

(define ((unpack-ctype1 sign type) bytes idx)
  (cons (+ (bitwise-and (+ idx (sub1 (ctype-alignof type)))
                        (bitwise-not (sub1 (ctype-alignof type)))))
        (integer-bytes->integer bytes sign (system-big-endian?) idx (+ idx (ctype-sizeof type)))))
(define ((unpack-ctype2 sign type) bytes idx)
  (cons (+ (bitwise-and (+ idx (sub1 (ctype-alignof type)))
                        (bitwise-not (sub1 (ctype-alignof type)))))
        (floating-point-bytes->real bytes (system-big-endian?) idx (+ idx (ctype-sizeof type)))))

(define (unpack-ctype1/noalign sign type)
  (unpack1 sign (system-big-endian?) (ctype-sizeof type)))
(define (unpack-ctype2/noalign sign type)
  (unpack2 (system-big-endian?) (ctype-sizeof type)))

(define-syntax (define-all stx)
  (define (suffix end)
    (case (syntax-e end)
      ((#t) "/BE")
      ((#f) "/LE")
      (else "")))
  (define (dat->stx sym end)
    (datum->syntax
     stx
     (string->symbol
      (string-append "unpack-" (symbol->string sym) (suffix end)))))
  (syntax-case stx ()
    ((~ e)
     (with-syntax ((unshort (dat->stx 'short #'e))
                   (unushort (dat->stx 'ushort #'e))
                   (unint (dat->stx 'int #'e))
                   (unuint (dat->stx 'uint #'e))
                   (unlong (dat->stx 'long #'e))
                   (unulong (dat->stx 'ulong #'e))
                   (unllong (dat->stx 'llong #'e))
                   (unullong (dat->stx 'ullong #'e))
                   (unfloat (dat->stx 'float #'e))
                   (undouble (dat->stx 'double #'e)))
       #'(begin
           (define unshort
             (unpack1 #t e 2))
           (define unushort
             (unpack1 #f e 2))
           (define unint
             (unpack1 #t e 4))
           (define unuint
             (unpack1 #f e 4))
           (define unlong
             (unpack1 #t e 4))
           (define unulong
             (unpack1 #f e 4))
           (define unllong
             (unpack1 #t e 8))
           (define unullong
             (unpack1 #f e 8))
           (define unfloat
             (unpack2 e 4))
           (define undouble
             (unpack2 e 8)))))))

(define-syntax (define-all2 stx)
  (define (suffix a)
    (case (syntax-e a)
      ((#t) "/na")
      ((#f) "/n")))
  (define (dat->stx sym end)
    (datum->syntax
     stx
     (string->symbol
      (string-append "unpack-" (symbol->string sym) (suffix end)))))
  (syntax-case stx ()
    ((~ e u1 u2)
     (with-syntax ((unshort (dat->stx 'short #'e))
                   (unushort (dat->stx 'ushort #'e))
                   (unint (dat->stx 'int #'e))
                   (unuint (dat->stx 'uint #'e))
                   (unlong (dat->stx 'long #'e))
                   (unulong (dat->stx 'ulong #'e))
                   (unllong (dat->stx 'llong #'e))
                   (unullong (dat->stx 'ullong #'e))
                   (unfloat (dat->stx 'float #'e))
                   (undouble (dat->stx 'double #'e))
                   (unpointer (dat->stx 'pointer #'e)))
       #'(begin
           (define unshort
             (u1 #t _short))
           (define unushort
             (u1 #f _ushort))
           (define unint
             (u1 #t _int))
           (define unuint
             (u1 #f _uint))
           (define unlong
             (u1 #t _long))
           (define unulong
             (u1 #f _ulong))
           (define unllong
             (u1 #t _llong))
           (define unullong
             (u1 #f _ullong))
           (define unfloat
             (u2 #f _float))
           (define undouble
             (u2 #f _double))
           (define unpointer
             (u1 #f _pointer)))))))

; <
(define-all #f)

; >, !
(define-all #t)

; =
(define-all (system-big-endian?))

; @
(define-all2 #f unpack-ctype1 unpack-ctype2)

; #
(define-all2 #t unpack-ctype1/noalign unpack-ctype2/noalign)

(define-syntax (make-table stx)
  (define (sym-suffix sym suffix)
    (datum->syntax
     stx
     (string->symbol
      (string-append "unpack-" (symbol->string (syntax-e sym))
                     suffix))))
  (syntax-case stx ()
    ((~ sym)
     #``((#\@ . ,#,(sym-suffix #'sym "/na"))
         (#\# . ,#,(sym-suffix #'sym "/n"))
         (#\= . ,#,(sym-suffix #'sym ""))
         (#\> . ,#,(sym-suffix #'sym "/BE"))
         (#\< . ,#,(sym-suffix #'sym "/LE"))
         (#\! . ,#,(sym-suffix #'sym "/BE"))))
    ((~ sym #f)
     #``((#\@ . ,#,(sym-suffix #'sym ""))
         (#\# . ,#,(sym-suffix #'sym ""))
         (#\= . ,#,(sym-suffix #'sym ""))
         (#\> . ,#,(sym-suffix #'sym ""))
         (#\< . ,#,(sym-suffix #'sym ""))
         (#\! . ,#,(sym-suffix #'sym ""))))))
        

(define *table*
  (make-hasheqv
   `((#\c ,@(make-table char #f))
     (#\b ,@(make-table byte #f))
     (#\B ,@(make-table ubyte #f))
     (#\? ,@(make-table bool #f))
     (#\h ,@(make-table short))
     (#\H ,@(make-table ushort))
     (#\i ,@(make-table int))
     (#\I ,@(make-table uint))
     (#\l ,@(make-table long))
     (#\L ,@(make-table ulong))
     (#\q ,@(make-table llong))
     (#\Q ,@(make-table ullong))
     (#\f ,@(make-table float))
     (#\d ,@(make-table double))
     (#\P ,@`((#\@ . ,unpack-pointer/na)
              (#\# . ,unpack-pointer/n))))))

(define default-unpack-character
  (make-parameter #\@ (λ (x) (if (mode-char? x) x (error 'default-unpack-character "no")))))

(define (mode-char? x)
  (case x
    ((#\@ #\# #\=
      #\< #\> #\!) #t)
    (else #f)))

(define (bytes-unpack fmt bytes)
  (let ((mode (if (mode-char? (string-ref fmt 0))
                  (string-ref fmt 0) #\@))
        (l (string-length fmt)))
    (let loop ((i (if (mode-char? (string-ref fmt 0)) 1 0))
               (idx 0)
               (r '()))
      (cond ((= i l) (reverse r))
            ((char=? (string-ref fmt i) #\x) (loop (add1 i) (add1 idx) r))
            ((char-whitespace? (string-ref fmt i)) (loop (add1 i) idx r))
            (else
             (let* ((x (hash-ref *table* (string-ref fmt i) (λ () (error 'bytes-unpack "what the fuck is a ``~a''?" (string-ref fmt i)))))
                    (x (cond ((assv mode x) => cdr) (else (error 'bytes-unpack "``~a'' has no mode ``~a''" (string-ref fmt i) mode))))
                    (x (x bytes idx)))
               (loop (add1 i)
                     (car x)
                     (cons (cdr x) r))))))))

#|
(bytes-unpack "> ii" #"\0\0\0\1\0\0\0\2") ; => '(1 2)
(bytes-unpack "< ii" #"\0\0\0\1\0\0\0\2") ; => '(16777216 33554432)
|#

Name: Anonymous 2011-04-03 15:11

Name: Anonymous 2011-04-03 16:34

error "stack overflow"

Name: Anonymous 2011-04-04 2:46


rmbOrder sel screenXY -> played:no
 -> t:(screenXY.selectPoint."id")
    c:[screenXY.screenToCell [1 1]]
    for [id@_] in sel u:units,id {
    -> as:(map unitTypes.? u."acts" |> strip ?."nonRMB")
    -> t&&(fnd (canAct u ? t) as).{a:ye?->[a t]} || (fnd (canAct u ? c) as).{a:ye?->[a c]}
       |> {[a t] -> order (a."dst"=:t) id
                 -> played||(unitSay "acknowledgement" id; played=:ye)}
    }

Name: Anonymous 2011-04-04 3:05

>>282
When I see some ``in Lisp'' DSL code, I just skip the thread.

Name: Anonymous 2011-04-04 3:11

>>283
Why so butthurt?

Name: Anonymous 2011-04-04 3:12

>>284
Not ``butthurt'', I'm just not a Perl programmer.

Name: Anonymous 2011-04-04 3:13

>>285
perl is too verbose.

Name: Anonymous 2011-04-04 3:17

Anyway, I should provide more concise syntax for list."key". These quotes look awful.

Name: Anonymous 2011-04-04 3:20

>>287
list<~key, list%key, list#key key∈list.

Name: Anonymous 2011-04-04 3:26

>>288
No. I'll redefine '.', so it'll check against environment variables.

Name: Anonymous 2011-04-04 4:25


#include <iostream>
using namespace std

int main()
{
}

Name: Anonymous 2011-04-04 4:38

>>290
using namespaceMY ANUS

Name: Anonymous 2011-04-04 4:38

>>290
Missing a semicolon<std::vector::boost::function<int, std::map::parallel::functor<std::iomanip<std::iostream::operator==>, std::vector<bool> > >

Name: Anonymous 2011-04-04 4:52

>>292
boost
Tsk.

Name: Anonymous 2011-04-08 2:58

Name: Anonymous 2011-04-08 3:04

>>291
iostream my anus

Name: Anonymous 2011-04-08 4:35

#include <stdio.h>

int main(int argc, char* argv[])
{
    char msg[23];
    for(int i = 0; i < 22; ++i)
    {
        msg[i] = ((((~(i >> 4)) & 1) & ((~(i >> 3)) & 1) & ((~(i >> 2)) & 1) & ((~(i >> 1)) & 1)) |
            (((~(i >> 3)) & 1) & ((i >> 1) & 1) & ((~i) & 1)) | (((i >> 3) & 1) & ((~(i >> 2)) & 1) &
            ((i >> 1) & 1)) | (((i >> 4) & 1) & ((i >> 1) & 1)) | (((i >> 4) & 1) & ((~i) & 1)) |
            (((~(i >> 3)) & 1) & ((i >> 2) & 1) & ((~(i >> 1)) & 1) & (i & 1))) | (((((~(i >> 4)) & 1) &
            ((~(i >> 3)) & 1) & ((~(i >> 2)) & 1) & ((~(i >> 1)) & 1) & (i & 1)) | (((~(i >> 4)) & 1) &
            ((~(i >> 3)) & 1) & ((i >> 2) & 1) & ((~i) & 1)) | (((i >> 3) & 1) & ((~(i >> 2)) & 1) &
            ((i >> 1) & 1)) | (((i >> 4) & 1) & ((i >> 1) & 1) & ((~i) & 1))) << 1) | (((((~(i >> 4)) & 1) &
            ((~(i >> 2)) & 1) & ((~(i >> 1)) & 1) & (i & 1)) | (((~(i >> 2)) & 1) & ((i >> 1) & 1) &
            ((~i) & 1)) | (((i >> 3) & 1) & ((i >> 2) & 1) & ((~i) & 1)) | (((i >> 4) & 1) & ((~i) & 1)) |
            (((~(i >> 3)) & 1) & ((i >> 2) & 1) & (i & 1))) << 2) | (((((~(i >> 4)) & 1) & ((~(i >> 3)) & 1) &
            ((~(i >> 2)) & 1) & ((~(i >> 1)) & 1)) | (((~(i >> 4)) & 1) & ((~(i >> 2)) & 1) & ((~(i >> 1)) & 1) &
            (i & 1)) | (((i >> 3) & 1) & ((~(i >> 2)) & 1) & ((i >> 1) & 1) & ((~i) & 1)) | (((i >> 3) & 1) &
            ((i >> 2) & 1) & ((i >> 1) & 1) & (i & 1)) | (((~(i >> 3)) & 1) & ((i >> 2) & 1) & ((~(i >> 1)) & 1)&
            ((~i) & 1))) << 3) | (((((~(i >> 4)) & 1) & ((~(i >> 3)) & 1) & ((~(i >> 2)) & 1) & ((~i) & 1)) |
            (((~(i >> 3)) & 1) & ((i >> 2) & 1) & ((i >> 1) & 1)) | (((~(i >> 4)) & 1) & ((~(i >> 3)) & 1) &
            ((i >> 2) & 1) & (i & 1)) | (((i >> 3) & 1) & ((~(i >> 2)) & 1) & ((i >> 1) & 1) & (i & 1)) |
            (((i >> 3) & 1) & ((i >> 2) & 1) & ((~i) & 1))) << 4) | (((((~(i >> 4)) & 1) & ((~(i >> 3)) & 1) &
            ((~(i >> 2)) & 1) & ((i >> 1) & 1) & (i & 1)) | (((i >> 3) & 1) & ((~(i >> 2)) & 1) & ((~(i >> 1)) & 1) &
            ((~i) & 1)) | (((i >> 3) & 1) & ((i >> 2) & 1) & ((~(i >> 1)) & 1) & (i & 1)) | (((i >> 4) & 1) &
            ((~(i >> 2)) & 1) & ((~(i >> 1)) & 1) & (i & 1))) << 5) | (((((~(i >> 4)) & 1) & ((~(i >> 2)) & 1) &
            ((~(i >> 1)) & 1) & (i & 1)) | (((i >> 3) & 1) & ((i >> 1) & 1)) | (((~(i >> 3)) & 1) & ((~i) & 1)) |
            (((i >> 4) & 1) & ((i >> 1) & 1)) | (((i >> 2) & 1) & ((~i) & 1)) | (((~(i >> 3)) & 1) & ((i >> 2) & 1))) << 6);
    }
    msg[22] = 0;
    printf("%s", msg);
    getchar();
}

Name: Anonymous 2011-04-08 5:07

>>296

you must think your so clever

fuckling idiot

Name: Anonymous 2011-04-08 5:43

>>296
This was posted before.

Name: Anonymous 2011-04-08 6:27

>>298
Are you suggesting that it is irrelevant to the topic?

Name: Anonymous 2011-04-08 6:59


module PmeCubic where
solvePmeCubic :: [Integer] -> [(Integer, Integer, Integer, Integer)]
solvePmeCubic s = [(a, b, c, d) |
  d <- s, c <- s, b <- s, a <- s,
  fromIntegral(a ^ 3 + b ^ 3) /
  fromIntegral(c ^ 3 + d ^ 3) ==
  fromIntegral(a + b) /
  fromIntegral(c + d)]

Name: Anonymous 2011-04-08 7:07

fibo 0 = 91
fibo 3 = 323
fibo n = fibo (n-1)

Name: Anonymous 2011-04-08 7:17


 return;


This returns from within a function to the caller.

Name: Anonymous 2011-04-08 8:10

RET

This pops the return value from the top of the stack and jumps to it.

Name: Anonymous 2011-04-08 11:37

>>301
so fibo n for a natural number n returns 91 if n < 3, and 323 otherwise?

Name: Anonymous 2011-04-08 11:41

>>304
please visit zoklet we have many gentlemen who discuss fibo
http://www.zoklet.net/bbs/register.php

Name: Anonymous 2011-04-10 4:22

color c00
set "DARK" to random 1 to 8
set "LIGHT" to "(&DARK&<<4o&DARK&o128)"
inc "DL" by 1
set "commands" to 30000
wait for 1
put player at 0 0

loop start
put "DARK" CustomBlock pb2 at "('loopcount'%'board_w')" "('loopcount'/'board_w'+1)"
loop for "('board_w'*('board_h'-2)-1)"

set "rcount" to 4
set "rooms" to 0
: "rd"
change from cff CustomFloor pff to "DARK" CustomBlock pb2
* "(30/'rcount')"
set "local" to random 7 to 12
set "local2" to random 6 to 10

set "local3" to random 1 to "('board_w'-1-'local')"
set "local4" to random 2 to "('board_h'-3-'local2')"
loop start
if c?? CustomFloor p20 at "('loopcount'%'local'+'local3')" "('loopcount'/'local'+'local4')" then "rd"
if "LIGHT" CustomBlock pb2 at "('loopcount'%'local'+'local3')" "('loopcount'/'local'+'local4')" then "rd"
put cff CustomFloor pff at "('loopcount'%'local'+'local3')" "('loopcount'/'local'+'local4')"
loop for "('local'*'local2'-1)"

change from cff CustomFloor pff to c08 CustomFloor p20

loop start
put "LIGHT" CustomBlock pb2 at "('local3'+'loopcount')" "local4"
put "LIGHT" CustomBlock pb2 at "('local3'+'loopcount')" "('local4'+'local2'-1)"
loop for "('local'-2)"
loop start
put "LIGHT" CustomBlock pb2 at "local3" "('local4'+'loopcount')"
put "LIGHT" CustomBlock pb2 at "('local3'+'local'-1)" "('local4'+'loopcount')"
loop for "('local2'-1)"

set "room&rooms&x" to "('local1'/2+'local3')"
set "room&rooms&y" to "('local2'/2+'local4')"
inc "rooms" by 1
if "rooms" < "rcount" then "rd"

set "rooms" to 0
: "join"
goto "#joinr"
inc "rooms" by 1
if "rooms" < "rcount" then "join"

loop start
set "local" to "('loopcount'%'board_w')"
set "local2" to "('loopcount'/'board_w')"
if "DARK" CustomBlock pb2 at "local" "local2" then "#noise"
loop for "('board_w'*'board_h'-1)"


put player at "room0x" "room0y"
copy at 2 0 to "room1x" "room1y"
set "commands" to 30
send "ALL" to "go"

* "Dungeon Level &DL&"
end
: "#noise"
set "local3" to random -30 to 30
set "local4" to "('local'+'local2'+'local3'/45+176)"
put "DARK" CustomBlock "local4" at "local" "local2"
goto "#return"


: "#joinr"
set "local" to "room&rooms&x"
set "local2" to "room&rooms&y"
set "local3" to "room('rooms'+1%'rcount')x"
set "local4" to "room('rooms'+1%'rcount')y"
set "local5" to random 0 to 1
goto "#c('local5')"
goto "#c(1-'local5')"
goto "#return"

: "#c0"
: "jrla"
goto "#pc"
inc "local" by "(('local'<'local3')-('local'>'local3'))"
if "local" != "local3" then "jrla"
goto "#pc"
goto "#return"

: "#c1"
: "jrlb"
goto "#pc"
inc "local2" by "(('local2'<'local4')-('local2'>'local4'))"
if "local2" != "local4" then "jrlb"
goto "#pc"
goto "#return"

: "#pc"
if c?? CustomFloor p20 at "local" "local2" then "#return"
put c08 CustomFloor p20 at "local" "local2"

loop start
goto "#tw"
loop for 8
goto "#return"
: "#tw"
if c?? CustomFloor p20 at "('loopcount'%3-1+'local')" "('loopcount'/3-1+'local2')" then "#return"
if "LIGHT" CustomBlock pb2 at "('loopcount'%3-1+'local')" "('loopcount'/3-1+'local2')" then "#return"
put "DARK" CustomBlock pdb at "('loopcount'%3-1+'local')" "('loopcount'/3-1+'local2')"
goto "#return"

Name: Anonymous 2011-04-10 4:59

>>306
Nice code, fagstorm.

Name: Anonymous 2011-04-10 7:04


(S(K(S(SKK)(SKK)))(S(S(KS)K)(K(S(SKK)(SKK)))))(S(K(S(S(K(S(S(SKK)(K(K(SKK)))))K)(SKK))(K(S(S(KS)K)(K(SKK))))))(S(K(S(K(S(S(KS)(S(S(KS)K))(K(S(K(S(S(KS)(S(KK)(S(SKK)(S(K(S(S(KS)K)))(S(S(KS)(S(KS)(K(KS))((S(K(S(KK)))(SSK)))))(K(K(SKK))))))))(K(SKK))))(SKK))))(K(K(K(SKK))))))(SKK)))(S(KS)(SK(S(K(S(S(KS)(S(K(S(KS)))(S(K(S(KS)))(S(K(S(KS)))(S(K(S(KK)))(S(S(KS)K)(K(S(K(S(K(S(SKK)))))(S(K(S(KK)))(S(K(S(SKK)))K))))))))))(K(K(K(SKK)))))(SKK)))))))

Name: Anonymous 2011-04-10 7:21

SEKS

Name: Anonymous 2011-04-11 9:36

Name: Anonymous 2011-04-11 10:50

<djahandarie> we ain't here to do e-c-e
<djahandarie> we're here to do c-s-e on the w-e-b
<djahandarie> listen to me spit these rhymes
<djahandarie> while i program lines
<djahandarie> and commit web accessibility crimes
<djahandarie> word, son
<http402> You talk like your big on these I-Net kicks,
<http402> But your shit flows slower than a two-eighty-six.
<http402> I'm tracking down hosts and nmap scans,
<http402> While Code Igniter's got you wringing your hands.
<http402> Cut the crap rap,
<http402> Or I'll run ettercap,
<http402> Grab your AIM chat,
<http402> N' send a PC bitch-slap!
<http402> peace
<djahandarie> you're talkin bout down hosts and nmap scans
<djahandarie> while i got other plans
<djahandarie> you're at your new job, but you can't even do it right
<djahandarie> you just create a plight with your http rewrites
<djahandarie> i've been on the web since the age of three
<djahandarie> you just got on directly off the bus from mississippi
<djahandarie> respect yo' elders, bitch
<http402> You've been webbin' since three, but still ain't grown up,
<http402> Gotta update your config and send the brain a SIGHUP.
<http402> You say you're that old? No wonder you're slow!
<http402> You're knocking at the door while I run this show!
<http402> Elders my ass, you're shit's still in school,
<http402> Hunt and pecking at the keyboard like a spaghetti-damned fool,
<http402> Rim-riffing your hard drive like a tool,
<http402> Face it. I rule.
<djahandarie> i erase my harddrives with magnets (bitch)
<djahandarie> all you can do is troll on the fagnets
<djahandarie> and son, my brain's wrapped in a nohup
<djahandarie> it wont be hurt by the words you throwup
<djahandarie> dont mind me while i emerge my ownage
<djahandarie> while you're still over there apt-getting your porridge
<djahandarie> you say i'm still in school
<djahandarie> but the fact is that i know the rule
<djahandarie> cuz you need to go back to grade three
<djahandarie> and you better plea, that they take sucky graduates from c-s-e
<http402> Time to bend over and apply a patch,
<http402> Your brain's throwing static like a CD with a scratch.
<http402> Your connection got nuked and you've met your match.
<http402> You run a single process like a VAX with a batch.
<http402> I'd pass the torch to a real winner
<http402> But it'd just scorch a while-loop spinner
<http402> Caught in a loop that you cant escape,
<http402> I run clock cycles around your words and flows,
<http402> Cuz your rhyme is like a PS fan: it' blows,
<http402> Your water-cooled lyrics leak and it shows,
<http402> Take your ass back to alt.paid.for.windows.

Name: Anonymous 2011-04-11 11:00

This code will show you the truth of Perl6


perl -e 'print "Perl6 has an operator for $_" foreach (qx[cat /usr/dict/words]);'

Name: Anonymous 2011-05-07 2:16

(/ 20 20)

Name: Anonymous 2011-05-07 2:37

1

Name: Anonymous 2011-05-07 2:50

IRC FOR NON-NIGGERS

Server:  whatisthiscomputer.dyndns.org
Channel: #trollchat

Name: Anonymous 2011-05-07 3:32

publix statistics frozen void lo mein(Strep throat[])

Name: Anonymous 2011-05-07 9:51

>>312
It's funny because that's Perl 5 and below.

Name: Anonymous 2011-06-16 5:49

>>317
It's funny because Perl 6 is still not there!

Name: Anonymous 2011-06-16 6:10

>>318
Just like Sepplesox, Duke Nukem Forever, and Velox et Astrum.

Name: Anonymous 2011-06-16 7:55

>>319
You can actually buytorrent Duke Nukem Forever now, your argument is invalid.

Name: Anonymous 2011-06-16 8:04

how do i fart the new autism?

Name: Anonymous 2011-08-05 16:20

badump

Name: Anonymous 2011-08-05 16:33


move_dick_to_vagina:
    ; TODO: optimize
    mov rax, [dick]
    nop
    nop
    nop
    nop
    nop
    nop
    nop
    mov [vagina], rax
   
    ; haha, fuck you calling conventions
    inc rbx
    ret

Name: Anonymous 2011-08-05 16:45

>>323
; Input: eax = dick
move_dick_to_vagina:
    ; This is dead code.
    ;call get_vagina_ptr
    ;test edi, edi
    ;jz fallback
    ;mov [edi], eax
    ;jmp .end
    .fallback:
        mov ecx, [anii_count]
        mov edi, anii
        rep stosd
.end:
    ret

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