Whistleblower
Cool
yoav
why do we need so many probing technique in hash table does a one probing technique us faster then another technique? why cant we just use linear probing and that's it what is differentiate between one probing technique to other probing technique
Hermann
[OT] Has anyone taken Coursera courses?
Cyber9ja
Yes
void *
/get noendl
void *
🤔
Ludovic 'Archivist'
I personally use a mix of both that I label in my code as skipstone probing where I do linear probing by groups of 1 cache line and skip a defined amount of steps before redoing the same. It tries to consile both the cache friendliness of linear probing and its terrible tendency to make clusters
Ludovic 'Archivist'
It means that the best case is linear probing and the worst case is not going round for 12 milliseconds because the hashmap is 94% full
Ибраги́м
https://h313.info/blog/cpp/2020/05/17/this-is-what-peak-hello-world-looks-like.html
Mar!o
Guys does anybody know how to declare a 64-bit integer in ANSI C? The long long int (which is 64-bits on most systems) is only available since C99 and long in ANSI C seems to be 32 bit. Is there any 64-bit integer in ANSI C?
Mar!o
stdint.h is not available in ANSI C AFAIK :/
Mar!o
C89/C90 assert.h Assertions ctype.h Tests auf bestimmte Zeichentypen errno.h Codes von Systemfehlern float.h Angaben zu den Wertbereichen von Gleitkommazahlen limits.h Angaben zu Beschränkungen des verwendeten Systems locale.h Einstellungen des Gebietsschemas math.h mathematische Funktionen setjmp.h erweiterte Sprungfunktionen signal.h Signalbehandlung stdarg.h Argumentbehandlung für variadische Funktionen stddef.h zusätzliche Typdefinitionen stdio.h Ein- und Ausgabe stdlib.h vermischte Standardfunktionen, u. a. Speicherverwaltung string.h Zeichenkettenoperationen time.h Datum und Uhrzeit Neu in C95 (auch: „NA1“) iso646.h alternative Schreibweisen für logische und bitweise Operatoren wchar.h Unterstützung für Unicode-Zeichen wctype.h wie ctype.h, für Unicode-Zeichen Neu in C99[1] complex.h Komplexe Zahlen fenv.h Einstellungen für das Rechnen mit Gleitkommazahlen inttypes.h Konvertierungs- und Formatierungsfunktionen für erweiterte Ganzzahltypen stdbool.h Unterstützung für Boolesche Variablen stdint.h plattformunabhängige Definition von Ganzzahltypen tgmath.h typgenerische Makros für mathematische Funktionen Neu in C11 stdalign.h Makros für die Speicherausrichtung von Objekten stdatomic.h Typen und Makros für atomare Operationen zwischen Threads stdnoreturn.h Definition des No-Return-Makros threads.h Unterstützung für Threads, Mutexes und Monitore uchar.h Unterstützung für UTF-16- und UTF-32-kodierte Unicode-Zeichen
Mar!o
Yeah it's C99 like long long - that's why I wonder how to declare 64-bit integer in ANSI C/C89/90 :/
Anonymous
I think the default for most is lp64
Anonymous
Which states that long and pointer are promoted to 64-bit and integer is 32-bit
Anonymous
BTW do remember that int* is usually 64-bit and int is usually 32-bit All pointers usually have the same size but this is not strictly a requirement per ISO
Anonymous
Otherwise the quickest way is to just use a long
Dima
Lol
Mar!o
Otherwise the quickest way is to just use a long
But I need to make sure it's at least 64-bit
Mar!o
Is there really no portable way?! Did ANSI C had no 64-bit integers?!
Artöm
Do you have to stick to ansi C? C99 is pretty supported ob most if not all platforms
Mar!o
Do you have to stick to ansi C? C99 is pretty supported ob most if not all platforms
Yes :( like you said it's not supported an ALL platforms and I really need all :P
Mar!o
I think it's just weird that there is no long long in ANSI C and long is 32-bit?!!
Mar!o
Maybe I should just use C++
Mar!o
Or C99...
Mar!o
But I think it's stupid they made long 4 bytes even when remains from 16-bit systems. I mean it just makes more sence to have short 2 bytes, int 4 and long 8...
Mar!o
I just read it looks like MSVC is not supporting C99 at all :( so I need to use good old ANSI C
Artöm
Yes :( like you said it's not supported an ALL platforms and I really need all :P
You have to use preprocessor to typedef int64 for all compilers you care of then
Mar!o
Mar!o
okay... I will search for some code
Sandy #КИБЕРИНЖЕКТОРЫ
When your code doesn't work😂
Mar!o
When your code doesn't work😂
Or when you see there is no 64-bit int in ANSIC C
Mar!o
I wonder what standart the linux kernel follows ....
Mar!o
Because AFAIK it has 64-bit ints
Mar!o
Really? I mean of course that's possible - but will the compiler use the 64-bit registers (rax, rbx, etc) for my own 64-bit types?! And since I can't overload operators I will have to write a lot of ugly macros or inline functions
Mar!o
Maybe I should just use assembly 😡
Mar!o
Ahh I think I will just use C99... I mean I can compile on windows with clang... and it has SOME support of C99 :)
Artöm
msvc also has some 99 support
Asad
Why use C89 or C99 while there are newer standards?
Artöm
long long at least
Mar!o
Why use C89 or C99 while there are newer standards?
To be full cross platform - C99 is well supported but C11 not that...
Mar!o
msvc also has some 99 support
Yes but for example they just didnt include the restrict keyword so you have to do a #define restrict __restrict there :(
Mar!o
Yeah you are right - I think I will go for C99 now. Or just ignore all that cross platform stuff and go with C++
Mar!o
or Rust - but for very low level stuff C still feels better for me - Rust is not that transparent there
Ajay
I was debugging my code and the debugger is showing this. Can't understand what does the exception at the start of function mean?
Anonymous
The correct way to allocate such huge structures is to call malloc
Anonymous
And check if the allocation actually succeeded
Ajay
3*1e7 is approx 120 MB, shouldn't the os have allowed that much stack space?
Ajay
is there a way to know how much space is allowed for my array size?
Ajay
hmm makes sense
Anonymous
That is heavily dependent on the compiler and the environment it is compiled with
Anonymous
is anyone here preparing for GATE2021 message me privately
Anonymous
Ajay
ok
Ajay
Just use malloc
vector<int> should work fine, right ?bcz of dynamic allocation
Anonymous
Sorry no idea about C++
Ajay
BTW, this int *arr = new int[SIZE]() ; allocates SIZE no. of ints, with value-initialise with 0, didn't they provide a way to initialise it with some other value as in case of vector<int> arr(SIZE, value)?
Ajay
hmm
Ajay
A simple loop should be eligible to initialize this. Do you have any objection to use it?
yeah, that will, BTW, is there any slowness in the manner the way vector<int> arr(n, value) will initialise it as compared to loops?
Ajay
It byte-initialises the memory
Ammar
Oh right.
Ajay
Memset just sets every byte in a region of memory to a particular value.
Ajay
anyone?
this. @ammarfaizi2
Ajay
since, globals are stored in data-segment, is there a particular size for this too? like that in case of stacks
Ajay
yeah, are such kind of functions in c++ just provided to save the programmer from writing manual loops?
Ammar
this. @ammarfaizi2
Yeah, it is probably better to use a simple loop at the moment, other than looking for something that we don't even know it exists.