|
do macos and windows have native apis for unicode text segmentation? id prefer to not use icu on those platforms since they have gently caress all package management and then id have to care about each its cve. (also icu has some initialization issues when used multithreaded on macos i guess)
|
# ¿ Jul 24, 2019 20:31 |
|
|
# ¿ Apr 29, 2024 16:58 |
|
pokeyman posted:if I understand the relevant terms correctly, I think you want https://developer.apple.com/documentation/foundation/nsstring/1416774-enumeratesubstringsinrange (have a look at the options bitmask). the C equivalent is https://developer.apple.com/documentation/corefoundation/cfstringtokenizer-rf8 if objc is something you want to avoid. ta least that fixes my techinal problem
|
# ¿ Jul 24, 2019 22:04 |
|
ive been supposing to learn little obj-c anyway so just need to buy some cheapo screen to hook up my broken screen macbook air to matti fucked around with this message at 08:51 on Jul 25, 2019 |
# ¿ Jul 25, 2019 08:49 |
|
|
# ¿ Jul 25, 2019 09:28 |
|
pokeyman posted:oh of course. that makes perfect sense!
|
# ¿ Jul 25, 2019 23:26 |
|
working on my dumb librarycode:
if your compiler doesnt support anonymous unions go to hell. e: coupla fixes ee: api design when drunk is hard matti fucked around with this message at 00:54 on Jul 27, 2019 |
# ¿ Jul 27, 2019 00:11 |
|
The freopen function first attempts to close any file that is associated with the specified stream. Failure to close the file is ignored. The error and end-of-file indicators for the stream are cleared. pff. like you would hope a failure would set the error flag but no actually the exact opposite happens. what a world
|
# ¿ Jul 27, 2019 02:24 |
|
im sure it all works in practice but when writing code examples for documentation id rather not do anything platform specific since you soon get into a chicken and egg situation
|
# ¿ Jul 27, 2019 02:51 |
|
Plorkyeran posted:reporting failures when closing a file is pretty pointless nah yeah it makes sense to me now when more sober just that my mental model of how the FILE error flag worked was just different file systems are hard
|
# ¿ Jul 28, 2019 19:37 |
|
matti posted:nah yeah it makes sense to me now when more sober though id still prefer itd be set and user explicitly testing ferror() if they want to recover from an open and/or close failure since thatd be more symmetric to how rest of the api works
|
# ¿ Jul 28, 2019 20:48 |
|
whats the thread safe basename() on macos? or is it just that
|
# ¿ Dec 6, 2019 05:59 |
|
probably maybe surely actually going to release my first softwarecode:
im not going the copy+paste the whole license screed into each file that is dog nasty
|
# ¿ Dec 18, 2019 22:53 |
|
Soricidus posted:that’s probably ok if that’s the license you want! ah see but i'm a moron and use vi i'll probably just bite the bullet and use the lawyer vetted option just to make it easier for any potential packagers matti fucked around with this message at 00:58 on Dec 20, 2019 |
# ¿ Dec 20, 2019 00:54 |
|
but then i'd have to deal with vimscript and i would rather avoid that eh i'll switch to emacs if it becomes an issue
|
# ¿ Dec 20, 2019 01:11 |
|
i just assume any vim plugin will eventually break on some weird edge case and i'm stuck with debugging it ...i will try it, thank you
|
# ¿ Dec 20, 2019 01:14 |
|
i mean meth exists when push comes to shove, i'll do fine
|
# ¿ Dec 20, 2019 01:39 |
|
regex is the worst PL
|
# ¿ Dec 22, 2019 17:27 |
|
Powerful Two-Hander posted:the moral of the story is: whatever you do it's gonna suck in some way and you'll wish you did something else, but you have to deal with that and not get super paranoid about what ifs i spent my 20s drinking beer and listening to punk rock op now im soon 30 and might as well get some poo poo job writing java so i can finance doing the very same but it definitely doesn't suck
|
# ¿ Jan 7, 2020 20:25 |
|
then again i'm from massive privilege
|
# ¿ Jan 7, 2020 20:29 |
|
https://paste.ofcode.org/DtfrvVMDpDNh7GvXYj9srK can i get some c&s on my commenting? i was completely hopeless just a year ago but im starting to feel pretty comfortable now still don't know how to comma so i just wing it
|
# ¿ Jan 14, 2020 17:55 |
|
Phobeste posted:not really. you can't allow random byte access. you can allow random code point access. this gets insanely squirrelly around combining marks though. a good example are the family emojis, which are supposed to be composed from individual emojis. paste a family emoji into a python shell and you might get a string length of 7, which is presumably 7 codepoints - four person emojis and 3 zero width joiners between them. access element 1 of this string and you will get '\u200d', unicode codepoint u+200d, ZERO WIDTH JOINER. this is encoded in utf-8 as 3 bytes (according to me loving around). seven codepoints, one glyph (in most rendering engines - sometimes you get rendering engine weirdness where that ends up being a string of four people, if something stripped unprintable characters in between). does unicode have a recursion depth limit for parsing that? but yes, if you're doing anything bordering semantics with unicode forget about it and link with ICU unicode should be thought of as a black box matti fucked around with this message at 18:22 on Jan 14, 2020 |
# ¿ Jan 14, 2020 18:19 |
|
The_Franz posted:also wchar_t is an unholy abomination and should be burned at the stake, the ashes scattered to the most remote corners of the earth and forgotten for all eternity ucs-2 was a beautifully naive dream and i appreciate it for that
|
# ¿ Jan 14, 2020 19:31 |
|
Phobeste posted:i think the commenting here is good. calls out the things that would be surprising to someone who knows the language but is just starting to look at this specific use case. theres uh some other stuff i disagree with but the comments seem good "you really should stop fitting a c++ shaped peg into a c shaped hole" edit: its xmacros, once you start relying on xmacros its best to move on matti fucked around with this message at 20:25 on Jan 14, 2020 |
# ¿ Jan 14, 2020 20:07 |
|
Plorkyeran posted:posix says that filenames are just arbitrary strings of bytes as a garbage way of "supporting" systems that predate utf-8 and also don't store what encoding the filenames are encoded with anywhere. for some reason this makes linux users think that they actually should create files with names that are just arbitrary bytes and not utf-8. https://dwheeler.com/essays/fixing-unix-linux-filenames.html its a mess edit disclaimer i dont agree or disagree with any of that time cube rear end website's opinions
|
# ¿ Jan 14, 2020 20:51 |
|
so if i were to write a c++ linux software how hosed would i be if i used visual studio? definitely not going to bang none of that in a terminal
|
# ¿ Jan 16, 2020 17:03 |
|
CRIP EATIN BREAD posted:do you mean visual studio or visual studio code? because i dont know how visual studio could possibly work. https://devblogs.microsoft.com/cppblog/linux-development-with-c-in-visual-studio/ its a thing
|
# ¿ Jan 16, 2020 17:08 |
|
yeah clion in actual non WSL linux is the alternative, i've heard its quite good
|
# ¿ Jan 16, 2020 17:19 |
|
The_Franz posted:clion is good. better than msvc now imo (particularly when it comes to refactoring tools, there is absolutely no comparison) and getting better with every release, as opposed to visual studio which seems to be getting worse every year i assume this is c++ specific advise since in c _GNUC_ is far more permissive and flexible
|
# ¿ Jan 16, 2020 18:59 |
|
cl.exe c99 has been fine for good couple years now at least
|
# ¿ Jan 16, 2020 19:11 |
|
no don't worry i asked i'm taking the advise
|
# ¿ Jan 16, 2020 19:16 |
|
man 2 sysctl posted:Glibc does not provide a wrapper for this system call; call it using am i really supposed to parse a loving text file? like i grieve enough about every program having to be parser but this is something else, there has to be a wrapper right? right i'm probably putting too much faith in some FSF jack-offs's opinionated manpage
|
# ¿ Jan 23, 2020 20:39 |
|
and i wouldn't have to care about none of this if mmap() didn't set the same errno for two different error conditions e: i must be doing something wrong since this is so difficult. whats the best way to distinguish between ENOMEM No memory is available. and ENOMEM The process's maximum number of mappings would have been exceeded. This error can also occur for munmap(), when unmapping a region in the middle of an existing mapping, since this results in two smaller mappings on either side of the region being unmapped. obviously i can't expect any solution to be atomic but being correct 99% of time is good enough for my purposes matti fucked around with this message at 21:09 on Jan 23, 2020 |
# ¿ Jan 23, 2020 20:52 |
|
CRIP EATIN BREAD posted:These are essentially the same thing. Why would you need to differentiate it? it's for unit testing that file IO functions work properly with large values. basically i'm mirroring some multiple of a pagesize file over a big range of memory. one error is that there's just not enough virtual memory available, in which case the test is void. another case is that the function is misconfigured and the pages its mapping are too small, in which case the test itself is broken. i'll probably just disable those tests on 32 bit builds and treat every 64 bit ENOMEM as fatal (e: since 2^32-1 is the upper limit of any input value and i don't need to read variables wider than 4 bytes) matti fucked around with this message at 23:54 on Jan 23, 2020 |
# ¿ Jan 23, 2020 23:44 |
|
its likely that ive missed something in the documentation and have a wrong idea how the internal mmap() structures work
|
# ¿ Jan 24, 2020 00:03 |
|
i would do make a windows desktop software w/ c++ c apis right? mcv is jank, atl is somehow an alternative despite being an template library. com is an abi but the terminology is little messed. winrt is a stillbirth??
|
# ¿ Feb 8, 2020 09:40 |
|
think i have too much trauma from using terrible python qt software and the ide being sligthly broken on a clean install i can try
|
# ¿ Feb 8, 2020 10:15 |
|
i wrote an xml schema and it was surprisingly ok the docs are incredibly opaque though
|
# ¿ Mar 4, 2020 13:44 |
|
Shaggar posted:Idk if I've ever hand written xsd but it's real good in terms of usages. its good that i have sensible error messages now instead of python "error handling" (there is none)
|
# ¿ Mar 5, 2020 18:09 |
|
i know gently caress all about maffs, is 32 bit xorshift good enough for a video game or
|
# ¿ Mar 29, 2020 20:46 |
|
|
# ¿ Apr 29, 2024 16:58 |
|
pro motion ng is a "good" software thats terrible to launch from the start menu, poo poo takes good 3 seconds to register which is indistinguishable from normal star menu lag and each enter press launches a new process. i usually end up with at least 2 instances of it i'm not sure how the developer managed that
|
# ¿ Apr 7, 2020 18:34 |