/dpt/ daily programming thread - /g/ (#106162162) [Archived: 31 hours ago]

Anonymous
8/6/2025, 3:24:08 PM No.106162162
1754432746673166_thumb.jpg
1754432746673166_thumb.jpg
md5: 70ec69b3f3cf6cb4177645e3f733ef11🔍
previous: >>/106145572/

what are you working on /g/?
Replies: >>106162254 >>106174447 >>106176734
Anonymous
8/6/2025, 3:35:17 PM No.106162254
>>106162162 (OP)
>>/106145572/
I mean, >>106145572
Anonymous
8/6/2025, 3:39:50 PM No.106162296
Screenshot From 2025-08-06 09-37-53
Screenshot From 2025-08-06 09-37-53
md5: 49055a7f06a2e87558fb50d1ba400ae5🔍
>SPIR-V extension that lets you hover stuff and get info about it
Damn this is great
Replies: >>106162765
Anonymous
8/6/2025, 3:41:10 PM No.106162312
Working on getting better. Went to the hospital and got tested for meningitis. I have lyme disease. Can't sit up and use a computer so can't work on my graphics/game framework
Replies: >>106162336
Anonymous
8/6/2025, 3:44:12 PM No.106162336
LDD-desk-lying-with-chair-0-8e88
LDD-desk-lying-with-chair-0-8e88
md5: ea94a03f455c56c79c1857d4e0a62f70🔍
>>106162312
>Can't sit up and use a computer
It's time to get creative.
Anonymous
8/6/2025, 4:35:15 PM No.106162765
>>106162296
Are you writing a shader compiler?
Replies: >>106162949
Anonymous
8/6/2025, 4:51:23 PM No.106162949
>>106162765
Not right now though I'd like to at some point. I'm just doing reflection/analysis and injecting instrumentation code.
Anonymous
8/6/2025, 6:12:04 PM No.106163928
I created an anonymous community. Would you like to come and check it out?

https://anion15.github.io
Replies: >>106163971 >>106166059 >>106166297
Anonymous
8/6/2025, 6:15:33 PM No.106163971
>>106163928
I don't speak kimchi, but why the fuck is there no scrollbar?
Anonymous
8/6/2025, 7:46:48 PM No.106164893
how do you use cmake properly when you are placing code in subdirectories just for organizations sake? The files in those subdirectories may still need to access headers and stuff from higher up the hierarchy but I don't want to clutter the root folder

CMakeLists.txt
main.cpp
Items/
--Type1/
----file.h
--Type2/
----file.h
----file.cpp

I think the right way to do it is put a CMakeLists.txt in each directory, the 'Items' one will just add_subdirectory(), and then the ones inside those subdirectories will do
target_include_directories(root_target PUBLIC file.h)
target_sources(root_target PUBLIC file.cpp)

the other option is I guess just using the headers as Items/Type1/file.h and adding the source files to the root cmake the same way, but that just seems really dumb
Replies: >>106166198
Anonymous
8/6/2025, 9:22:55 PM No.106166059
1728814908695274
1728814908695274
md5: ce3691adde2ede523e65fcf7f9952256🔍
>>106163928
No thanks Mr. IP collector.
Replies: >>106166234 >>106166297
Anonymous
8/6/2025, 9:35:14 PM No.106166198
>>106164893
>I think the right way to do it is put a CMakeLists.txt in each directory, the 'Items' one will just add_subdirectory(), and then the ones inside those subdirectories will do
i think? that should be the right way to do it but it is still very common to see even well made projects just slam all the includes and source files for a target into big lists in whatever cmake file it's declared in
Replies: >>106166241
Anonymous
8/6/2025, 9:37:56 PM No.106166234
78odc9
78odc9
md5: 1441369aebcc37d5ab759c1ca7a94f85🔍
>>106166059
are .github.io domains not hosted by github? I always assumed only github could see you
Replies: >>106167158
Anonymous
8/6/2025, 9:38:26 PM No.106166241
>>106166198
how do they manage that for something like a game where there are thousands of source files?
Replies: >>106166365
Anonymous
8/6/2025, 9:42:54 PM No.106166297
>>106163928
>>106166059
>Browsers that are not allowed.
>Please connect to Chrome, Edge, and Safari.
I think this might be some sort of art project in pissing off /g/. If I had a chromium browser installed I would check out what it complains about with that.
Anonymous
8/6/2025, 9:50:41 PM No.106166365
>>106166241
i've seen it done by generating the cmake files with a script or even another cmake file
probably possible to hook that up to trigger whenever new files are added to the repo

sometimes just by using the deprecated cmake glob function iirc despite the fact that it was deprecated because that's what people were mostly using it for and doing that would cause problems with cmake's ability to tell when a file needed to be rebuilt

sometimes manually
i can't remember what but there was some huge project i wanted to modify and it would actually check to see if files were properly added to all the lists they were supposed to be in and would error if there was something new in certain parts of the source tree at all, even if it wasn't being built
pretty sure there was a warning about not generating the lists via tooling either
Anonymous
8/6/2025, 10:01:11 PM No.106166472
>procrastinated again
i will not live long enough to see myself become an accomplished developer
Anonymous
8/6/2025, 10:06:30 PM No.106166529
>third day doing Angela Yu's python course
>it's a little adventure made with if/elif/else
Fuck, I could only think of Yandere Dev's code
Replies: >>106166581 >>106167215
Anonymous
8/6/2025, 10:10:14 PM No.106166581
>>106166529
>Angela Yu's python course
sell me on this, why this one over any free resource?
Replies: >>106166816
Anonymous
8/6/2025, 10:34:59 PM No.106166816
>>106166581
In my case:
>I'm retarded, so the course being separated into days helps me pace it nicely
>she teaches you something and then tells you to make something with it
first day was about springs, print and inputs, so she teaches you that and then asks you to make a "Band Name generator", that is just
>name of the city you grew up in
>name of your pet
>"city name " + "pet name" for the band name

Second day is about data types and math operators and she asks you to make a BMI calculator and a bill/tip calculator for the final project of the day
>how much did it cost
>how much do you want to tip (%)
>how many people are paying
>final result should be how much each person should pay

Third day is about if/elif/else and she asks you to make a pizza bill calculator, BMI checker, and the little adventure as the final project for the day
>you're at a crossroads. Type "left" or "right" to continue.
>choosing right gives you a "game over" response while "left" proceeds the game where you have more options to choose
>and so on

I'm a complete beginner and I've tried a few other resources, but this one is the best I have tried
Replies: >>106167033 >>106167242
Anonymous
8/6/2025, 10:54:13 PM No.106167033
>>106166816
also, very important
>cute asian milf with british accent
Keeps the brain and the dick working
Replies: >>106167242
Anonymous
8/6/2025, 11:07:19 PM No.106167158
>>106166234
>Host site on github.io
>Have it ping your AWS server clientside
Pretty straightforward.
Anonymous
8/6/2025, 11:11:54 PM No.106167215
>>106166529
>Angela Yu's python course
the one you want to fuck in the ass?

https://www.youtube.com/watch?v=i3-PQ4CkU8s
>Dr. Angela Yu
what
Anonymous
8/6/2025, 11:13:43 PM No.106167242
>>106167033
>>106166816
understandable, good luck anon
Anonymous
8/6/2025, 11:36:38 PM No.106167473
Currently going through King's C Modern Approach book. I tried Effective C and Modern C and maybe I'm retarded but I wasn't a fan of how they were structured.
Anonymous
8/7/2025, 12:21:47 AM No.106167916
Getting filtered by K & R again on 1-12 and 1-13 despite solving them once already. I deleted my code and waited a week to try again and they were just as hard the first time. I hate being retarded
Replies: >>106168372
Anonymous
8/7/2025, 1:07:33 AM No.106168372
>>106167916
you're losing your time with these useless exercises. you're better off with writing libraries with the IO and string functions that you need.
Replies: >>106168451
Anonymous
8/7/2025, 1:15:08 AM No.106168451
>>106168372
How do I know what libraries I need? Should I just copy an existing one?
Replies: >>106169156 >>106169156
Anonymous
8/7/2025, 2:19:58 AM No.106169156
>>106168451
>>106168451
If you have a particular task processing task in mind and you know how to do it in python or whatever, you should know what you need.
But, string processing tasks are generally more complex than is seems and generally require a whole slew of functions for manipulating strings, array/vectors, hash tables, and all that has to be memory managed, and there is also string/number conversion and regexes. Don't think you need to master string processing in C in order to go forward.
>Should I just copy an existing one?
You should look at several, try to see what functions they implement (their names should be enough is the library is well made), how their data structures are structured (which fields in the structs), how they are initialized and memory managed, how are the "physical" function arguments and return are used to pass the logical input, return the logical output and eventual error, if there is a kind of global "context" passed around.
Anonymous
8/7/2025, 3:06:01 AM No.106169599
i'm kinda proud of this little command ngl
grep -xFf <(sed 's/ian$/e/;t;d' < /usr/share/dict/words) /usr/share/dict/words
Anonymous
8/7/2025, 3:19:19 AM No.106169732
One of the cool things about Haskell is that it teaches you that 80% of programming concepts are irrelevant. No need for classes, objects, or all these abstractions. Just chain together functions, pass the inputs from one into the other, and have a well designed, expressive type system that prevents bugs from happening. It's poetry.
Replies: >>106169744 >>106169868 >>106169872
Anonymous
8/7/2025, 3:20:20 AM No.106169744
>>106169732
>inputs
ack, I meant outputs
Anonymous
8/7/2025, 3:31:17 AM No.106169868
>>106169732
one of the cool things leaving your basement teaches you is that many supposedly "core" concepts in programming really only matter if you intend your code to be read by other people.
Replies: >>106169893
Anonymous
8/7/2025, 3:31:51 AM No.106169872
>>106169732
functional programming shits the bed as soon as you need state
Replies: >>106169893 >>106170072
Anonymous
8/7/2025, 3:34:29 AM No.106169893
>>106169868
>filtered
>>106169872
>can't into monads
It's okay anons. Lots of people aren't smart enough to "get it"
Replies: >>106169939 >>106170009
Anonymous
8/7/2025, 3:41:08 AM No.106169939
>>106169893
I'd tried saying ">filtered" to my boss and now he's scheduled a meeting for friday afternoon.
Anonymous
8/7/2025, 3:49:43 AM No.106170009
>>106169893
something as trivial and fundamental as state should not require being smart
it's evidence of failure of the whole functard paradigm
Anonymous
8/7/2025, 3:58:27 AM No.106170072
>>106169872
s -> (a, s)
Replies: >>106173034
Anonymous
8/7/2025, 4:46:43 AM No.106170559
CS undergrad writes a Hello World in Haskell and thinks he knows more than 99% of computer scientists who ever lived, many such cases.
Anonymous
8/7/2025, 4:54:31 AM No.106170627
a
a
md5: 7e2e4bac7d69dac200fb4be9046e33b1🔍
Yes.
Anonymous
8/7/2025, 6:44:33 AM No.106171498
Why do trading firms like fp langs like haskell and ocaml? Aren't these languages slow for low latency applications?
Replies: >>106171687 >>106173102 >>106173795 >>106174463
Anonymous
8/7/2025, 7:11:41 AM No.106171687
>>106171498
i've heard erlang specifically is frequently used because of how easy massively scalable parallelism is in it
and i assume they'd want to use pure functional langs, because iirc they're provably correct, or at least a subset of them are
which means they're able to do what rust pretends it can and guarantee code is bug free because math (and not some borrow checker with arbitrary rules that only cover 1 type of bug)
when basic logic errors might result in billions of losses program correctness seems like it'd be a priority
Replies: >>106173773
Anonymous
8/7/2025, 7:53:35 AM No.106171917
1754528751595628_thumb.jpg
1754528751595628_thumb.jpg
md5: 95de0468fd0530d7052aa037bb41e2ac🔍
Fellow /o/tist used my track editor application to make a volcano.
Anonymous
8/7/2025, 11:04:29 AM No.106173034
>>106170072
the point of state is that it's just there in its context and not juggled as another parameter
Replies: >>106177877
Anonymous
8/7/2025, 11:14:16 AM No.106173102
>>106171498
It's a midwit filter, these firms pride themselves on being filled with lvy league dropouts with exceptionally high IQs
Anonymous
8/7/2025, 12:53:55 PM No.106173719
I'm making a telegram content/channel manager application. How should I handle editing content when it's already been posted to several channels?
Messages and albums can be edited, but some content types like polls can't.
How do I handle this? I've been mulling over this on and off for months and it's safe to say I have complete analysis paralysis.
Replies: >>106174044
Anonymous
8/7/2025, 1:00:28 PM No.106173773
>>106171687
Neither Rust nor Haskell nor Ocaml nor any language can guarantee that it is bug free without proper formal verification. They only guarantee things like memory safety in their own ways(eg by static analysis like borrow checking or by banning raw memory manipulation altogether)
Replies: >>106174463
Anonymous
8/7/2025, 1:04:41 PM No.106173795
>>106171498
>Aren't these languages slow for low latency applications?
The high frequency trading firms where latency matters make their own hardware or use FPGAs.
If they are using haskell or ocaml then latency must not matter that much for them and it's probably what mathematician programmers are more comfortable with.
Anonymous
8/7/2025, 1:31:35 PM No.106173948
How do you stop yourself from getting lost in the weeds? I always seem to go
>Alright, let's get started on this basic function.
>... oh but in future it will need to call this function, better get started on the basic logic so all I'll need to do is set up the function when I need it
>... actually, I might as well complete that function now that I am thinking about it
Rinse and repeat. Do I just bite the "I will need to refactor in the future" bullet?
Replies: >>106174006 >>106174026
Anonymous
8/7/2025, 1:41:04 PM No.106174006
>>106173948
Small, meaningful milestones.
Yes, you can refactor things later.
Anonymous
8/7/2025, 1:43:38 PM No.106174026
>>106173948
It's so much easier make working code better than it is to make broken code work. Focus on making one thing work at a time, no matter how poorly.
Anonymous
8/7/2025, 1:48:40 PM No.106174044
>>106173719
>How should I handle editing content when it's already been posted to several channels?
Match your content to the telegram message IDs that contain it and update the messages via edit APIs.
>Messages and albums can be edited, but some content types like polls can't.
Assign a type to your content and don't show an edit option for non-editable content.
I wouldn't recommend doing things differently from the service you are using, because you confuse the users with your workarounds.
Replies: >>106174152
Anonymous
8/7/2025, 2:08:29 PM No.106174152
>>106174044
I'm not making it for users, at least for now. It's going to be and another guy managing the channels, so I'm not really concerned about user friendliness or workarounds. I just want to understand what is the proper way of handling content, and not really just on Telegram, but that's what I want to start with.
Let's say I have a content object with a picture and some text, and it's already posted in some channels.
I want to edit the content by deleting the picture. How should it be handled in the channels?
The only solution I can think of is to delete the existing post (can't delete files from messages) and post the content again, but in this case I don't know how to handle the post objects.
Do I mark the old post as "deleted" and post a new one or do I reuse an existing posting the content again via the Telegram API and updating the post's internal telegram message ID?
If I go the atomic post route, I would then need some kind of content snapshot functionality in place so the deleted old post would point to the old version of the content where it still has the picture, right?
If I reuse posts and the content has already been posted several times in the channel, I assume I'd need to delete all but the last and repost it with the updated content without the picture.
Or is there some other way to handle all this?
Replies: >>106174438
Anonymous
8/7/2025, 2:43:32 PM No.106174438
>>106174152
>what is the proper way of handling content, and not really just on Telegram,
You should build content handler (content file pipeline convert/modify/etc., models, events, storage) + publisher APIs and like I said earlier: assign types/categories to your content e.g. image with caption, text, voice
>How should it be handled in the channels?
Treat each social media as an implementation/plug-in of the content publisher API and send events to those implementations.
>I want to edit the content by deleting the picture. How should it be handled in the channels?
This is a good example. First, the content type is "image with caption" which is then converted to "text".
Send the change change_type event to the publishers with the id and new content. The telegram publisher impl could then complain that you can replace, but not remove the file. You can then have the impl provide solutions e.g. "use blank image", "delete old & publish new msg"
By the way, you can do whatever you want in the publisher impls that the service allows. e.g. the telegram publisher impl could handle "image with caption" content by sending two messages: an image, and a text reply => then you can delete the image without the post or replace the image with something generic.
>Or is there some other way to handle all this?
There are just several hundred ways of doing this. It all depends on you, your content, and your audience. For example, it's more socially acceptable to publish errata than go back and edit in-place in a lot of fields.
Since you plan on supporting multiple social media, find the common denominator of functionality and build on that.
Replies: >>106174663
Anonymous
8/7/2025, 2:44:55 PM No.106174447
>>106162162 (OP)
Less programming, more gooning to AI
Anonymous
8/7/2025, 2:46:36 PM No.106174463
>>106171498
You are limited by light and regulations. Correctness is more important than latency
>>106173773
Haskelll makes it trivial to do a formal verification as the code is just math.
Replies: >>106174485
Anonymous
8/7/2025, 2:49:36 PM No.106174485
>>106174463
Every code is "just math" and no turing complete language is trivial to do formal verification. You have to write code in specific way to allow yourself to formally verify, even if you use Haskell.
Replies: >>106174494
Anonymous
8/7/2025, 2:51:26 PM No.106174494
>>106174485
And haskell makes that code trivial.
Replies: >>106174500
Anonymous
8/7/2025, 2:51:58 PM No.106174500
>>106174494
You have no idea what you are talking about.
Replies: >>106174516
Anonymous
8/7/2025, 2:53:41 PM No.106174516
>>106174500
Spotted the cnile babyduck. Just because your entire OS is built around C doesn't mean C is inherently easy. It's just exploiting your monkey brain.
Replies: >>106174543
Anonymous
8/7/2025, 2:57:05 PM No.106174543
>>106174516
>implying cniles care about formal verification
Rent free
Anonymous
8/7/2025, 3:14:27 PM No.106174663
>>106174438
Thanks for the reply. The technical implementation is simple enough.
The thing is, I don't know what I need and don't know where to look for info. The big AIs have been pretty unhelpful.
I'm struggling with business logic, like the dilemma of how to handle post objects when the content is edited.
I also plan on running paid scheduled ad posts. Do I need to have a blockchain-like trail of all the posts in a channel to track everything? Do I need to track content changes as snapshots?
Anonymous
8/7/2025, 6:17:07 PM No.106176734
>>106162162 (OP)
>what are you working on
Contemplating running my own mail server? What do you guys use? I know nothing about email servers and fear it'll become a vulnerability.
Replies: >>106176806
Anonymous
8/7/2025, 6:23:27 PM No.106176806
>>106176734
I think it is a pretty bad idea to self host email for personal use.
The moment you forget to pay for your domain or just abandon it, all your accounts created with it can become a hostage. There has already been a case of supply chain attack done in this way IIRC.
Replies: >>106177394
Anonymous
8/7/2025, 7:01:45 PM No.106177394
>>106176806
What are the alternatives? I want something with my domain name to appear authentic, but I don't have/don't want to spend so much cash just for few email addresses (support, billing, feedback)
Replies: >>106177645
Anonymous
8/7/2025, 7:04:52 PM No.106177484
>windows api
>10 different string types
>global state everywhere
man. this is so gay.
Anonymous
8/7/2025, 7:09:56 PM No.106177645
>>106177394
If it's just your contact email or for the business then I think it's fine.
I would just not tie important accounts to personal domain, unless you are certain you will never lose it.
Anonymous
8/7/2025, 7:16:45 PM No.106177877
>>106173034
>it's so easy to access and modify from anywhere
>why is my code a dysfunctional spaghetti mess
Anonymous
8/7/2025, 7:23:56 PM No.106178090
>fourth day doing Angela Yu's python course
>randomisation and lists
jesus christ, probably the first time I got lost

>making a rock, paper, and scissors game
>grab the user's input
>how the fuck do I make this grab the list info
I forgot that I can use
list[user_input]
Anonymous
8/7/2025, 8:33:20 PM No.106180068
>yet another cmake tutorial
Uh cripples sisters? I thought we didn't have our own version of monads? Libraries are just a side effect anyway
Anonymous
8/7/2025, 9:19:36 PM No.106180785
Screenshot From 2025-08-07 15-13-45
Screenshot From 2025-08-07 15-13-45
md5: 05da8271b1f55eff43591f3347b8fa86🔍
What happened to threads 2-15
I set the printf buffer to 10KiB so it should be good
Anonymous
8/7/2025, 9:28:05 PM No.106180906
Screenshot From 2025-08-07 15-24-17
Screenshot From 2025-08-07 15-24-17
md5: 0953d11f608cc737df71c40a17e987b8🔍
I guess this shit is bugged because setting it in the environment variables worked (but not VK_PRINTF_BUFFER_SIZE for some reason). Shit completely ignores it when I try to do it through the VK_EXT_layer_settings.
Motherfucking lying WHORES.