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

Pages: 1-

/prog/‎fix

Name: Anonymous 2011-01-17 11:04

this post title was generated using Racket and engineered to contain a left-to-right mark (LRM).

> (display (string-append "/prog/" "\u200E" "fix"))

Name: Anonymous 2011-01-17 11:06

Use \u202d instead.

Name: Anonymous 2011-01-17 11:07

what

Name: Anonymous 2011-01-17 11:09

>>2
i'll give it a go

Name: Anonymous 2011-01-17 11:10


A fatal error occured!

Please post threads less often!

Name: Anonymous 2011-01-17 11:12

You reminded me that I need to rewrite my /prog/ interface.

Name: 2011-01-17 11:13

FIX MY ANUS

Name: Anonymous 2011-01-17 11:47

>>6
OPEN SAUCE IT PLOX

Name: Anonymous 2011-01-17 12:04

i don't get it, why does W3C give the wrong codes?
i trusted them!

Name: Anonymous 2011-01-17 12:21

>>8
I can open only my EXPERT BBCode SUITE, which I'm rewriting right now.

Name: Anonymous 2011-01-17 12:25

>>5
Maybe someone filtered on the wrong control character? That or zero-width characters are filtered, try using a printing character with implicit LTR. Or maybe shiichan is just buggy shit.

Name: Anonymous 2011-01-17 13:33

>>10

(module shiichan/bbcode racket/base
  (require racket/string ; string-join
           racket/contract
           (only-in my-stuff/control
                    if/nil?))
 
  #|Note|
  (if/nil? p t f) -> (if (null? p) t f)
  |Note|#
 
  (define tag
    (λ (name)
      (λ (text)
        (format "[~a]~a[/~a]" name text name))))
  (define tag?
    (string? . -> . string?))
 
 
  (define b
    (tag 'b))
  (define i
    (tag 'i))
  (define m
    (tag 'm))
  (define o
    (tag 'o))
  (define s
    (tag 's))
  (define u
    (tag 'u))
  (define aa
    (tag 'aa))
  (define sub
    (tag 'sub))
  (define sup
    (tag 'sup))
  (define code
    (tag 'code))
  (define spoiler
    (tag 'spoiler))
  (define verbatim
    (tag "#"))
  (define br
    (λ (text) "[br]"))
  (define null
    (λ (text)
      text))
 
  (define compose
    (λ tags
      (λ (text)
        (let loop ((t (reverse tags))
                   (r text))
          (if/nil? t r
                   (loop (cdr t)
                         ((car t) r)))))))
 
  (define expert
    (compose b u i o))
  (define bbcode
    (expert
     (string-append (sup "B")
                    (sub "B")
                    (code "Code"))))
 
  (define make-buttsorter
    (λ (prelude)
      (λ (t1 t2)
        (λ (text)
          (let ((s (string-length text)))
            (let loop ((i 0)
                       (r "")
                       (p #t))
              (cond ((= i s) (prelude r))
                    ((char-whitespace? (string-ref text i))
                     (loop (add1 i)
                           (string-append r (string (string-ref text i))) p))
                    (else (loop (add1 i)
                                (string-append r ((if p t1 t2) (string-ref text i)))
                                (not p))))))))))
 
  (define default-buttsorter
    (make-buttsorter (compose b i)))
 
  (define fibonacci-buttsort
    (default-buttsorter o u))
 
  (define bb:map
    (λ (tag text)
      (let loop ((l (string->list text))
                 (r ""))
        (if/nil? l r
                 (loop (cdr l)
                       (string-append r (tag (string (car l)))))))))
 
  (define bb:foldr
    (λ (tag text)
      (let loop ((l (string->list text))
                 (r ""))
        (if/nil? l r
                 (loop (cdr l)
                       (tag (string-append r (string (car l)))))))))
 
  (define bb:foldl
    (λ (tag text)
      (let loop ((l (reverse (string->list text)))
                 (r ""))
        (if/nil? l r
                 (loop (cdr l)
                       (tag (string-append (string (car l)) r)))))))
 
  (define *tag-table*
    `(,b ,u ,i ,o
         ,aa ,sup ,sub ,spoiler
         ,m ,s))
 
  (define randomize
    ;; racket's (random) is not random enough
    ;; so it's not as effective as the CL one
    ;; posted on /prog/ (http://dis.4chan.org/read/prog/1186660795/10)
    (λ (x)
      (define t (list-ref *tag-table* (random (length *tag-table*))))
      (define f
        (λ (x i e)
          (if (> i e)
              (f x e i)
              (values (substring x 0 i)
                      (substring x i e)
                      (substring x e)))))
      (if (<= (string-length x) 2) x
          (let-values (((b m a) (f x
                                   (random (string-length x))
                                   (random (string-length x)))))
            (format "~a~a~a"
                    (randomize b)
                    (t m)
                    (randomize a))))))
 
  (define bb:quote
    (λ (xs)
      (let ((s (if (list? xs)
                   (string-join (map
                                 (λ (x)
                                   (regexp-replace* #rx"\n(?!$)" x "[br]")) xs)
                                "[br]")
                   (regexp-replace* #rx"\n(?!$)" xs "[br]"))))
        (string-append
         "> "
         s
         (if (char=? (string-ref s (sub1 (string-length s))) #\newline)
             "" "\n")))))
 
 
  (provide/contract
   ;; before someone asks, yes, this was autogenerated.
   (rename tag bb:tag (any/c . -> . (any/c . -> . string?)))
   (rename tag? bb:tag? contract?)
   (rename b bb:b tag?)
   (rename i bb:i tag?)
   (rename m bb:m tag?)
   (rename o bb:o tag?)
   (rename s bb:s tag?)
   (rename u bb:u tag?)
   (rename aa bb:aa tag?)
   (rename sub bb:sub tag?)
   (rename sup bb:sup tag?)
   (rename code bb:code tag?)
   (rename spoiler bb:spoiler tag?)
   (rename verbatim bb:verbatim tag?)
   (rename br bb:br tag?)
   (rename null bb:null tag?)
   (rename compose bb:compose ((listof tag?) . -> . tag?))
   (rename expert bb:expert tag?)
   (rename bbcode bb:bbcode string?)
   (rename make-buttsorter bb:make-buttsorter (tag? . -> . (tag? tag? . -> . tag?)))
   (rename default-buttsorter bb:default-buttsorter (tag? tag? . -> . tag?))
   (rename fibonacci-buttsort bb:fibonacci-buttsort tag?)
   (rename randomize bb:randomize tag?)
   (bb:map (tag? string? . -> . string?))
   (bb:foldr (tag? string? . -> . string?))
   (bb:foldl (tag? string? . -> . string?))
   (bb:quote ((or/c string? (listof string?)) . -> . string?))))

Name: Anonymous 2011-02-04 15:09

Name: Anonymous 2011-07-06 12:02

[FONT COLOR="CC0000"]TESTING[/FONT]

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