Arc Forumnew | comments | leaders | submit | sacado's commentslogin
2 points by sacado 6502 days ago | link | parent | on: Using Arc at work

Actually this is not critical code, so the relative immaturity of Arc is not really an issue. It's just a frontend for people scared by rsync or scp and it probably won't be used more than once a month anyway.

Spending too much time on it : that would have been the bad option. And using Perl or Python or PHP would have taken me much longer.

-----

2 points by sbraford 6499 days ago | link

Ahhh this brings back memories.

I did something similar when rails was first hitting the scene.

My boss/PM would've crapped his pants if he knew I was building toy RoR apps for the marketing dept. (it was a Windows shop) =)

-----

1 point by sacado 6502 days ago | link | parent | on: Using Arc at work

Yes. "system" was my best friend here. Not for the login part, Arc already has it built in, but when dealing with files.

-----

2 points by sacado 6502 days ago | link | parent | on: Using Arc at work

Well, ok, I'll deliver it, today or tomorrow, but I have to clean it a little. A few things are written in French & must be translated and a few others are security issues, I have to hide them.

-----

2 points by almkglor 6502 days ago | link

Good ^^ I'll be making a toy that I'll smuggle into the office to handle the office gossip, just so I can also say I've used Arc at the office ^^

-----

3 points by almkglor 6502 days ago | link

toy's done, now all I have to do is smuggle it into the office....

  (= *chismakspath* "arc/chismaksball")
  (ensure-dir *chismakspath*)
  (= *chismaksmax*
    (or (most idfn
         (map [coerce _ 'int]
           (keep (let rx (re "[0-9]") [re-match rx _]) (dir *chismakspath*))))
    0))
  (deftem chismistem
    parent nil
    text ""
    replies nil)
  
  (def ch-urlencode (s)
          (let code [coerce _ 'int 16]
            (tostring
              (forlen i s
                (if (some (s i)
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890")
                    (pr (s i))
                  (is (s i) #\space)
                    (pr "+")
                    (pr "%" (coerce (code:s i) 'string 16)))))))
  
  (defmemo chisms (i)
    (errsafe:temload 'chismistem (file-join *chismakspath* (string i))))
  
  (def chismsupdate (i)
     (w/outfile p (file-join *chismakspath* (string i))
       (write (tablist:chisms i) p)))
  
  (mac chismispage (title . body)
    `(tag (html)
       (tag (head)
          (tag (title)
            (let title ,title
              (if title
                 (pr title " - "))
              (pr "Chismaksball!"))))
       (tag (body)
         ,@body)))
  
  (defop chismis req
    (chismispage nil
      (withs
         (
           chosen (arg req "p")
           chobj (when chosen (chisms chosen)) )
        (tag (div)
          (w/bars
            (tag (b) (link "random" "chismaksball"))
            (awhen (and chobj chobj!parent)
              (link "parent" (tostring:pr "?p=" (ch-urlencode it))))))
        (tag (div)
          (if chobj
            (pr:eschtml chobj!text)
            (prn "chismaks not found!")))
        (when chobj
          (tag (div style "font-size: 60%")
            (w/bars
              (w/link
                (chismispage "sasabat pa..."
                  (tag (div)
                    (w/bars
                      (tag (b) (link "random" "chismaksball"))
                      (link "yoko na sumabat..."
                        (+ "chismis?p=" (ch-urlencode chosen)))))
                  (tag (div) (pr:eschtml chobj!text))
                  (tag (div style "font-size: 60%; font-style: bold")
                    (pr "Replying: "))
                  (arform chismissubmit
                    (tag (input type 'hidden name 'parent value chosen) nil)
                    (textarea "ch" 8 42) (br)
                    (submit)))
                (prn "reply"))
              (awhen chobj!replies
                (w/rlink (+ "chismis?p=" (ch-urlencode (random-elt it)))
                  (prn "random reply"))))))
        (arform chismissubmit
            (tag (div style "font-size: 60%; font-style: bold")
              (pr "Bagong chismaks:"))
            (textarea "ch" 8 42) (br)
            (submit)))))
  
  (def chismissubmit (req)
    (awhen (arg req "ch")
      (let num (++ *chismaksmax*)
        (awhen (arg req "parent")
          (push (string num) ((chisms it) 'replies))
          (chismsupdate it))
        (w/outfile p (file-join *chismakspath* (string num))
          (write
            (tablist:inst 'chismistem
                  'parent (arg req "parent")
                  'text it)
            p))))
    "chismaksball")
  
  (defopr chismaksball req
    (aif (dir *chismakspath*)
      (tostring:pr "chismis?p=" (ch-urlencode:random-elt it))
      "chismis"))

-----

2 points by sacado 6503 days ago | link | parent | on: Meta Forum Questions

Yep, I'm ok with you on this one too. Particularly annoying when you open a new tab in Firefox to read the thread later, but get redirected to another site...

-----

1 point by sacado 6503 days ago | link | parent | on: Meta Forum Questions

I voted you up to let you reach the karma of 20... Now, you can vote me down :) (and thanks for asking, I was wondering too)

-----

2 points by eds 6502 days ago | link

For some reason I only see the down arrow on some of the posts... again not sure exactly how the internal mechanism for that works.

Thanks. (Not that I intend to vote anyone down :)

Update: Looking through some of the other threads, it seems that I can't vote down on comments older than a certain age. (Offhand I would guess this was when I got the 20th point of karma.) So I guess it does kind of make sense.

-----

1 point by eds 6500 days ago | link

Actually, it seems that I just can't vote down on any comment older than 24 hours. Even it is related to when I got the karma, it is also limited by the age of the post as well. Not that it really matters, just thought I'd post what I see.

And again, if anyone could post what is actually going on here, I wouldn't have to make guesses.

-----

2 points by sacado 6499 days ago | link

Yes, it IS related to when you got enough karma.

-----

2 points by sacado 6503 days ago | link | parent | on: Interface to SQLite in 23 lines of Arc

thanks ! I needed such a thing.

-----

1 point by sacado 6504 days ago | link | parent | on: Shorter programs, fewer axioms

The other problem is that it changes the global value of fst. It breaks if I want to modify something declared in a "let", for instance.

-----

3 points by sacado 6504 days ago | link | parent | on: Take the pattern-matching args challenge

(def rpn args

        (let stack '()

                (each elt args

                        (if (is (type elt) 'fn)

                                (with (second (pop stack) first (pop stack))

                                        (push (elt first second) stack))

                                (push elt stack)))

                (pop stack)))

-----

1 point by sacado 6504 days ago | link

then we've got :

arc> (rpn 2 2 + 9 1 - /)

1/2

-----


or a french keyboard

-----

2 points by shiro 6504 days ago | link

good for french lispers! you can save 5-10% of typing!

-----

2 points by sacado 6505 days ago | link | parent | on: "Axioms" that might need to be added

#2 would be great.

-----

More