Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
tef
May 30, 2004

-> some l-system crap ->

eschaton posted:

no what the hell

that’s as bad as calling dictionaries “hashes,” it winds up implying too much about implementation that people then depend on and can then therefore never change

what are these people smoking

turns out a hashtable into an array of string pointers is cheaper than a hash table to string pointers

Adbot
ADBOT LOVES YOU

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
"i wish i could quit you"

code:
Finished building: "../main.c"
 
Building target: "isp_firmware.out"
Invoking: GNU Linker
"C:/ti/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -O1 -Os -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"isp_firmware.map" -o"isp_firmware.out" "./adc.o" "./caldata.o" "./dac.o" "./main.o" "./quarantine.o" "./spi_commo.o"  -Wl,--start-group -lc -Wl,--end-group 
makefile:147: recipe for target 'isp_firmware.out' failed
c:/ti/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status
gmake[1]: *** [isp_firmware.out] Error 1
gmake: *** [all] Error 2
makefile:143: recipe for target 'all' failed

**** Build Finished ****
(the fix was exactly what you think it was, but thanks TI for literally never clicking build on an example project before shipping your IDE)

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
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.

Sapozhnik
Jan 2, 2005

Nap Ghost
and rust's ordered dictionaries use b-trees instead of red-black trees because b-trees are cache friendlier

rust's stdlib is good

Soricidus
Oct 21, 2010
freedom-hating statist shill
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.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Blotto Skorzany posted:

"i wish i could quit you"

code:
Finished building: "../main.c"
 
Building target: "isp_firmware.out"
Invoking: GNU Linker
"C:/ti/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -O1 -Os -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"isp_firmware.map" -o"isp_firmware.out" "./adc.o" "./caldata.o" "./dac.o" "./main.o" "./quarantine.o" "./spi_commo.o"  -Wl,--start-group -lc -Wl,--end-group 
makefile:147: recipe for target 'isp_firmware.out' failed
c:/ti/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status
gmake[1]: *** [isp_firmware.out] Error 1
gmake: *** [all] Error 2
makefile:143: recipe for target 'all' failed

**** Build Finished ****
(the fix was exactly what you think it was, but thanks TI for literally never clicking build on an example project before shipping your IDE)
It’s your fault for exiting from a microcontroller program, who does that

JawnV6
Jul 4, 2004

So hot ...

Blotto Skorzany posted:

thanks TI for literally never clicking build on an example project before shipping your IDE
following standard industry practices

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

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

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Blotto Skorzany posted:

"i wish i could quit you"

code:
Finished building: "../main.c"
 
Building target: "isp_firmware.out"
Invoking: GNU Linker
"C:/ti/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -O1 -Os -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"isp_firmware.map" -o"isp_firmware.out" "./adc.o" "./caldata.o" "./dac.o" "./main.o" "./quarantine.o" "./spi_commo.o"  -Wl,--start-group -lc -Wl,--end-group 
makefile:147: recipe for target 'isp_firmware.out' failed
c:/ti/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2.exe: error: ld returned 1 exit status
gmake[1]: *** [isp_firmware.out] Error 1
gmake: *** [all] Error 2
makefile:143: recipe for target 'all' failed

**** Build Finished ****
(the fix was exactly what you think it was, but thanks TI for literally never clicking build on an example project before shipping your IDE)

sure i'll ask, what's the fix

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

eschaton posted:

no what the hell

that’s as bad as calling dictionaries “hashes,” it winds up implying too much about implementation that people then depend on and can then therefore never change

what are these people smoking
hash

Sapozhnik
Jan 2, 2005

Nap Ghost
"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

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

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()]

Cyberpunkey Monkey
Jun 23, 2003

by Nyc_Tattoo

Blotto Skorzany posted:


(the fix was exactly what you think it was, but thanks TI for literally never clicking build on an example project before shipping your IDE)

Only registered members can see post attachments!

Bloody
Mar 3, 2013

Sapozhnik posted:

"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).


don't call exit

what does it mean to exit from a bare-metal program

disable interrupts and turn off the clock

qhat
Jul 6, 2015


Sapozhnik posted:

"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).


don't call exit

what does it mean to exit from a bare-metal program

The worst offender by far is std::unordered_map which is literally just a hash table.

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

what's wrong with that name

it specifies exactly what it is without including any details about its implementation

qhat
Jul 6, 2015


CommunistPancake posted:

what's wrong with that name

it specifies exactly what it is without including any details about its implementation

Except it's specifically defined as a hash table in the standard.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
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

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
if your hash functions are bad enough you can do that transparently

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
node related programs fail because of spaces in paths in 2018

https://github.com/zkat/npx/issues/100

qhat
Jul 6, 2015


Wheany posted:

node related programs fail because of spaces in paths in 2018

https://github.com/zkat/npx/issues/100

"Windows bug, wontfix"

qhat
Jul 6, 2015


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."

repiv
Aug 13, 2009

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

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
aren't there special low-level windows APIs node could be using that aren't subject to those limits anyway

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
npm is a hilarious cluster gently caress

Sapozhnik
Jan 2, 2005

Nap Ghost

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.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
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.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
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

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

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

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

it sounds like you do know how to work around that limit

qhat
Jul 6, 2015


Thermopyle posted:

it sounds like you do know how to work around that limit

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
Null terminated strings were a mistake

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
yeah clearly Linux would never have such a boneheaded API

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

all software is boneheaded

JawnV6
Jul 4, 2004

So hot ...

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

qntm
Jun 17, 2009

JawnV6 posted:

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

my idea was to have every string always be length 256 and indexed with a byte

The_Franz
Aug 8, 2003

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.

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.

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

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

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

tef
May 30, 2004

-> some l-system crap ->
is this the rocks in a greenhouse thread

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

qntm posted:

my idea was to have every string always be length 256 and indexed with a byte

"\pNice"

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply