#Suggestions what to add to my god-header-file
119 messages · Page 1 of 1 (latest)
your clear console function is a bit terrible, and it doesn't even clear by default
I know folks prefer clearing the console with built-in functions like cls but that's not my cup of tea
I'm not sure what the point of your sleep function, there's already one in the STL and the point is that it's type safe, you can't fumble the time unit
But I am open to change of course
at least make it clear when you call the function without arguments
too much code
you mean the sleep function?
getenv, should be std::getenv
the clear_console
oh yeah mb I should fix that
why would get_env throw if the var is empty?
Because that should never happen.
@granite stag has reached level 2. GG!
throwing is a quick and dirty solution for now
why not?
to_upper is UB
to_lower too
As in now, I don't have alot of error handling anywhere. As I said I'll fix later. Throwing works for now
what's the point of format when we have std::format?
but an empty env variable is valid?
It really looks like you could use a macro for half of these
just do a macro called sleep and make it do usleep * 1000
separate should probably be called split, and you should use std::move instead of copies
no, macros are terrible
how come
I don't like to sort and fill in by order of std::format also g++ is messed up for some reason
if they are not complex, weirdly abstract, or just dumb, they are actually fairly useful
terrible to debug, harder to track what the code actually is, there are very very few reason to use a macro in modern C++
parsing ini and loading an ini should be different functions
For simple macros tho
such as this
what would be the point tho?
#define sleep_ms(ms) usleep(ms * 1000);
just write the function
usleep isn't portable
true
fair enough
by the way are you two's main language c++?
for me yes
https://github.com/ZiggityZaza/CeggsyLib/blob/f3dd73e393e31134361d08cca95af698d0e997d8/cslib.h%2B%2B#L365
you open the file but don't close it, that's annoying
when the Out is destructed
but yours is gobal so it'll stay open until the end of the program
https://github.com/ZiggityZaza/CeggsyLib/blob/f3dd73e393e31134361d08cca95af698d0e997d8/cslib.h%2B%2B#L396
you're takng the arguments by copy
sleep_until_tomorrow is sus af lmao
why is that?
what is add_zero supposed to do?
when have a single digit number, it puts a "0" infront of it
https://github.com/ZiggityZaza/CeggsyLib/blob/f3dd73e393e31134361d08cca95af698d0e997d8/cslib.h%2B%2B#L479
I would much rather a function that returns a new timestamp like Timestamp::now() than updating the current one
maybe add a comment or an example
also what if I want 3 digits?
Thats impossible
add an option
diff_in_s assumes every mmonth is 30 days?
and evry year is 365 days
I could make a function for that but the purpose of add_zero was to make dates and military time stuff look normal. Instead of 0:1 or 1-3-2025 when printing it would be 00:01 or 01-03-2025
the class Helper has a terrible name
I am still human man
why would you need to get the difference in seconds if it's not accurate?
just convert to unix timestamp and substract
Didnt you say something about ollama?
I'd rather not put that function than to put a broken one
right but I still had to vibe-check what it returned
sounds like more work than just writing it yourself but sure
maybe the Helper class could have a thread pool? rather than just one thread?
VirtualPath not supporting utf8 is a bit useless
As far as I know ollama (especially 1.1) is considered the worst LLM
No i mean its just less fun and more work to use ai to write like 10line functions at most?
isnt ollama the tool? i dont know all the buzzwords so dont quote me tho
Ollama is like chatgpt but has the iq of a banana
https://github.com/ZiggityZaza/CeggsyLib/blob/f3dd73e393e31134361d08cca95af698d0e997d8/cslib.h%2B%2B#L676
don't use backslash on linux
Then why are you using it
I'm a sadist and hate myself
as you are sad or take sedatives
sedatives? What's that? (I genuinely don't know that term)
@granite stag has reached level 3. GG!
std::filesystem is very chunky and not very documented, so this class is a smaller wrapper around it. Memory efficiency is clearly favored over speed.
what do you mean not very documented? have you checked cppreference?
also not sure what you mean by memory efficiency
oh not at all. I just, you know, feel like hurting myself.
https://github.com/ZiggityZaza/CeggsyLib/blob/f3dd73e393e31134361d08cca95af698d0e997d8/cslib.h%2B%2B#L813
string copy
things that make you sleep way better
and are mildly pleasant
isn't like wide strings much more chunky than 1 byte strings? thats why I used it
well, quite abit pleasant
Yeah then dont use ai
I don't get your point
https://github.com/ZiggityZaza/CeggsyLib/blob/f3dd73e393e31134361d08cca95af698d0e997d8/cslib.h%2B%2B#L834
it's better to preallocate the buffer
In Folder and File class, large filesystems etc could get massive. I thought that every byte counts so why not use 1 byte strings instead of wstrings
why not std::filesystem::path?
you dont load the entire filesystem
slightly higher memory usage
like lazy loading?
your lib is optimized around memory?
i mean, filesystem uses a table sortof thing, and its entirety is not loaded when you e. g. boot your pc up
It would be once im done but right now, but I am just worried that a simple Folder class instance could take too much memory
https://github.com/ZiggityZaza/CeggsyLib/blob/f3dd73e393e31134361d08cca95af698d0e997d8/cslib.h%2B%2B#L972
you don't have a headerFileName, also not sure why this would be a c++ function
in a "general purpose" lib
https://github.com/ZiggityZaza/CeggsyLib/blob/f3dd73e393e31134361d08cca95af698d0e997d8/cslib.h%2B%2B#L1224
linux only?
https://github.com/ZiggityZaza/CeggsyLib/blob/f3dd73e393e31134361d08cca95af698d0e997d8/cslib.h%2B%2B#L1346
tbh it just doesn't make sense to have that in a general purpose utility library
also not sure why TinySTL is there or why it would be in the same lib
you're already including std::string, std::vector and std::optional, what's the point of having a second impl there?
yeah I have a linux project which compresses stuff everyday at 3 am and I felt like I could add that to my project. also I couldn't find lrzip on windows without wsl
then use a different compression lib
I needed it few times
or build form source
make a second repo for it
I'll do that once I have a proper library. At that time I just felt like experimenting with memory and etc
the problem is that once you start using external dependency, you kinda need a build system
its inhumanly slow but execellent compression which is my very goal
don't use LLMs