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

Post Code

Name: Anonymous 2011-03-04 21:33

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

Name: Anonymous 2011-03-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}

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