|
eschaton posted:no what the hell turns out a hashtable into an array of string pointers is cheaper than a hash table to string pointers
|
# ? Apr 12, 2018 13:31 |
|
|
# ? Jun 8, 2024 04:27 |
|
"i wish i could quit you"code:
|
# ? Apr 12, 2018 14:08 |
|
Rust has a distinct random seed for every hash table (when using the default hasher), but it's a security thing to make it more difficult for an attacker that controls keys to synthesize collisions.
|
# ? Apr 12, 2018 17:32 |
|
and rust's ordered dictionaries use b-trees instead of red-black trees because b-trees are cache friendlier rust's stdlib is good
|
# ? Apr 12, 2018 18:00 |
|
yeah having a well defined iteration order is fine. you only run into problems when it’s predictable enough that people rely on it, but not defined so they shouldn’t the point of randomizing hash seeds to to prevent attacks that force lots of things into the same bucket, not to randomise the iteration order. python just doesn’t use the bucket order for iteration any more.
|
# ? Apr 12, 2018 18:32 |
|
Blotto Skorzany posted:"i wish i could quit you"
|
# ? Apr 12, 2018 19:09 |
|
Blotto Skorzany posted:thanks TI for literally never clicking build on an example project before shipping your IDE
|
# ? Apr 12, 2018 19:11 |
|
Gazpacho posted:It’s your fault for exiting from a microcontroller program, who does that the callsite is in ti's autogenerated asm startup boilerplate that i stupidly used instead of writing my own
|
# ? Apr 12, 2018 19:26 |
|
Blotto Skorzany posted:"i wish i could quit you" sure i'll ask, what's the fix
|
# ? Apr 12, 2018 20:46 |
|
eschaton posted:no what the hell
|
# ? Apr 12, 2018 21:16 |
|
"map" is a perfectly adequate generic term. "dictionary" implies ordering imo, by analogy with its printed and bound namesake. "hash" implies a hash table implementation of some kind and the existence of an associated "hashable" protocol for potential key types. as with so many other things, java gets this right (interface Map, classes HashMap and TreeMap). carry on then posted:sure i'll ask, what's the fix don't call exit what does it mean to exit from a bare-metal program
|
# ? Apr 12, 2018 21:49 |
|
carry on then posted:sure i'll ask, what's the fix either provide a no-op _exit() for the linker to find or dig through the startup boilerplate asm and delete the call to exit() [and then if the startup assembly routines get overwritten from some template when you do a clean-and-build, delete the part of the template that's inserting calls to exit()]
|
# ? Apr 12, 2018 22:00 |
|
Blotto Skorzany posted:
|
# ? Apr 12, 2018 22:01 |
|
Sapozhnik posted:"map" is a perfectly adequate generic term. disable interrupts and turn off the clock
|
# ? Apr 13, 2018 00:12 |
|
Sapozhnik posted:"map" is a perfectly adequate generic term. The worst offender by far is std::unordered_map which is literally just a hash table.
|
# ? Apr 13, 2018 07:15 |
|
what's wrong with that name it specifies exactly what it is without including any details about its implementation
|
# ? Apr 13, 2018 15:55 |
|
CommunistPancake posted:what's wrong with that name Except it's specifically defined as a hash table in the standard.
|
# ? Apr 13, 2018 16:48 |
|
basically all maps define their basic implementation in the interface if they allow any sort of (stored) key customization at all does it require a comparison function? guess what, it’s some sort of search tree does it require a hash operation? guess what i mean i guess you could make a map that silently degraded to a linear scan if the key was neither hashable or comparable but that sounds loving terrible
|
# ? Apr 13, 2018 17:15 |
|
if your hash functions are bad enough you can do that transparently
|
# ? Apr 13, 2018 18:59 |
|
node related programs fail because of spaces in paths in 2018 https://github.com/zkat/npx/issues/100
|
# ? Apr 16, 2018 17:02 |
|
Wheany posted:node related programs fail because of spaces in paths in 2018 "Windows bug, wontfix"
|
# ? Apr 16, 2018 17:14 |
|
https://github.com/nodejs/node-v0.x-archive/issues/6960 Tldr node is completely incompatible with Windows path limits. Node Dev response "node is not broken, not our fault that this most used operating system in the world has used path limits for 40 odd years."
|
# ? Apr 18, 2018 19:13 |
|
that's from 2014 when they were still on npm v2 npm v3 flattened out the node_modules directory structure and generally works ok on windows now
|
# ? Apr 18, 2018 19:20 |
|
aren't there special low-level windows APIs node could be using that aren't subject to those limits anyway
|
# ? Apr 18, 2018 19:21 |
|
npm is a hilarious cluster gently caress
|
# ? Apr 18, 2018 19:26 |
|
Ralith posted:aren't there special low-level windows APIs node could be using that aren't subject to those limits anyway kinda. Windows has a constant called MAX_PATH whose value is 260, and a lot of programs have stack declarations like "char path[MAX_PATH];" in them. so windows isn't allowed to even read past the 260 character mark for any api that takes a path because idk i guess lots of people did strncpy()s into those stack buffers and potentially failed to NUL-terminate them. You can, however, indicate that you wish to opt out of this limit by prepending \\?\ to your path, which wasn't a valid path in non-NT windows. AFAIK the native wide-char win32 apis still have this restriction, since the wide-char api was designed for smooth migration from the 8-bit char api.
|
# ? Apr 18, 2018 19:28 |
|
It is pretty stupid that windows still has limits on path depth but drat if you don't know how to work around that as a computer programming professional.
|
# ? Apr 18, 2018 19:29 |
|
POSIX still defines an unfortunate path limit of PATH_MAX that software winds up using, instead of taking advantage of the fact that C strings can be arbitrary length it’s just often larger than its minimum spec value of 256
|
# ? Apr 18, 2018 19:40 |
|
cis autodrag posted:It is pretty stupid that windows still has limits on path depth but drat if you don't know how to work around that as a computer programming professional. I don't spend any time writing software for Windows, why should I know how to work around it's 30 year old cruft
|
# ? Apr 18, 2018 20:15 |
|
it sounds like you do know how to work around that limit
|
# ? Apr 18, 2018 20:24 |
|
Thermopyle posted:it sounds like you do know how to work around that limit
|
# ? Apr 18, 2018 20:52 |
|
Null terminated strings were a mistake
|
# ? Apr 18, 2018 21:01 |
|
yeah clearly Linux would never have such a boneheaded API
|
# ? Apr 18, 2018 21:01 |
|
all software is boneheaded
|
# ? Apr 18, 2018 21:21 |
|
HappyHippo posted:Null terminated strings were a mistake i wonder what horrendous class of bugs we'd see if pascal style '1b of length prepended' strings were the norm like you get the strn-flavored calls right out the gate
|
# ? Apr 18, 2018 21:28 |
|
JawnV6 posted:i wonder what horrendous class of bugs we'd see if pascal style '1b of length prepended' strings were the norm my idea was to have every string always be length 256 and indexed with a byte
|
# ? Apr 18, 2018 21:53 |
|
Sapozhnik posted:kinda. Windows has a constant called MAX_PATH whose value is 260, and a lot of programs have stack declarations like "char path[MAX_PATH];" in them. so windows isn't allowed to even read past the 260 character mark for any api that takes a path because idk i guess lots of people did strncpy()s into those stack buffers and potentially failed to NUL-terminate them. even if you do this, the problem is that you are making paths which other programs can't use. maybe it's fixed now, but for a very long time explorer.exe couldn't deal with long paths. iirc, most filesystems limit each individual portion of a path to either 255 characters or 255 bytes depending upon the implementation, so MAX_PATH is ok for individual parts of the path. PATH_MAX is dumb, but it's usually something more reasonable like 1024 or 4096 characters. there have also been steps taken such as deprecating hardcoded path-length functions like getwd() and readdir_r() to get people to stop relying on it. The_Franz fucked around with this message at 01:37 on Apr 19, 2018 |
# ? Apr 18, 2018 21:54 |
|
qntm posted:my idea was to have every string always be length 256 and indexed with a byte i think this is how Software Tools (the library referenced repeatedly in the famous "Why Pascal Is Not My Favorite Programming Language" paper) worked
|
# ? Apr 18, 2018 22:09 |
|
is this the rocks in a greenhouse thread
|
# ? Apr 19, 2018 01:35 |
|
|
# ? Jun 8, 2024 04:27 |
|
qntm posted:my idea was to have every string always be length 256 and indexed with a byte "\pNice"
|
# ? Apr 19, 2018 01:37 |