freenode/#lisp - IRC Chatlog
Search
0:46:55
rk[ghost]
currently, i seem only to be able to refer to the files name, not the file as an "object"
0:49:54
rk[ghost]
whilst at the same time, i don't understand how web works anyways (always stayed a 10-foot pole away from it)
0:51:15
rk[ghost]
however, i am curious how to refer to such object. i was just expecting to refer to something like hunchentoot:posts to get the post object, but it seems to be less straightfowrad
0:52:08
rk[ghost]
this situation is uncomfortable for me because i don't /want/ to learn web, but i have to in order to be helpful.. ha.
0:52:11
pjb
In hunchentoot, the data should be received by hunchentoot and available to a handler either as a parameter or thru a stream. Check hunchentoot documentation.
0:52:40
rk[ghost]
right, i guess i don't understand how hunchentoot is doing all its doing under its covers
0:52:57
rk[ghost]
and sicne i don't understand web, it makes it doubly confusing to have these handlers masked
0:53:25
pjb
You don't really need to understand it, the HTML protocol can get sophisticated, with notion of chunks, etc. The file transfer is not simple. But it should be handled by hunchentoot.
0:53:52
rk[ghost]
rumbler31: right, oh. my current strategy is reloading the server over and over breakign it :P
0:54:08
pjb
And since after the transfer of the file, the connection may stay up for further requests from the client, it cannot give you the socket stream; there's some wrapping of the file too.
0:54:43
rk[ghost]
pjb: that is what i hoped, when i orginially proposed this idea.. i /assumed/ that it should be very straightforward.. and i understood how to do the backend parts
0:54:46
pjb
IIRC hunchentoot saves the file somewhere and it gives you the pathname where it saved it.
0:55:22
rk[ghost]
pjb: ah.. see, again i assumed taht, i checked my filesystem to see if anything popped up in the local dir and such wasn't the case..
0:55:56
rumbler31
i just showed up so maybe you know this already, but chrome dev tools are your friend
0:56:03
rk[ghost]
only thing i need of lisp/hunchentoot is to have an html page with a form to upload an image and to store the image with a unique name in a directory
1:02:47
rk[ghost]
i expected in the function uploadar-page for the input parameter 'image' to be the image bitstream/file itself.. but it seems to be the name of the image
1:08:16
rk[ghost]
to be honest, i was expecting this part of the code to already be written, some open source web-based image uploader. somehow i started attempting to write it myself.
1:21:32
aeth
How do I handle end of file stuff in (trivial-)gray-streams? It looks like most things are derived from a simple method definition e.g. stream-read-char/stream-write-char is all that's needed for stream-read-sequence/stream-write-sequence to work.
1:21:32
aeth
Except, e.g. if I do stream-read-line or read-line and there's no newline, I'll exhaust the heap because there was never an end.
1:22:14
aeth
I think my circular buffer that backs my char/byte streams needs to check for emptiness (well, have an emptyp field) and throw an EOF exception when it's empty? Is that how streams work?
1:22:33
aeth
I couldn't find good documentation, I've basically just been implementing methods and seeing what breaks and what works
1:27:11
rumbler31
rk[ghost]: looks like you fist need to figure out what kind of post request is being made by the browser for you
1:27:36
rumbler31
if it is a multipart request, then hunchentoot seems to natively understand that it will return a path the the uploaded file to your handler
3:00:38
aeth
This seems to document gray-streams, and apparently the API just expects :eof for EOF. http://www.nhplace.com/kent/CL/Issues/stream-definition-by-user.html
3:29:02
aeth
I now have pipes I can read and write from! Surprisingly concise with trivial-gray-streams and an already-written buffer implementation. Very few things actually needed to be defined. So now I can construct input streams by writing to them or parse output streams by reading from them, e.g. reading a program's output one line at a time.
3:31:22
aeth
https://gitlab.com/zombie-raptor/zombie-raptor/blob/1d807be50a7e76acb201a70df6c58c89e18ef0aa/util/stream.lisp
3:32:17
aeth
Some methods not implemented and no way of handling when the circular buffer becomes full (un-hardcode the size and create a new buffer of twice the size when full?), but otherwise working.
3:58:01
rk[ghost]
finally got it to spit out the location of the file, however i see now that it deletes the file upon the completion of the request
5:25:36
Devon
Wednesday when #lisp got spammed by someone's paste buffer gone mad, the following lines appeared:
6:54:27
Colleen
Clhs: special operator if http://www.lispworks.com/documentation/HyperSpec/Body/s_if.htm
8:03:57
jdz
Or have another video camera recording the output of the first video camera (also with a delay) and you only have to hit once and be entertained for a long time.
10:22:37
dmiles
durring lisp compile if a (load "otherfile") is encountered should that other file be compiled ?
10:23:40
dmiles
ok good.. but this actualy file being compiled is still expected to laod that file right?
10:23:57
beach
If it's on the top level, then the compiler will generate a call to LOAD and that call will be executed when the compiled code is loaded.
10:25:40
dmiles
i was concerned that the (load "file") file might contain macros that the compiled file needs... so i assumed all the side effects of the otehr file would need to be carried out
10:28:25
beach
3. It should be using an ASDF system definition instead of explicit calls to LOAD and COMPILE-FILE.
10:30:16
beach
Most time will be spent in calls to LOAD or COMPILE-FILE when this code is loaded, ether as source code or as compiled code. So whether this code is compiled or not does not make any difference.
10:30:55
dmiles
once you ran that file.. next you might run this file.. https://github.com/eriktmueller/daydreamer/blob/master/dd_get.cl
10:32:19
dmiles
so i assume nhow that those are compiled.. the things in the ff_get using (load ..) are getting a benefit
10:33:24
dmiles
Benefit of (compile-file "dd_cntrl.cl") (compile-file "dd_epis.cl") in that first file shown
10:34:29
beach
Compiling a file that contains calls to COMPILE-FILE like that will not call those compile-file forms.
10:36:28
beach
I maintain that this code has many problems. You need some DEFPARAMETERs in there and you need to write an ASDF system.
10:36:33
dmiles
ok so next issue.. someine called (compile-file ) on.. https://github.com/eriktmueller/daydreamer/blob/master/dd.cl
10:37:02
beach
And while you are at it, fix the number of semicolons. It should be 3 for a top-level comment.
10:39:03
beach
The compiled code will just contain code for the SETQ and the following function calls.
10:40:34
beach
And, like I said, using SETQ on an undefined variable like that is undefined behavior, and a good Common Lisp system will signal an error.
10:42:30
dmiles
though this program works on clisp and a couple other systems.. and only gets compiled since someonje first invoke the compiler script called dd_compile.cl .. and then they pick up the compiled reasults durring (laod ..) the dd_get.cl script
10:43:30
dmiles
one file doesnt compile right on a certain lisp .. so i relete the fasl and then run dd_get.cl
10:45:25
beach
It works on some Common Lisp systems because they define that undefined behavior as "declare the variable special" and that is a very bad idea to do.
10:47:34
beach
So it is better to use a Common Lisp implementation with stricter treatment of this particular undefined behavior, namely, to signal an error so that the programmer can fix his or her typo.
11:43:20
tomlukeywood
Dose anyone know why this never returns "False" and just returns nil when (eql (aref universe cell-x cell-y) 0) is not true?
11:45:48
Shinmera
So instead of trying to decipher it, I'll just say (cond (t1 f1) (t2 f2) (t3 f3) (T f4) <=> (if t1 f1 (if t2 f2 (if t3 f3 f4)))
12:12:23
pjb
The extra windows are temporary and user configuration. Use C-x 1 C-x 2 C-x 3 and C-x 0 to deal with them.
12:14:50
pjb
paule32: honestly, I don't know, I never use menus; I even configure my emacs to hide them from me.
12:15:12
pjb
You may use the menu, but once you know the key binding for the command, it's easier and faster to use it.
12:15:35
pjb
Also, thru irc, it's easier to give you key chords to type, rather to tell you to go to such and such menu.