olli
an integer division by 3 might be optimized to (output of GCC below) square(int): mov eax, edi mov edx, 1431655766 sar edi, 31 imul edx mov eax, edx sub eax, edi ret
Death Killer
Is anyone appearing for NPTEL c++ exam
Ludovic 'Archivist'
https://youtu.be/YQs6IC-vgmo
funny thing is removing linked lists from hash tables
Ludovic 'Archivist'
you get 1.5x the performance from my tests
Ludovic 'Archivist'
That is what I did in the Freestanding Extensions Library
Ludovic 'Archivist'
Ludovic 'Archivist'
those are reads
Ludovic 'Archivist'
Y axis is time per read in nanoseconds
Ludovic 'Archivist'
X axis is the number of elements in the set
Ludovic 'Archivist'
all elements of the set were queried once
olli
would be intersting how absl::flat_hash_map compares
Ludovic 'Archivist'
Ludovic 'Archivist'
so they should be comparable
klimi
i have no idea what is that second thing
Ludovic 'Archivist'
i have no idea what is that second thing
Both are hash tables, blue is clinl's, orange is the normal ones from c++ standard library
klimi
ohhh
klimi
its clinl
klimi
interesting results qneko
Ludovic 'Archivist'
actually, the hash maps from the FEL have a tool to diagnose the internal state and get statistics
Ludovic 'Archivist'
unordered_map statistics: band_size: 12288 size: 4502 displacements: 0.2923145268769436 max displacement: 10
Ludovic 'Archivist'
unordered_map statistics: band_size: 12288 size: 4502 displacements: 0.2923145268769436 max displacement: 10
band size = capacity size = size (?) displacement = the average number of failures to get the values max displacement = the maximum number of failures to get a value
klimi
did you do this @qneko?
Ludovic 'Archivist'
yeah
klimi
so clever
Ludovic 'Archivist'
It was a pain to not have that to measure if the performance was stable enough
Ludovic 'Archivist'
would be intersting how absl::flat_hash_map compares
If you want to try it out, here is the benchmark code I used : https://github.com/clinlfoundation/FEL/blob/master/tests/test004.cpp
Anonymous
How To implement a Mobility Model In Omnet++
Dima
Omelette++
Anonymous
Omnet ++ is a discrete event based simulator Similar to Ns2
🐰🐾 سمیه
🐰🐾 سمیه
hi here is my code, and I dont know why it wont work. It's an example from K&R
🐰🐾 سمیه
here is the output after complilation
Никита
Hardcore chat I have just joined, but I already can be banned
🐰🐾 سمیه
@viferga
Dima
These rules mostly apply to Indians
Parra
here is the output after complilation
you need to include that finctions
Никита
Thank you for new stickers
Parra
they are just declared
🐰🐾 سمیه
they are just declared
aha. but they are not in the book, maybe it just wants us to know how it works in the book. but I wanted to debug it, is it feasible now?
🐰🐾 سمیه
what does the highlighted part says exaxtly?
Parra
i dont know
🐰🐾 سمیه
Parra
what does the highlighted part says exaxtly?
it seems that there is another file
Parra
maybe you need the file where the stack is implemented
Parra
c is hard for a beginner
Parra
i started with vb6
Parra
the modern analogue maybe javascript or python
Parra
then i moved to c/c++
🐰🐾 سمیه
no idea
🐰🐾 سمیه
thanks🌷🌷🌷
Anonymous
Thank you.
Parra
thanks🌷🌷🌷
in any case check the book, maybe the code is there too
Parra
you need something like: void push(double d) { // code }
Parra
also, what is that book?
Parra
what does the highlighted part says exaxtly?
what is saying here is basically they are doing a really nasty implementation
Parra
with side effects
Dierry
Hi 🙌 Rose
🐰🐾 سمیه
in any case check the book, maybe the code is there too
you're right, the function definitions were in the next pages. I added them to the file, and it compiled properly. but after running it, I got this error.
🐰🐾 سمیه
🐰🐾 سمیه
and here is the file of the program
🐰🐾 سمیه
Parra
change %.8 by %f
Parra
whats that?
I have a crystal ball that shows me the future
Parra
it is magical
BinaryByter
lets not invent new programming languages
Parra
i read your next pages of the book
Parra
change %.8 by %f
this will work i think
🐰🐾 سمیه
🐰🐾 سمیه
this will work i think
ok,I'll do it
🐰🐾 سمیه
printf("\t%.f\n", pop());
🐰🐾 سمیه
is it true?
🐰🐾 سمیه
ask your crystall ball
Parra
printf("\t%f\n", pop());