freenode/#lisp - IRC Chatlog
Search
1:31:40
dtornabene
so am I correct in thinking that Clack only uses roswell for the commandline launching script(s)?
1:37:36
PuercoPop
dtornabene: if you are wondering that if you need to use roswell to use clack, then the answer is no
2:45:09
aeth
(not (mismatch #(1 2 3) #(4 5 6 1 2 3) :start2 3 :end2 6)) will generally be more efficient than this, right? (equalp #(1 2 3) (subseq #(4 5 6 1 2 3) 3 6))
3:04:16
defunkydrummer
aeth: equalp is overkill here, if they are fixnums i think eq would do the job. Also, i'd rather explicitely create simple-vectors of type fixnum, instead of using the #() reader macro.
3:05:35
defunkydrummer
aeth: (eq if you want to loop over the elements yourself.) I might be wrong, though.
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.