freenode/#lisp - IRC Chatlog
Search
7:03:44
xificurC
I'm fighting a weird emacs crash, it just stops with exit code 15. A fresh install on a freshly installed ubuntu 18.04. Pure emacs runs fine but adding spacemacs to it crashes with this weird error. I'm surfing the stacktrace in gdb to find out what's causing it. http://ix.io/1aoa
9:25:08
jmercouris
I prefer to use something in the standard lib more often than inventing something
9:25:29
jmercouris
I guess I could write a hashing function, but then I'll have to consider collisions, etc
9:26:44
jmercouris
so each survey question has a description, I would like to hash this description and treat it as an ID
9:30:40
_death
there's no guarantee of a unique value for each string.. in fact it's quite the opposite, unless you have a bounded set of strings so you can build a perfect hash function for them
9:31:19
jmercouris
I will only have about 10 questions at a time per survey, the liklihood of collision is very low
9:32:14
jmercouris
autoincrement would require me to keep state in between the rendering and receipt of a request
9:32:46
jmercouris
though that could be fixed with some routing so that the submit button contains information about which survey the user is submitting
9:35:04
jmercouris
I just got tunnel vision, should have spent more time thinking about it instead of x-ying myself
9:35:48
_death
if your questions are kept in order, an index into them would make an ID as well.. if you only append questions it could be ok
9:37:19
jmercouris
let me first do a really basic implementation that works for me, and if anyone else ever uses the software, I'll consider making it more robust
9:40:05
jmercouris
shrdlu68: Indeed, but I'll be pursuing a different solution, I hadn't thought about my problem well at all, thanks anyway!
9:56:02
jmercouris
if the sequence of possible hashes is less than the amount of possible items, it is impossible
9:56:35
loke
jmercouris: Which means as you _increase_ the amount of data, the likelyhood of collisions goes up
9:57:07
jmercouris
so, I said, if we have some large piece of data, the more we reduce it during hashing, the more likely a collision
10:04:08
loke
If SXHASH returns a 32-bit number, you're going to have a roughly one-in-3000 chance of collision on a 4-element list.
10:11:38
_death
I don't understand that statement.. what is a "chance of collision on a 4-element list"
10:12:23
_death
if there are more than 2^32 possible 4-element lists, the probability of a collision is 1
10:13:56
jmercouris
I am referring to a collision within the list, that is, of the elements in the list, will there be a collision amongst themselves, not amongst all members of all lists
10:14:29
jmercouris
so if I have 2^32 lists that are all (list "a" "b" "c" "d"), and it is known that the set "a" "b" "c" "d" does not produce a collision, then it would be fine
10:15:40
jmercouris
so, within the context of my problem, what are you suggesting, is *not* an issue
10:15:56
_death
jmercouris: at this point we're not talking about your problem?.. I guess we've reached offtopicness
10:16:22
jmercouris
if we were talking about my actual problem, we can assume that no survey list will ever reach 2^32 questions long
10:17:21
_death
jmercouris: but that's only for the best-case scenario where SXHASH is does its best to be a uniform hash
10:29:00
loke
jmercouris: Actrually, accroding to the birthday paradox, the probability of two elements colliding is arougly sqrt(N). And remember that if you have more than two elements, you have to didivde that by (N-1)!
10:32:16
jmercouris
is it called cherry picking? I can't remember the strategies for dealing with collisions, it's been so long
10:32:20
loke
jmercouris: The probability of a collision for _two_ elements is definititely on the order of sqrt(2^32) for a 32-bit hash
10:34:46
loke
jmercouris: Plug your numbers in there, and you'll see that the chance of collision is much higher than you might think.
10:41:42
jmercouris
if you have 10 32 bit hash values, your probability of collision is 1 in 100 million
10:56:59
flip214
so you're giving out some HTML, restart the server, and the clients' values can't be associated any more
10:59:11
dim
does that ring a bell to anyone here: The symbol "*SYSTEM-DEFINITION-SEARCH-FUNCTIONS*" is not external in the ASDF/FIND-SYSTEM package.
12:38:14
Ukari
I have a 'funcallable/cc' and check it with (eq (type-of x) 'funcallable/cc). Then I use a lambda to wrap funcallable/cc, how could i check type of stuff inner the lambda eq funcallable/cc now?
12:39:25
Ukari
could i define sth like the struct funcallable/cc that could called by (funcall x) directly
13:00:37
dim
because the list of :depends-on did change, and the newer items are not taken into account
13:00:59
dim
basically I'm makeing a bundle where I want to deal with what's in PWD, not what's in QL
13:01:24
dim
(let ((pkgs (append '("pgloader" "buildapp") (getf (read-from-string (uiop:read-file-string (uiop:merge-pathnames* "pgloader.asd" *pwd*))) :depends-on)))) ... (ql:bundle-systems pkgs ...))
13:06:32
dim
it's ASDF/SESSION:CONSULT-ASDF-CACHE complaining now, in a call to ASDF/SYSTEM:SYSTEM-RELATIVE-PATHNAME, interesting
14:47:43
kqr
may or may not be the right place to ask: I use Emacs and SLIME, and evaluate things in SLIME with C-c C-c. this works for pretty much everything except (in-package :foo) declarations. is there a way to get it to work even with those?
14:49:06
kqr
it does not change which package SLIME is in. I have to go over to that buffer and manually enter (in-package :foo) for the change to take effect
14:51:45
kqr
hm. that's good. one problem down! but I have been dishonest with you. the full problem does not involve interactive use of SLIME. rather, it's an automated Org document export where Babel evaluates common lisp code and – apparently – does not respect (in-package :foo) either
14:54:30
kqr
i think I solved it, though. apparently there's a parallel to C-c ~ in the Org export – a :package header argument
14:54:43
kqr
thanks for the useful tip, though, I have been missing something like C-c ~ but not bothered enough to find it!
14:55:11
Xach
I have to say I use ,ch-p in the repl a lot more than C-c ~. But when I think of it I use it.
14:55:15
schweers
Xach: thank you for the tip with C-c ~. I did not know that, I always did C-c M-p, which can be annoying if one has packages foo and foo-test or foo and foo/test
14:58:21
Xach
schweers: inefficient maybe? i find them very handy and use them 1000000 times per day
15:02:57
schweers
push-package looks funny. I don’t know if I’ll ever use it, but I’ll try to keep an eye out for when it may be useful
15:10:44
ecraven
sloccount says it's 18k lines of lisp code (though I don't know how many of those might be auto-generated)
15:37:52
ealfonso`
does anyone have any experience with websockets on CL? I've heard about hunchensockets and clws. any recommendation between the two?
15:43:47
loke
The implementation is here: https://github.com/cicakhq/potato/blob/master/src/potato/ws-server.lisp
15:44:57
ealfonso`
loke thanks. I've heard that hunchensocket "is not recommended for production use" https://stackoverflow.com/questions/23855626/websockets-from-common-lisp do you know why someone might think this?
15:46:25
loke
I don't know if there is an issue with lots of connections though, I've only tested with a few hundred on a single process.
15:49:20
loke
But it was running off a laptop and I wasn't able to saturate the connections. But the system worked.
16:09:46
Xach
Different things to different people and some are less flexible about needs and context.
16:24:39
drmeister
What are the best resources for teaching a couple of undergraduates with little to no programming experience Common Lisp?
16:26:28
drmeister
They are committed for the summer - they already have a working Common Lisp environment (Cando/Clasp in a jupyter notebook). Emacs is being installed today.
16:26:53
Xach
drmeister: I like Practical Common Lisp and Paradigms of AI Programming very much. The latter is dense but rewarding.
16:27:43
drmeister
We've started with Practical Common Lisp and we have a copy of Land of Lisp - we have found a couple of web tutorials and we are running a boot camp.
16:31:01
Josh_2
When I was a nub I found PCL too hard, but Gentle introduction to symbolic computation was perfect when I had no programming experience
16:33:49
sjl
I also recommend Gentle first, then Practical, then go make things for a while, then maybe PAIP or CLR
16:34:21
ealfonso`
I never read any Common Lisp book. I started with emacs lisp and the emacs lisp manual, which is very user and beginer friendly. It wasn't hard to transition to CL. I may still be a noob though
16:34:52
Xach
ealfonso`: i think it would be helpful to read common lisp books and code in that case.
16:35:14
sjl
also throw "watch the SICP lectures" somewhere in there. not strictly about CL, but still really helpful
16:37:51
antoszka
From what I know now, I'd recommend starting with PAIP. Then using PCL (and Edi's excellent recipes) as a *practical* guide/reference.
16:38:44
antoszka
Scheme related stuff (PAIP lectures, * Schemer books) is good, too, but doesn't pertain to Common Lisp that much.
16:39:20
Xach
I think it can be helpful to learn about new ways of thinking about problems and solutions
16:40:46
jmercouris
it's not challenging to learn IRC, if they can't learn it, they won't have much luck with CL
16:53:11
ealfonso`
Xach what if you look at a random sample of my code https://pastebin.com/GCKGpn2B and tell me how bad you think it is and whether I still need to read common lisp books?
16:54:32
jmercouris
a measure of skill would be simple, are you able to do anything you'd like to do with the language in a timely manner?
16:58:49
ealfonso`
Josh_2 yeah, I did that while making lots of changes to a defstruct, I wanted git commits to be one-line changes, then forgot to close it.
17:01:03
ealfonso`
jmercouris I was able to write this restful front-end to my C library in about a week: http://ec2-54-213-11-217.us-west-2.compute.amazonaws.com/
17:01:54
jmercouris
I have no way of judging that, nor is it my place to, I'm not an employer considering you nor am I condeming
17:02:37
jmercouris
don't worry about whether you are "pro" or not, when it comes time, and you need to learn more to get something done, you will learn it
17:03:53
ealfonso`
jmercouris I just don't think reading dense programming books is necessarily always the best approach. some people might learn more quickly by doing
17:05:10
comborico1611
As long as I don't get lost, I consider the programming book a win. :-) Going to lunch!
17:05:16
Xach
If you rely only on learning by doing and teaching yourself, you will have gaps. It is possible to learn on your own and accomplish many great things. But I think you can do greater things by reading some other stuff.
17:06:02
jmercouris
there will be gaps in your knowledge only if you learn *just enough* to accomplish what you set out to do. If you explore the topics of things that you use, you shouldn't have many gaps