Search
Sunday, 15th of April 2018, 14:07:27 UTC
15:41:01
Shinmera
Kevslinger: I'll be fetching Xof from the bus station at 18:50 in case you want to meet up again. Not sure what we'll do after aside from accompanying him to his hotel. It'll be too early for dinner by at least one hour.
20:11:47
Kevslinger
Bike and I are still alive, hanging in our hotel room
20:11:59
Kevslinger
Excited for some 2 days action-packed full of Lisp!
23:05:04
drmeister
I'm messing with javascript
23:06:04
drmeister
The browser isn't refreshing the javascript - it's very haphazard when it does it.
0:22:11
drmeister
CFFI question - what encoding does not change a string at all? *default-foreign-encoding* :utf-8 is screwing me up.
0:22:38
drmeister
frgo: Are you online?
0:22:38
stassats
the correct encoding
0:25:20
drmeister
Whatever that is. I have a string that contains characters that I do not want touched in any way.
0:25:20
drmeister
https://github.com/quicklisp/quicklisp-client/blob/master/dists/quicklisp/software/pzmq-20170403-git/c-api.lisp#L509
0:25:52
stassats
well, do not modify the string
0:25:59
stassats
and the characters won't be touched
0:26:07
drmeister
The pzmq library is modifying the string.
0:26:35
drmeister
It's a string that contains the binary representation of a bunch of float values.
0:27:33
stassats
then it's not really a string, is it?
0:28:32
drmeister
https://github.com/orivej/pzmq/blob/master/c-api.lisp#L500
0:28:59
drmeister
I have a talk to give tomorrow - I'm implementing shipping binary data from the Clasp kernel to the browser.
0:29:14
drmeister
I need to ship an array of floats as a binary blob of data.
0:29:24
stassats
don't let buf be a string
0:30:45
drmeister
SHIT - I was using a simple byte8 array hours ago - something else must have confused me.
0:31:08
stassats
i don't think it accepts simple arrays
0:31:39
stassats
at least not readily
0:31:47
drmeister
What's it going to accept in buf?
0:31:58
drmeister
I have a specialized simple array of byte8 - not that?
0:32:04
stassats
well, you can look at its docstring for starters
0:32:08
drmeister
This is why I put it into a string
0:32:51
drmeister
A foreign byte array - what would that look like.
0:33:20
stassats
well, it's you who should know
0:34:08
drmeister
It's probably our ForeignData_O type.
0:34:22
stassats
well, whatever you use for cffi
0:34:44
drmeister
Yeah - I'm pretty sure it's that.
0:35:14
stassats
well, better keep your code sensible and portable and use cffi
0:39:08
drmeister
I see what I'm supposed to do.
0:45:40
drmeister
Thank you very much.
0:48:18
stassats
something like (cffi:with-foreign-object (x :double 3) (setf (cffi:mem-ref x :double 0) 1d0))
0:51:15
drmeister
Well, I've got a different situation. I have a (simple-array single-float *) and I want to convert it to a foreign-data object
0:51:36
drmeister
So I wrote a C++ function that copies the byte representation of the single floats into a foreign-data object.
0:52:59
drmeister
I'm not very comfortable with the foreign-data object - I completely forgot about it frankly.
0:53:07
drmeister
Now I see what it's good for.
0:54:55
drmeister
This isn't so foreign though - it's a Common Lisp specialized array of floats. Anyway - I'm just making excuses for why I didn't make the connection.
0:55:02
drmeister
I should have looked at the pzmq source earlier.
0:55:13
drmeister
I lost about 5 hours on this. (sigh)
1:02:38
drmeister
::notify frgo Ok - let's get rid of Pointer_O - ForeignData_O is the way to go.
1:02:38
Colleen
drmeister: Got it. I'll let frgo know as soon as possible.
1:06:05
drmeister
::notify frgo Why doesn't ForeignData_O have a method to return its size? I'm adding one - but do you have a reason why it shouldn't have one?
1:06:05
Colleen
drmeister: Got it. I'll let frgo know as soon as possible.
Monday, 16th of April 2018, 2:07:27 UTC