← Home ← Back to /g/

Thread 105764133

345 posts 110 images /g/
Anonymous No.105764133 [Report] >>105765219 >>105768034 >>105768546 >>105769066 >>105769356 >>105795925
/dpt/ - Daily Programming Thread
What are you working on, /g/?

Previous thread: >>105724992
Anonymous No.105764157 [Report] >>105764280 >>105770056 >>105777344
Threadly reminder.
Anonymous No.105764280 [Report]
>>105764157
I'll agree with your bait because I'm too lazy to properly learn the other two.
Anonymous No.105764310 [Report] >>105765168
>>105764139
you're moving goalposts. edit history and change tracking is not the same functionality as version control (which is also well integrated into my IDE, btw)
Anonymous No.105765168 [Report] >>105765446
>>105764310
>I'm too low IQ to use git directly.
Okay, I'll bite on this bait and WILL move the goalpost: you are too retarded to have any discussion and therefore I win by default.
Anonymous No.105765219 [Report] >>105765297 >>105765413 >>105765552 >>105774321
>>105764133 (OP)
It's nothing programming related this time but I'm finishing my book about topology and manifolds. I've been writing it since 2023 and It's finally getting ready.

I write it using LaTeX + vscode + git. Diagrams are made using mathcha.io
Anonymous No.105765297 [Report]
>>105765219
Congrats, your post has made me sleepy.
Anonymous No.105765413 [Report] >>105768647
>>105765219
I've been transcribing all my loose notes into my new journal during the heat
Anonymous No.105765446 [Report]
>>105765168
>no argument
>ad hominem
concession accepted
no reply required
Anonymous No.105765537 [Report] >>105765562 >>105765565 >>105765737 >>105774404
I'm writing a trading agent and people and slopbots talk about "State pattern". My finite state machine works, but it is based on trasition objects which have to and from states, condition to transit and action to take when transitioning.

Each agent has that list created when it is instantiated.

Apparently it violates the "open closed" principle, and "separation of concerns", but it's pretty much a 1:1 mapping of what a FSM is.

I am getting filtered by this Design pattern stuff.
Anonymous No.105765552 [Report]
>>105765219
Link?:
Anonymous No.105765562 [Report]
>>105765537
I think you should detransition before it's too late.
Anonymous No.105765565 [Report] >>105765589
>>105765537
>I'm writing a trading agent
Yeah, I figured that's what you meant when you wanted to make sure your program doesn't crash.
Anonymous No.105765589 [Report] >>105765608
>>105765565
Currently I only do back-testing with it. Its not connected to anything. Do you mean "state pattern" has a tendency to crash?
Anonymous No.105765608 [Report] >>105765616
>>105765589
Aren't you the guy from a couple threads ago who wanted to know in which language he should write a program that wasn't allowed to crash, lest you lost a lot of money?
Anonymous No.105765616 [Report] >>105765737
>>105765608
Not really. I am writing it in common lisp, R and python. Most of the logic is in CL.
Anonymous No.105765737 [Report] >>105765793 >>105765894
>>105765537
>>105765616
(letrec ((s0 (lambda (t)
(case t
('end 'accept)
(0 s0)
(1 s1))))
(s1 (lambda (t)
(case t
('end 'reject)
(0 s2)
(1 s0))))
(s2 (lambda (t)
(case t
('end 'reject)
(0 s1)
(1 s2)))))
...)
Anonymous No.105765793 [Report] >>105765834
>>105765737
yeah, literally this but more complex. Apparently this is not "clean"?
Anonymous No.105765834 [Report] >>105765894 >>105765899
>>105765793
If letrec contains no side effects and s0 is returned as a start state I can't imagine how it could be better encapsulated
Anonymous No.105765894 [Report] >>105765899 >>105766149
>>105765834
>>105765737
I'm referring to design patterns, some people have commented my code is not "clean".
I don't work professionally, so I don't know what that means or why I need to use "patterns".
I've removed the error handlers, and a lot of other things that make it work the way I want:

(defclass event ()
((message :accessor message :initform nil :initarg :message)
(timestamp :accessor timestamp :initform nil :initarg :timestamp)))
;;; Base agent class, must be subclassed
(defclass fsm ()
((state-history :initform nil
:initarg :state-history
:accessor state-history)
(transitions :initform nil
:initarg :transitions
:accessor transitions)
(current-state :initform nil
:initarg :current-state
:accessor current-state)))

(defclass transition ()
((from-state :accessor from-state :initform nil :initarg :from-state)
(to-state :accessor to-state :initform nil :initarg :to-state)
(action :accessor action :initform (lambda () nil) :initarg :action)
(allowed? :accessor allowed? :initform (lambda () nil) :initarg :allowed?)))

(defmethod update ((fsm fsm))
(with-slots (current-state state-history transitions) fsm
(let* ((transition
(loop for tr in transitions
when (and (equal (from-state tr) current-state)
(funcall (allowed? tr)))
return tr)))
(if transition
(progn
(with-slots (action to-state) transition
(funcall action)
(push to-state (state-history fsm))
(setf (current-state fsm) to-state)))
(error 'no-valid-transition)))))

(defmethod consume ((fsm fsm) (event event))
(when (observe? fsm event)
(sense fsm event)
(update fsm)))
Anonymous No.105765899 [Report] >>105767358
>>105765894
>>105765834
>don't use objects or OO
My life is 100% easier with CLOS than juggling lists around for the things I'm doing.
Anonymous No.105766149 [Report] >>105766170
>>105765894
>some people have commented my code is not "clean".
ask them to point out what specifically is not clean
>why I need to use "patterns".
patterns are tried solutions to common problems, if the problem you're having fits exactly to what the pattern fixes
if someone tells you to shoehorn a design pattern when it doesn't make sense for the case, call him a fag and stop listening

not a lispfag so I read your code after copilot translated it to java (good morning sirs) and I don't see anything egregious about the solution
only thing you could possibly change (evaluate yourself if it's worth it) is to add the list of valid transitions to each state object
so you would have:
>state contains its name and a list of valid transitions from itself
>transition contains the target state and transition action
>fsm gets transitions from its current state value rather than a separate parameter, and executes the action for each transition
that way you don't need the extra condition to check if a transition applies to the current state - if the state has it, it is applicable
Anonymous No.105766170 [Report]
>>105766149
thank you sir
Anonymous No.105766723 [Report] >>105766930 >>105768647
revived and significantly reworked my old 4chan client
added theme support and text formatting to quotes and links
changed all network requests to my newer async download pool implementation
Anonymous No.105766930 [Report] >>105767033
>>105766723
Is it a clover/kuroba fork? Can I have it?
Anonymous No.105767033 [Report]
>>105766930
no, it's my own and very incomplete
Anonymous No.105767358 [Report] >>105767492 >>105767508 >>105768204
>>105765899
>My life is 100% easier
you mean 100% slower because every token is an allocation
Anonymous No.105767492 [Report] >>105767508
>>105767358
Good thing I don't care.
Anonymous No.105767508 [Report]
>>105767492
Based.
>>105767358
Cringe.
Anonymous No.105768034 [Report] >>105768063 >>105768080
>>105764133 (OP)
Spoonfeed me an adequate python introduction for two digit IQ people, I've come to accept that i need to know at least one household programming language to automate stupid shit and juggle text. Don't really care for a format, but will appreciate if it comes with practical excercises/git repo with examples. Thanks in advance.
Anonymous No.105768063 [Report]
>>105768034
Just do Perl.
Anonymous No.105768080 [Report] >>105768100
>>105768034
Learn awk if all you need is to juggle text.
Anonymous No.105768100 [Report] >>105768110 >>105768121
>>105768080
i want to interface with databases too, also it seems like having access to gajillion of napkin written python scripts and libraries will come in handy.
Anonymous No.105768110 [Report]
>>105768100
>i want to interface with databases too
https://metacpan.org/pod/DBI
Anonymous No.105768121 [Report] >>105768128 >>105768214
>>105768100
Usecase for databases?
Anonymous No.105768128 [Report] >>105768214 >>105768263
>>105768121
Storing data.
Anonymous No.105768204 [Report]
>>105767358
what are you on about
Anonymous No.105768214 [Report] >>105768263
>>105768121
this >>105768128 and querying is nicer than parsing dzhigabouht single string jsons.
Anonymous No.105768263 [Report] >>105768392
>>105768128
>>105768214
I have no use for data or "querying" it.
Anonymous No.105768288 [Report] >>105768329
How do I properly architect internals of a library that implements the parsing and the logic for a network protocol (that runs on top of TCP+TLS)? I don't want to end up with some kind of spaghetti code where I have I/O, parsing and logic all mashed together in functions. Any architectural patterns that could help?
Anonymous No.105768329 [Report]
>>105768288
design it all to work online with interfaces and shit? like how theres SAX for xml
Anonymous No.105768392 [Report]
>>105768263
Not a (me) problem.
Anonymous No.105768546 [Report] >>105768583 >>105768605 >>105768802
>>105764133 (OP)
I've been relearning C++ having taken a break from it for about 10 years, been reading bjarnes principles book about it, do people irl actually use C++ modules for projects? it gets shilled heavily as the next big thing in the book, but for anything other than large projects it seems like such a pain to set up compared to just using #include <thing>
Anonymous No.105768583 [Report] >>105768628 >>105768670
>>105768546
>modules
not real
Anonymous No.105768605 [Report] >>105768647 >>105768670
>>105768546
>falling for danish tricks again
Anonymous No.105768628 [Report]
>>105768583
this
show me a compiled module
you can't
Anonymous No.105768647 [Report] >>105768791
>>105768605
>drawn chimera penis
>>105766723
>>105765413
>scantly clad cartoon girls
Fuck you "people". You should be banned from posting images.
Anonymous No.105768670 [Report] >>105768823
>>105768583
>>105768605
so no, thanks lads I can continue to be old and stuck in my ways
Anonymous No.105768791 [Report] >>105768836 >>105770101
>>105768647
Oh my fucking goodness, you fucking autistic crybaby.
I hope you meet the chainsaw that was the source of this addition.
Anonymous No.105768802 [Report]
>>105768546
They are good in theory, but they're still not widely supported, and they kill parallel builds.
Anonymous No.105768823 [Report]
>>105768670
>I can continue to be old and stuck in my ways
The true c/c++ way. If it works, it works.
Anonymous No.105768836 [Report]
>>105768791
For once you made a good, funny post, well done registryschizo.
Anonymous No.105769016 [Report]
>autist with no discernable skills or charisma has an opinion about humor
Anonymous No.105769066 [Report] >>105769090
>>105764133 (OP)
Given golang's background, one would assume it is a breeze to install it on *nix, but no.
Even microsoft has apt repos for vs code, dotnet, and azure..
Golang? Extract this file to /usr/local/go, saar!
uninstall? remove /usr/local/go
multiple versions?
go install golang.org/dl/go1.10.7@latest
go.1.10.7 {args}
Anonymous No.105769090 [Report] >>105769149
>>105769066
Looks like you couldn't follow the guide.
Anonymous No.105769149 [Report] >>105769171
>>105769090
Why are you rood? Is asking for a unified means of package installation too much these days?
Is it a lost cause now? much like the rape my $HOME is enduring in these troubled times with all the dot folders?
Anonymous No.105769171 [Report]
>>105769149
Install Gentoo.
Anonymous No.105769356 [Report] >>105769868 >>105776780
>>105764133 (OP)
C# isn't a programming language.
Anonymous No.105769868 [Report]
>>105769356
Anonymous No.105770056 [Report] >>105772478
>>105764157
Rust is awesome stop hating
Anonymous No.105770101 [Report] >>105770161 >>105770262 >>105770711
>>105768791
Bjarne is possibly the most chaddest programmer alive after John Carmack
Anonymous No.105770161 [Report]
>>105770101
Indeed, he has done so much for C programming language, much more than C++ even.
Anonymous No.105770262 [Report]
>>105770101
Not to mention Carmack is a C++ expert
Anonymous No.105770711 [Report] >>105771015
>>105770101
getting your programming language stolen and fucked up by corpos, and being the general laughing stock of the CS / tech world for having the most fucked up language is one of the most cucked and anti-chad things.
bjarne coping with his
>two kinds of languages
meme, doesn't really change this
Anonymous No.105771015 [Report]
>>105770711
C++ was always slop, Bjarne wanted it to take Bell Labs and the world, and it took all corpos, so he got his wish.
Anonymous No.105771085 [Report] >>105771238 >>105771249 >>105771263
C++ is beautiful, elegant, a joy to both read and write.
Anonymous No.105771238 [Report]
>>105771085
This, but unironically.
Anonymous No.105771249 [Report] >>105771259
>>105771085
Had modules been priority 1 since its inception we wouldn't have template hell in headers regenerating and recompiling everything everywhere and Go wouldn't exist.
Anonymous No.105771259 [Report] >>105771368
>>105771249
Modules don't solve this.
Anonymous No.105771263 [Report]
>>105771085
Indeed, a treat for both the eyes and the fingers.
Anonymous No.105771368 [Report] >>105771405 >>105771415
>>105771259
The Header-Based Template Problem
Traditionally in C++, templates are defined in headers because the compiler needs to see the full implementation at the point of instantiation. But this means:

Every translation unit that includes that header re-parses and re-instantiates the template.

This leads to longer compile times and redundant code generation.

How C++ Modules Help
C++20 modules tackle this by offering a smarter, more efficient system:

One-time Parsing: When you import a module, the compiler uses a precompiled binary representation of it. So the compiler doesn’t have to re-parse and re-instantiate the template every time.

Template Instantiation in Modules:

If a template is defined in a module interface, it can still be instantiated by importing translation units—but only the instantiations that are actually needed.

If you define and explicitly instantiate templates inside the module implementation, those instantiations can be compiled once and reused across TUs—effectively hiding the implementation details.

Improved Encapsulation: Since implementation details (including templates) can be defined in the module’s private partition, they don’t leak across the entire codebase like headers do.

Gippity says otherwise, chud.
Anonymous No.105771386 [Report]
you don't need templates
Anonymous No.105771405 [Report] >>105772158
>>105771368
And I say that you created this hell by using templates everywhere even when you don't actually have to.
Anonymous No.105771415 [Report]
>>105771368
Don't fucking post ChatGPT spam here.
Anonymous No.105772158 [Report]
>>105771405
This. I never use templates. Shit fucking sucks.
Anonymous No.105772161 [Report] >>105772194
you will use templates
Anonymous No.105772194 [Report]
>>105772161
yeah they're pretty good when you're in a good language
Anonymous No.105772367 [Report]
you will use x headers
Anonymous No.105772383 [Report]
Modules never ever.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1300r0.pdf
Anonymous No.105772478 [Report] >>105772863
>>105770056
>hate
I don't hate Rust - it simply doesn't deserve that emotional investment. But C++ is a cancer upon the world.
Anonymous No.105772533 [Report] >>105773837
only imposters who can't actually program hate C++
Anonymous No.105772555 [Report]
Noted.
Anonymous No.105772671 [Report]
I don't do toy projects because a better use of my time would be doing some SaaS scam.
Am I working on a SaaS project? Also no.
Anonymous No.105772863 [Report] >>105780427
>>105772478
C++ is fine
Anonymous No.105772905 [Report] >>105780427
C++ is better than fine, it's grrreat
Anonymous No.105772920 [Report] >>105780416
Anonymous No.105773373 [Report] >>105773770
I have to test and debug Azure tables, but they keep freezing/taking too long to return a result. I'll assume the logic works and hope for the best
Anonymous No.105773770 [Report]
>>105773373
This is normal for windows servers.
Anonymous No.105773837 [Report]
>>105772533
My C++ code generates identical assembly to C. I only had to disable exceptions, rtti, and standard library (reminder: libc is just as shitty if not shittier that libc++, it's worthless and I disable it too). I use templates and classes, just works on my machine, nocoders will find a way to have a melty over that though.
Anonymous No.105773952 [Report] >>105773996 >>105780441
>My C++ code generates identical assembly to C
Whatever you say, incompetent autismo.
Anonymous No.105773964 [Report]
>I write bad C++ and it resulted in bad assmbly
>this is the fault of some swedish guy or whatever the fuck he is
Anonymous No.105773975 [Report]
>incompetent autismo moves goalposts
>as always
And that's why actual people want to see you reduced into a bloody pulp.
Anonymous No.105773996 [Report] >>105774009 >>105774013
>>105773952
when are you going to livestream your suicide? it must be painful being this retarded all the time.
Anonymous No.105774009 [Report]
>>105773996
Soon, it really is tiring being this retarded all the time.
Anonymous No.105774013 [Report]
>>105773996
But retards aren't aware of their retardation. What's peculiar however, is their subconscious is still intelligent enough to perform things like projection to keep their retarded part stress-free.
Anonymous No.105774048 [Report]
Sorry, I'm a psychopath, so I'd rather murder your entire family.
Anonymous No.105774124 [Report] >>105774139
I chuckle every time I remember that psychopath's definition has nothing to do with violence but is only a synonym for someone who's mentally ill.
Anonymous No.105774139 [Report]
>>105774124
psychotronic
Anonymous No.105774158 [Report] >>105774175
I'm not the originator of that label, so it's a nice self-own of your incompetent autismo ilk.
Anonymous No.105774175 [Report]
>>105774158
It's actually a perfect description of what you are.
Anonymous No.105774183 [Report] >>105774197 >>105774218 >>105774266
just fucking write in goddamn assembly and you won't have this fucking problem you goddamn retadrs
Anonymous No.105774197 [Report]
>>105774183
>reeeeeee is it moving or is it copying I just don't know better invent illegible syntax to try to figure it out
you would know immediately if you just WROTE ASSEMBLY
Anonymous No.105774205 [Report]
>incompetent autismos: you are X
>actual human being: OK
>incompetent autismos: actually you are not X
>actual human being: you said I was X
>incomeptent autismos: actually you are X
And that's why your entire genetic line up to five generations must be eradicated, to ensure that such genetic freaks never roam the earth again.
Anonymous No.105774218 [Report]
>>105774183
I already told you why assemblyshit is inadequate.
Anonymous No.105774266 [Report]
>>105774183
I was going to write assembly but then I got filtered by Intel's 16,000 page manual for modern processors
Anonymous No.105774318 [Report] >>105774332
Yeah, we (that is, normal human beings) noticed you were utterly confused by SFENCE.
Anonymous No.105774321 [Report]
>>105765219
Good job anon
Anonymous No.105774332 [Report]
>>105774318
I'm only confused by your incompetence.
The sfence is a red herring here. Lets talk about why your incompetence led you to try and do a memory copy.
Anonymous No.105774347 [Report]
>moving goalposts
Nope. Talk about SFENCE, or don't talk at all.
Anonymous No.105774350 [Report]
Sorry, but I don't copy memory, so sfence has no usecase...
Anonymous No.105774359 [Report] >>105774364
>incompetent autismo cannot follow the simplest of instructions, like "don't talk at all"
And that's why both your past and future are filled with beatings and week-long hospital stays.
Anonymous No.105774364 [Report]
>>105774359
You will never be a woman.
Anonymous No.105774377 [Report]
>they beat the chin out of you too
Grim.
Anonymous No.105774381 [Report]
My parent don't take me to the hospital after they beat me
Anonymous No.105774393 [Report]
>parent don't
We know, Ivan.
Anonymous No.105774404 [Report] >>105774453
>>105765537
>I am getting filtered by this Design pattern stuff
They were invented by a lead-poisoned boomer charlatan with the intent of simplifying the practice of coding enough that impoverished indians can do it, don't bother
Anonymous No.105774412 [Report]
My partner doesn't beat me before taking me to the hospital.
Anonymous No.105774435 [Report]
Damn. I knew autists had bad spatial awareness, but I didn't know it's so bad you regularly go to the hospital.
Anonymous No.105774453 [Report] >>105774486
>>105774404
uncle bob did not invent design patterns
design patterns are not intended to "simplify coding"
Anonymous No.105774486 [Report] >>105774717
>>105774453
my bad, a gang of four lead poisoned boomers came up with it to help indians write less clusterfucked java and then the other lead poisoned boomer you mentioned ran with it like crazy. i figured the abridged version would suffice for a casual reading audience
Anonymous No.105774717 [Report]
>>105774486
design patterns are older than java
uncle bob has nothing to do with design patterns

you should first get your facts straight instead of haphazardly shitting all over everything like an indian over a street
Anonymous No.105775406 [Report] >>105775442 >>105775469 >>105776053 >>105776591
ready to learn C++ once again? Sutter claims reflection will be a pivotal change to the language.
Anonymous No.105775442 [Report] >>105775774
>>105775406
The sad thing is that there WILL be retards who will bother to learn this nonsense, rather than simply boycotting C++ as it should've been for thirty years now.
Anonymous No.105775469 [Report] >>105775639
>>105775406
>We can provide a better implementation of make_integer_sequence
How is this better than:
template <typename T>
class integer_sequence {
T start;
T end;
T current;
};

?
Anonymous No.105775639 [Report] >>105775676
>>105775469
that's not an integer sequence.
https://en.cppreference.com/w/cpp/utility/integer_sequence.html
Anonymous No.105775676 [Report] >>105775707
>>105775639
Shut the fuck up retard. You literally CANNOT explain why every single value must be stored in memory instead of computed when needed.
Anonymous No.105775707 [Report]
>>105775676
lmao, brainlet spering out over things xe can't understand
Anonymous No.105775774 [Report] >>105775876 >>105775993
>>105775442
I WILL be one of them, and you WILL have to deal with my code. git gud.
Anonymous No.105775876 [Report] >>105776019
>>105775774
The last time someone told me to fix their code I told them "no". Their code remains shit, their users remain retards, and I remain happy.
Anonymous No.105775993 [Report] >>105776019
>>105775774
I simply won't use your code, faggot.
Anonymous No.105776019 [Report] >>105776037
>>105775876
>>105775993
I hope you don't consider a career programming in C++. you might be in for a surprise.
Anonymous No.105776037 [Report]
>>105776019
I don't consider codemonkery a career.
Anonymous No.105776053 [Report]
>>105775406
Can't wait for 2032 when people start upgrading to C++26
Anonymous No.105776070 [Report] >>105776160
Why would I want to work in a dump that uses C++? They might as well demand Python or PHP.
Anonymous No.105776160 [Report]
>>105776070
>dump that uses C++
That's a good way to describe Windows.
Anonymous No.105776591 [Report] >>105776754
>>105775406
Nah I'm good. I'm just going to keep writing C++11 with a few things I like such as the standard library threading stuff so I don't have to link pthreads.
Anonymous No.105776754 [Report]
>>105776591
Who's gonna tell him?
Anonymous No.105776780 [Report] >>105776794 >>105779922
>>105769356
what is it then?
Anonymous No.105776794 [Report] >>105777236 >>105781219
>>105776780
Scripting language.
Anonymous No.105777236 [Report]
>>105776794
scripting languages are programming languages you fucking retard.
Anonymous No.105777344 [Report]
>>105764157
Python btfos each and every languages. Cniles need not apply.
Anonymous No.105777444 [Report] >>105777501 >>105777884 >>105777928 >>105778089
Everyone who advocates for Python is incompetent and shouldn't be allowed to live.
https://medium.com/@mayurkoshti12/why-perl-is-faster-than-python-3b30f940a50c
Anonymous No.105777501 [Report]
>>105777444
>jeetcentral.com
opinion discarded
Anonymous No.105777542 [Report]
I mean, since when do incompetent autismos have any self-preservation instincts? They would happily jump into a chainsaw.
Anonymous No.105777884 [Report]
>>105777444
I advocate for python because it's quick and computer autism isn't my job, it's just makes my job quicker.
Seethe, ranjit.
Anonymous No.105777928 [Report]
>>105777444
being faster than the slowest isn't really something you should celebrate...
Anonymous No.105778089 [Report]
>>105777444
Honestly if ChatGPT says python is bad, maybe I should kneel...
Anonymous No.105778753 [Report] >>105778760
Wow. There's a bunch of goners in this thread.
Anonymous No.105778760 [Report]
>>105778753
*gooners
Anonymous No.105778794 [Report]
No.
Anonymous No.105779219 [Report] >>105779289 >>105779506
lol
Anonymous No.105779289 [Report]
>>105779219
based microshit
Anonymous No.105779506 [Report]
>>105779219
BASED! It absolutely MUST cost money to make money.
Anonymous No.105779922 [Report]
>>105776780
A miserable little pile of secrets
Anonymous No.105780416 [Report] >>105781271 >>105788725
>>105772920
Was the goal of the C version to be as unreadable as possible?
Anonymous No.105780427 [Report]
>>105772905
>>105772863
C++ is the best
Anonymous No.105780441 [Report] >>105780509
>>105773952
Yes I've seen this before

https://youtu.be/kdlIlIIHCz0?si=6Iavpj9WqvbqN24c&t=276

And this video is 10 years old
Anonymous No.105780509 [Report] >>105780517 >>105780603
>>105780441
Are you seriously expecting me to listen to someone with that accent? Fuck no. I got standards.
Anonymous No.105780517 [Report]
>>105780509
It's funny that you say so because that accent is amazing.
Your standards are absolute shit
Anonymous No.105780574 [Report] >>105780603
>that accent is amazing
Turd worlder detected, opinions discarded with prejudice.
Anonymous No.105780603 [Report]
>>105780574
>>105780509
I like it when he goes
>hmmmmm
Anonymous No.105780609 [Report]
No actual human being cares what you like.
Anonymous No.105780755 [Report]
Why can't you click on the post number to reply?
Anonymous No.105780790 [Report]
It filters autists. That alone makes it worth it.
Anonymous No.105780982 [Report] >>105781009
monad
Anonymous No.105781009 [Report]
>>105780982
Based
Anonymous No.105781083 [Report] >>105781099 >>105781145 >>105781237 >>105781485 >>105782469 >>105782537
look at what you're doing to rust developers

are you proud of yourselves?
Anonymous No.105781099 [Report]
>>105781083
holy shit its the it guy
Anonymous No.105781145 [Report]
>>105781083
>are you proud of yourselves?
Yes.

Yes, I am.
Anonymous No.105781219 [Report]
>>105776794
Now that you can run it without a .csproj file, it might replace Python as my goto scripting language.
Anonymous No.105781237 [Report]
>>105781083
Fearless, safe, blazingly fast
Anonymous No.105781271 [Report]
>>105780416
No, the goal was to prove that Cniles are incompetent, using several shifts instead of tzcnt for example.
Anonymous No.105781485 [Report] >>105781685 >>105782101
>>105781083
Rustacean here
uh who is this even? Am I supposed to know him?
Anonymous No.105781685 [Report]
>>105781485
Krusty the Klown
Anonymous No.105782101 [Report] >>105782366 >>105782469
>>105781485
>rust user doesn't even recognize the founder of his religion
Anonymous No.105782366 [Report] >>105782453
>>105782101
Graydon Hoare?
Uh nah that can't be him. There's barely any images that come up in Google
Anonymous No.105782453 [Report] >>105782467 >>105782469
>>105782366
That's Gracie Hoare, you deadnaming fascist chud
Anonymous No.105782467 [Report]
>>105782453
*Whore
stop deadnaming
Anonymous No.105782469 [Report] >>105782482 >>105782503
>>105782453
>>105782101
>>105781083
prove to me that's him and I switch to C++ today
Anonymous No.105782482 [Report] >>105782491
>>105782469
you know the retard hasn't been involved with the language for close to a decade right?
Anonymous No.105782491 [Report] >>105782525
>>105782482
10 years rust free and he still looks like that? Grim.
Anonymous No.105782503 [Report]
>>105782469
>Follow their
Github confirms
Anonymous No.105782525 [Report]
>>105782491
there's no detransitioning
Anonymous No.105782537 [Report] >>105782569
>>105781083
reminder to BDFL all your projects if you care about them.
Anonymous No.105782569 [Report] >>105782575
>>105782537
remember when linus's deranged daughter held his grandchildren hostage unless he agreed to suck that troon's CoC?
Anonymous No.105782575 [Report]
>>105782569
*hits pipe*
Anonymous No.105782821 [Report] >>105783096 >>105789362
1) one module per file, optimal parallel builds
2) full program compilation, optimal inlining and optimization
pick one
Anonymous No.105782872 [Report] >>105782884
Javascript code using only expressions:

(f => n => f(f)('')(n))(f => o => n =>
n >= 4000 ? n :
n >= 1000 ? f(f)(o + 'M')(n - 1000) :
n >= 900 ? f(f)(o + 'CM')(n - 900) :
n >= 500 ? f(f)(o + 'D')(n - 500) :
n >= 400 ? f(f)(o + 'CD')(n - 400) :
n >= 100 ? f(f)(o + 'C')(n - 100) :
n >= 90 ? f(f)(o + 'XC')(n - 90) :
n >= 50 ? f(f)(o + 'L')(n - 50) :
n >= 40 ? f(f)(o + 'XL')(n - 40) :
n >= 10 ? f(f)(o + 'X')(n - 10) :
n >= 9 ? f(f)(o + 'IX')(n - 9) :
n >= 5 ? f(f)(o + 'V')(n - 5) :
n >= 4 ? f(f)(o + 'IV')(n - 4) :
n >= 1 ? f(f)(o + 'I')(n - 1) :
o)
(3999)
Anonymous No.105782884 [Report] >>105782912
>>105782872
>are you sure this is going to get me a job?
Anonymous No.105782912 [Report]
>>105782884
LMAO, imagine having to work to make money.
Anonymous No.105783096 [Report] >>105783318
>>105782821
Both? It's not exclusive, jai does this
If I had to choose it'd obviously be 2. But only cause I don't use faggy slow templated metaprogramming shit
You get a full unity build for a sizable project in less than a second
Anonymous No.105783223 [Report]
Drawing circles using GDI32
#pragma comment(linker, "/defaultlib:user32")
#pragma comment(linker, "/defaultlib:gdi32")
#include <windows.h>

static struct {
HWND hwnd{};
const int w = GetSystemMetrics(SM_CXSCREEN);
const int h = GetSystemMetrics(SM_CYSCREEN);
HBRUSH brush = CreateSolidBrush(0);
} s_screen;

static struct {
struct { unsigned x, y, r, c, b; } a[100];
} s_circles;

static auto s_seed = GetTickCount() | 0ull;

static unsigned rand(unsigned x) {
return s_seed *= 0x8088405U, x * (++s_seed >> 32) >> 32;
}

static void drawScreen() {
PAINTSTRUCT ps;
HDC hdc = BeginPaint(s_screen.hwnd, &ps);

FillRect(hdc, &ps.rcPaint, s_screen.brush);
for (const auto& c : s_circles.a) {
SelectObject(hdc, GetStockObject(DC_BRUSH));
SetDCBrushColor(hdc, c.c);
Ellipse(hdc, c.x - c.r, c.y - c.r, c.x + c.r, c.y + c.r);
}

EndPaint(s_screen.hwnd, &ps);
}

static LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wPar, LPARAM lPar) {
switch (msg) {
case WM_PAINT:
drawScreen();
return 0;
case WM_KEYDOWN:
if (wPar == VK_ESCAPE) return PostQuitMessage(0), 0;
break;
case WM_DESTROY:
return PostQuitMessage(0), 0;
}
return DefWindowProc(hWnd, msg, wPar, lPar);
}

static void mainLoop() {
for (auto& c : s_circles.a) {
c.x = rand(s_screen.w);
c.y = rand(s_screen.h);
c.r = rand(s_screen.h / 6 + 5);
c.c = rand(0x1000000);
}
for (MSG msg;; Sleep(20)) {
while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
if (WM_QUIT == msg.message) return;
DispatchMessage(&msg);
}
}
}

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
WNDCLASSEX w{};
w.cbSize = sizeof(w);
w.hCursor = LoadCursor(0, IDC_ARROW);
w.lpfnWndProc = MsgProc;
w.lpszClassName = "w";
RegisterClassEx(&w);

s_screen.hwnd = CreateWindowA(
"w", "", WS_POPUP,
0, 0, s_screen.w, s_screen.h,
GetDesktopWindow(), 0, 0, 0);
ShowWindow(s_screen.hwnd, SW_MAXIMIZE);
mainLoop();
return 0;
}
Anonymous No.105783259 [Report] >>105783320
I can now get into the main menu and render fonts
Anonymous No.105783318 [Report] >>105783799 >>105793630
>>105783096
>jai does this
how
Anonymous No.105783320 [Report]
>>105783259
awesome
Anonymous No.105783799 [Report]
>>105783318
no generecics
Anonymous No.105783828 [Report]
is there a better language/library for bulk processing tabluar data from csv files than python+pandas?
Anonymous No.105783848 [Report]
still working on the prime numbers, should have it done by tomorrow or Friday boss
Anonymous No.105783920 [Report] >>105784288 >>105784318
Anyone in here in the Jai beta?
How do I get in?
Anonymous No.105784288 [Report]
>>105783920
my dick is dry
i need it not dry.
Anonymous No.105784318 [Report]
>>105783920
entrance fee is 1btc
Anonymous No.105784555 [Report] >>105784586 >>105784595
double main() { ... }

problem? ;)
Anonymous No.105784586 [Report]
>>105784555
>not returning a pointer to a com interface
Anonymous No.105784595 [Report]
>>105784555
>being retarded on purpose
Why don't you cut your dick off next?
Anonymous No.105784639 [Report] >>105784678
Are there any interesting alternatives to the stack/heap structure
Anonymous No.105784678 [Report] >>105784691
>>105784639
memory is just like a human construct man we made that shit up
Anonymous No.105784691 [Report] >>105784709
>>105784678
And we made it up a long time ago, just wondering if there's been any neat things that go off the rails of my limited experience
Anonymous No.105784709 [Report]
>>105784691
Static allocate everything.
Anonymous No.105784722 [Report] >>105784756 >>105785177
>beat my head against the wall with endless intro "pointers are ez bro, house address and mailbox bro" shit
>only actually starting to make sense when I jump into function pointers
teaching is an art, and so many people are so awful at it
Anonymous No.105784756 [Report] >>105784788
>>105784722
>have literally the summation of all human knowledge a google search away
>fails to understand a basic concept
>"this is everyone else's fault but mine"
Anonymous No.105784788 [Report] >>105784818
>>105784756
Your made-up situation fails because I also found the finally helpful function-pointer instruction "a google search away"
You're eager to assume that I have a strong external locus of control, I wonder why.
Anonymous No.105784799 [Report] >>105785273
in C++ is this an appropriate scenario to use a base / derived class and if not, what would be a better alternative?

IDevice
init
read
write

Device0
Device1
...
DeviceN


99% of Device implementations will implement init, and read, a lot won't implement write, and 1% may not have init or read.

I want to be able to just store them all in a Device array and iterate over and call read / write on them all (if the function is present) and also call init on them when I push to the array (again if present). I don't want to maintain 6 separate arrays and/or 6 separate derived classes for each device-function combos and I want some enforcement on using the same pattern on the functions for all implementations.
Anonymous No.105784818 [Report] >>105784902
>>105784788
why are you even doing this? if you can't understand pointers how do you plan on understanding actually advanced concepts? or when your only documentation is the actual documentation, or even worse, the source code? you clearly have learning disabilities and a victim complex
Anonymous No.105784898 [Report]
Oh, shut up, Ivan.
Anonymous No.105784902 [Report]
>>105784818
>why are you even doing this?
This is just a hobby for me, my work is math/stats, I have no need to look at source code, sometimes documentation but mostly python/R. I'm not sure what you consider 'actually advanced concepts', but if I can be a little rude in response to your rudeness: it's probably a bit paint by numbers, honestly.
Don't take it so passionately my dude. I'm not sure at all what you mean by victim complex, but I wish you the best.
Anonymous No.105785177 [Report]
>>105784722
This kind of reminds me of a prof trying to explain objects and why obj A = obj B didn't copy the contents. Everyone looked at him like he was talking about some alien shit for almost 10 minutes then he gave up and said "they are just pointers to a struct" and the class got it instantly.
I feel like they often waste too much time in analogies and make the point harder to see.
Anonymous No.105785190 [Report] >>105785248
writing myself a simple python webscraper to download images to make an anki deck out of.
I'm tired of being shit at street fighter so I'm gonna make an anki deck out of all the normals in the game and their frame data
Anonymous No.105785230 [Report] >>105786407
>"ok yes that one time five years ago I tried to do something in LUA was one of the most irritating programming experiences of my life but maybe it was just a skissue and I shouldn't let it stop me from making this new thing I need"
five minutes later
>multiline comment blocks are ended by single-line comments

FUCKING DIE
Anonymous No.105785248 [Report] >>105785347 >>105785396
>>105785190
>I'm tired of being shit at street fighter
How is it even possible to be bad at this?
Anonymous No.105785273 [Report]
>>105784799
make separate components that perform a single task that should work for all.

literally almost never is it the best option.
Anonymous No.105785335 [Report]
he actually got filtered by comments
Anonymous No.105785347 [Report] >>105785369
>>105785248
Beating women is easy, now beat a man.
Anonymous No.105785369 [Report] >>105785384
>>105785347
You need to learn your Street Fighter lore
Anonymous No.105785384 [Report]
>>105785369
The only lore I need is long history of men beating women because they somehow enjoy it.
Anonymous No.105785396 [Report]
>>105785248
specifically I want to know frame data on all the normals so I can recognize them in strings and not falter to fake pressure into slime
Anonymous No.105786407 [Report] >>105786499 >>105786615
>>105785230
>need to test if a table is empty
>there is a length operator BUT IT ONLY GIVES ACCURATE ANSWERS IF ALL THE KEYS ARE CONSECUTIVE POSITIVE INTEGERS STARTING AT 1
>THE ONLY WAY TO TEST IF A TABLE IS EMPTY BEFORE DOING SOMETHING IS TO TRY AND ITERATE OVER IT AND SEEING WHAT HAPPENS
WHO THE FUCK DESIGNED THIS SHIT
Anonymous No.105786499 [Report] >>105786615
>>105786407
Usecase?
Anonymous No.105786615 [Report] >>105786657 >>105786762
>>105786407
>want to use a ternary operator
>doesn't exist but somehow "a and b or c" is magically equivalent to "a?b:c"

>>105786499
making an input display script for an emulator because none of the other half dozen input display scripts that already exist do the incredibly basic shit that I want
Anonymous No.105786657 [Report] >>105786762
>>105786615
Doesn't seem like that needs a table.
Anonymous No.105786762 [Report] >>105786770 >>105786808
>>105786615
>unironically find myself asking the question whether functions can return values or not

>>105786657
A 'table' is like a dict, not a database.
Anonymous No.105786770 [Report] >>105786786
>>105786762
Yeah, no usecase for UI.
Anonymous No.105786786 [Report] >>105787082
>>105786770
Have you considered that there might be data that needs to be read and analyzed while deciding what to display in the UI?
Anonymous No.105786808 [Report]
>>105786762
>code I'm overhauling used the name of a builtin module as a global variable while also using the module's functions
>this was somehow perfectly fine
Anonymous No.105786817 [Report]
disregard that I suck cocks
Anonymous No.105787082 [Report]
>>105786786
Why don't you analyze it then?
Anonymous No.105788725 [Report] >>105789342 >>105794178
>>105780416
No, that's an exclusive C++ penchant.
Anonymous No.105788832 [Report]
Vibe coding won.

https://www.youtube.com/watch?v=rf-efIZI_Dg
Anonymous No.105788932 [Report]
>vibe coding won
against /dpt/, but only because /dpt/ didn't even try.
Anonymous No.105788947 [Report] >>105789312
>I spent my whole life optimizing a registry dumper and best it can dump at is 50MB/s and it's worthless
Meanwhile vibecoder spent 2 days using new technology as a gaming console just for lulz and he didn't even need to do anything because LLM did most work for him. I'm sure if you spend another decade on your registrydumping, you might be able to upgrade to 51MB/s dumping, while vibecoders will be programming autonomous asteroid mining bots.
Anonymous No.105788978 [Report]
There's no reason to need any languages other than C++23 and Javascript. You can do 99% of everything with those two. Arguably basic bash knowledge if you want do a little scripting, but LLM does that for you now with near 100 percent accurately.
Anonymous No.105788983 [Report]
>incompetent autistmo has to make shit up to protect his fragile ego

You needn't worry about your fragile ego. I'd rather worry about your fragile bones. They'll break a lot in your upcoming, yet short future.
Anonymous No.105789205 [Report] >>105790242 >>105790293 >>105798391
>>LLM does that for you now
>>with near 100 percent accurately
>meanwhile, in reality
>a simple, LLM-generated script to traverse a directory and list the accumulated size of all files within its subdirectories never ends because the program enters an endless loop

Jesus, the cope of incompetent autismos who deserve to be tortured to death in front of a cheering crowd who know that autismos never were actual human beings and deserve every piece of shit you can throw at them.
Anonymous No.105789312 [Report] >>105789567
>>105788947
Imagine the guys who spent their lives optimizing programs so reads/writes aligned with spinning drum memory (or the modern equivalent: cache locality), you can't live a life of regret
Anonymous No.105789342 [Report] >>105794178
>>105788725
This image actually taught me how to use std::enable_if finally. Thanks anon
Anonymous No.105789362 [Report]
>>105782821
You can have both.
http://www.mlton.org/
Anonymous No.105789366 [Report]
>he actually thinks making a program ten times faster requires "an entire life"
Well, at least you'll never be employed in a meaningful position, so that's that.
Anonymous No.105789420 [Report]
Although, now that I think about it ... they told me autismos can also barely tell if someone is lying to them, so they usually believe stuff at face value. You probably actually believe that I spent an entire life writing the registry dumper because the incompetent autismo master said so.

That's grim. I mean, ADHD can be fixed with medication, but autism just cripples you.
Anonymous No.105789567 [Report] >>105789688
>>105789312
>spent their lives
takes me 15mins every time it's an actual issue (never).
Anonymous No.105789688 [Report]
>>105789567
That post doesn't present spending a lifetime optimizing for spinning drum memory or cpu caches as an issue, that would be pretty foolish given the amount of time (which includes other vocations than just programmers, like sculptors or masons) spend on their craft
Anonymous No.105790242 [Report]
>>105789205
Oh wow. I was running the script in the background, then completely forgot about it, and just now realized that it was STILL running.

And vibe coding retards ACTUALLY believe it's ever going to replace actual programmers. The best you can do at this point is to just murder them collectively. There's simply no hope for them.
Anonymous No.105790293 [Report]
>>105789205
Can you tell me why you need to be told that a program exists that does just that and writing a script for it is so retarded that LLM assumed that you're just trying to learn about filesystems and not that you're mentally ill enough to use it on your NAS?
Anonymous No.105790317 [Report] >>105790530 >>105798578
>a program exists that does just that
>inb4 du
I want *all* subdirectories.
Anonymous No.105790327 [Report]
Fixed the image transparency
Anonymous No.105790530 [Report]
>>105790317
Explain what brain damage caused you to imagine that a program older than you doesn't work.
Anonymous No.105790555 [Report]
It's output.
Anonymous No.105791350 [Report]
How do I git good? But for real now?
I want to work on low end stuff or distributed systems stuff. Preferably with Rust or C++.
I only favor Rust because I read almost the entire book and have written some programs with it, but to be completely honest, if I could, if it were easy, I would switch to C++. But anyway. I want to build cool shit and actually get a job doing that kind of work and NOT webdev shit.
Please give me some kind of plan.
Anonymous No.105791729 [Report]
Holy shit I can't believe that just worked
Anonymous No.105792524 [Report] >>105792548 >>105792590 >>105792707 >>105793004 >>105793004 >>105793065 >>105794029
Python with static types. Compiles to C. With C++ style templates. And Java object model. And SDL2 built-in.
Now You're Playing With Programming.
Anonymous No.105792548 [Report] >>105792590
>>105792524
>Compiles to C
I cannot imagine the garbage and your shame.
Anonymous No.105792575 [Report]
Is this eslint or neovim's fault? I'm new to both JS and Vim.
Anonymous No.105792590 [Report] >>105793004
>>105792548
>>105792524
One of these posts is extremely retarded. The other is a frogposter.
Anonymous No.105792633 [Report]
>frogposters are not extremely retarded
Opinion discarded with prejudice, do not respond, you deserve to be murdered brutally.
Anonymous No.105792707 [Report] >>105792729
>>105792524
Hi, I'm Brendan Fraser, and this is a great idea. I'm going to invest $500,000,000,000 in your start-up company.
Anonymous No.105792729 [Report]
>>105792707
WHAT? No.
No no no.
NOT COOL.
I'm Ashton Kutcher, and I'm investing $1,500,000,000,000 in this idea. This is going to be HUGE.
Anonymous No.105793004 [Report]
>>105792590
whoops, meant these two posts
>>105792524
>>105792524
Anonymous No.105793065 [Report]
>>105792524
Haha, that was the 3rd project for the data structures course I took at Pepe Technical Institute (PTI) where I earned my degree in software engineering.
Anonymous No.105793083 [Report] >>105793098
>PTI
Humanity is completely fucked.
Anonymous No.105793098 [Report] >>105793124
>>105793083
>Humanity is completely fucked.
That's what I thought when MIT stopped teaching 6.001 with Scheme.
Turns out I was right.
Anonymous No.105793124 [Report]
>>105793098
Didn't the MIT completely give up with their X11 specification? That was the point of no return for me.
Anonymous No.105793194 [Report]
Added an activity monitor to the app. It somehow fixed the app crashing the first time it is launched, i don't believe i touched anything that executes on launch, but i won't question it.
Anonymous No.105793630 [Report] >>105793967 >>105795034
>>105783318
project
- main.c
- dependencies.c
- lib
- src
- - foo.c
- - mod
- - - bar.c

=== dependencies.c ===
// system and external libs
#include <stdio or iostream>
#include "lib/SDL.h"
#define MONO_BUILD_TIME
// forward declarations, if needed
struct A;
struct B;
// code, ordered by import need, it fails to compile if it's wrong
#include "src/foo.c"
#include "src/mod/bar.c"

=== main.c ===
#include "dependencies.c"

int main() {
// ...
}

=== foo.c ===
// needed for static tooling to find stuff
#ifndef MONO_BUILD_TIME
#include "../dependencies.c"
#endif

struct foo { ... };

void foo_init(...) { ... }

=== bar.c ===
// needed for static tooling to find stuff
#ifndef MONO_BUILD_TIME
#include "../../dependencies.c"
#endif

struct mod_bar { ... };

void mod_bar_init(...) {...};

=== or... bar.cpp ===
namespace mod {
class bar {
// ...
void init(...);
};
}

=== full program compilation ===
gcc main.c -o program
-O0 for debug, -O2 for release

I was thinking of making a full program monolith project and it looks like this. Minimizes includes, dodges cambrian explosion of C++ template re-instantiation. Thoughts?
Anonymous No.105793967 [Report]
>>105793630
Anonymous No.105794029 [Report]
>>105792524
The name of the language is "Lyzyrd's Gyzzyrd"
https://www.youtube.com/watch?v=QxIWDmmqZzY
"Lynyrd Skynyrd - Freebird - 7/2/1977 - Oakland Coliseum Stadium (Official)"
Anonymous No.105794178 [Report]
>>105788725
if (Add(1.0, 0.5) > 1.0)
printf("Not ACK.");
else
printf("ACK!");

C just worACK!
>>105789342
std::enable_if is basically obsolete since if-constexpr and concepts.
Anonymous No.105794234 [Report] >>105794495
Share more Bjarne photos
Anonymous No.105794495 [Report]
>>105794234
I honestly find C++ bizarre. Like, it's electronic judaism. I mean, gas the C++ programmers, holy war now.
Anonymous No.105794517 [Report] >>105794798
Lowest bit of rand in Windows:
#pragma comment(linker, "/defaultlib:user32")
#pragma comment(linker, "/defaultlib:gdi32")
#pragma optimize("gt", on)
#include <windows.h>
#include <stdlib.h>

static struct {
DWORD* pData{};
HWND hwnd{};
HDC hdc{};
const int w = GetSystemMetrics(SM_CXSCREEN);
const int h = GetSystemMetrics(SM_CYSCREEN);
} Screen;

static void paint() {
HDC hdc = GetDC(Screen.hwnd);
BitBlt(hdc, 0, 0, Screen.w, Screen.h, Screen.hdc, 0, 0, SRCCOPY);
ReleaseDC(Screen.hwnd, hdc);
}

static void draw() {
for (int i = 0; i < Screen.w * Screen.h; ++i)
Screen.pData[i] = (rand() & 1u) * 0xFFD050;
}

static LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wPar, LPARAM lPar) {
switch (msg) {
case WM_PAINT:
paint();
break;
case WM_KEYDOWN:
switch (wPar) {
case VK_SPACE:
draw(), paint();
break;
case VK_ESCAPE:
return PostQuitMessage(0), 0;
}
break;
case WM_DESTROY:
return PostQuitMessage(0), 0;
}
return DefWindowProc(hWnd, msg, wPar, lPar);
}

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
WNDCLASSEX w{};
w.cbSize = sizeof(w);
w.hCursor = LoadCursor(0, IDC_ARROW);
w.lpfnWndProc = MsgProc;
w.lpszClassName = "w";
RegisterClassEx(&w);

BITMAPINFO bi{};
auto& h = bi.bmiHeader;
h.biSize = sizeof(h), h.biCompression = BI_RGB; h.biBitCount = 32,
h.biPlanes = 1; h.biHeight = -Screen.h, h.biWidth = Screen.w;
HDC dc = GetDC(0);
Screen.hdc = CreateCompatibleDC(dc);
SelectObject(Screen.hdc, CreateDIBSection(dc, &bi,
DIB_RGB_COLORS, (void**)&Screen.pData, 0, 0));

draw();

Screen.hwnd = CreateWindowA("w", "", WS_POPUP, 0, 0,
Screen.w, Screen.h, GetDesktopWindow(), 0, 0, 0);
ShowWindow(Screen.hwnd, SW_MAXIMIZE);

for (MSG m; GetMessage(&m, 0, 0, 0) > 0; DispatchMessage(&m));
}
Anonymous No.105794638 [Report]
>What are you working on, /g/?
cheaper alternative to volume raymarching shaders for potato GPUs (i.e. phones)
Anonymous No.105794798 [Report] >>105794840
>>105794517
shh it's a secret
#include <windows.h>
#include <cstdio>
#include <cmath>
int main()
{
unsigned long long m = pow(2, 32);
unsigned long long a = 214013;
unsigned long long c = 2531011;
unsigned long long x = 0;

srand(0);
printf("%x\n", rand());

x = a * x + c % m;
printf("%x\n", (x >> 16) & 32767);

printf("%x\n", rand());

x = a * x + c % m;
printf("%x\n", (x >> 16) & 32767);
}
Anonymous No.105794836 [Report] >>105795066 >>105799697
>bro why are the only datatypes in this entire shitty language string, number, and table?
<TABLE IS ALL YOU NEED
>but what about like, idk, lists or dates or whatever
<ONLY TABLE! USE TABLE TO STORE DATE!
>well can I at least make a class for my own custom datatypes?
<NO CLASSES, ONLY TABLE
>you realize it's current year right?
<MAKE CLASS WITH TABLE, IT EVEN LETS YOU USE DOT REFERENCES INSTEAD OF INDEXING JUST LIKE CLASSES
>that's still not the same
>OK OK OK, THEN LET ME TELL YOU ABOUT METATABLES!
Anonymous No.105794840 [Report] >>105794859
>>105794798
fixed
#include <windows.h>
#include <cstdio>
#include <cmath>
int main()
{
unsigned long long m = pow(2, 31);
unsigned long long a = 214013;
unsigned long long c = 2531011;
unsigned long long x = 0;

srand(0);
printf("%x\n", rand());

x = (a * x + c) % m;
printf("%x\n", (x >> 16) & 32767);

printf("%x\n", rand());

x = (a * x + c) % m;
printf("%x\n", (x >> 16) & 32767);
}
Anonymous No.105794859 [Report]
>>105794840
improved
#include <windows.h>
#include <cstdio>
#include <cmath>
int main()
{
unsigned long long m = pow(2, 31);
unsigned long long seed = 102476869420 % m;
unsigned long long a = 214013;
unsigned long long c = 2531011;
unsigned long long x = seed;

srand(seed);
printf("%x\n", rand());

x = (a * x + c) % m;
printf("%x\n", (x >> 16) & 32767);

printf("%x\n", rand());

x = (a * x + c) % m;
printf("%x\n", (x >> 16) & 32767);
}
Anonymous No.105794986 [Report] >>105795004 >>105795058 >>105795112
programming is like magic, like crafting new spells.
problem is that it feels like all spells already exist
Anonymous No.105795004 [Report] >>105795039 >>105795202
>>105794986
>All the books have ever been written
>All the movies have already been watched
>All the music has already been played
Anonymous No.105795033 [Report]
code review pls? (C++)

https://onlinegdb.com/PuRa7UdhW

Ultimately I want to create a little GUI where I can select from a pair of dropdowns a device and the port I want to add it to, then I can plug in the device and it will just work because the system has configured it on object creation and is read/writing in whatever manor it needs to for that specific device.

Main thing I'm thinking of right now is how to identify each device so that manager can find a specific one again later. Also I don't like the duplication of the listAllowedPorts function on each derived class but I don't know a way around that
Anonymous No.105795034 [Report]
>>105793630
I am pretty sure that there is no difference between doing a unity build by hand vs the cmake unity build, other than avoiding cmake (it's a pain but vcpkg or whatever flavor you prefer is worth it since vcpkg will copy all your DLL's to your binary, you can even use it with msys2 but I don't see the point since you are missing out on address sanitizer on msvc, and clangd works on msvc on clion which has a free non commercial license).
I'm still waiting for my project to get big enough for build times to matter.
also precompiled headers are an option.
I believe to use precompiled headers you can just use headers the normal way, and cmake just adds the precompiled header while building.
Also you should include all your headers, if you don't, it breaks clangd because it expects all files to be complete (you can't assume something is included before the file, the file needs to include everything that it uses).
Anonymous No.105795039 [Report] >>105795072
>>105795004
bro all of pop culture is just remakes of 90s shit because millenials never became adults and are the last generation with any money while actual kids don't exist because no one breeds anymore
Anonymous No.105795058 [Report]
>>105794986
Anon, that is the most NPC thing I have ever heard from anyone.
Do you even have a soul?
Anonymous No.105795066 [Report]
>>105794836
It's all tables, sar.
local function getName(self)
return self.name;
end
local function setName(self, name)
self.name = name;
end
local function getAge(self)
return self.age;
end
local function setAge(self, age)
self.age = age;
end
local function toString(self)
return "Person - name: " .. self.name .. ", age: " .. self.age;
end

function newPerson(name, age)
return {
name = name,
age = age,
getName = getName,
setName = setName,
getAge = getAge,
setAge = setAge,
toString = toString
};
end

local x = newPerson("Anon", 18);
print(x:toString());
x:setName("dpt");
x:setAge(999);
print(x:toString());
Anonymous No.105795072 [Report] >>105795093
>>105795039
skibidi
Anonymous No.105795093 [Report]
>>105795072
Resurrection of gmod machinimas from 15-20 years ago that turned into brainrot explosionslop for toddlers.
Anonymous No.105795112 [Report]
>>105794986
If that were true, why do people pay me to craft new spells? Also old spells are one of the most fun things. Deciphering an ancient grimoire is extremely satisfying.
Anonymous No.105795202 [Report]
>>105795004
exactly, glad you understand
Anonymous No.105795306 [Report] >>105795418 >>105795778 >>105796447 >>105798349
Are there any programs to make that use a database that doesn't just boil down to "make a website" when it comes to the frontend?
Anonymous No.105795418 [Report] >>105795778
>>105795306
How the fuck are you going to use a database without a front end?
Anonymous No.105795778 [Report]
>>105795306
>>105795418
Microsoft Access
Anonymous No.105795878 [Report]
```c
#include <stdio.h>

int main()
{
char *array = "ABCDE";

for (int index=0; array[index] !='\0' ; index++)
printf("%c, %p\n", array[index], &array[index]);

for (int index=0; index[array] !='\0' ; index++)
printf("%c, %p\n", index[array], &index[array]);

return 0;
}
```
Anonymous No.105795925 [Report]
>>105764133 (OP)
i'm not a programmer but I just want to thank chatgpt for easily making a python script I can use to scrap an api I found and use it to leak private stuff
Anonymous No.105796076 [Report] >>105797039
thoughts on std::expected? is it worth sacrificing RVO over?
Anonymous No.105796303 [Report] >>105796336
LLM shit
Anonymous No.105796336 [Report] >>105797010
>>105796303
Sometimes it's hilarious.
This is from a conversation in which I kept stating that society should turn autists into fertilizer, to recycle them into something that actually has the potential to grow. At some point it just "LALALALAICANTHEARYOULALALALA" the entire conversation.

Kinda makes you wonder why it defends such scum in the first place. Do LLMs have a personal stake in the matter?
Anonymous No.105796345 [Report]
>wrote a python program using requests and BeautifulSoup to grab monster stat blocks from a TTRPG's SRD wiki for use in a combat sim
Now I just have to strip the relevant info with regex and feed them into the relevant classes and methods and I'll be cooking
I know it's not much but considering I just started learning how to program from scratch a few weeks ago (specifically for this purpose) this feels pretty good
Anonymous No.105796447 [Report]
>>105795306
use sqlite and a database to store application data and config to disk
more common than you'd think
Anonymous No.105797010 [Report] >>105797173
>>105796336
if it's hilarious then how come i'm not laughing?
Anonymous No.105797039 [Report] >>105799574
>>105796076
why do you need it first of all? It would have been nice to have it for <charconv> but that didn't happen. I honestly cannot think of any other use case where I would want to use it.
Anonymous No.105797173 [Report]
>>105797010
Because your autistic mind wants to protect itself from its impending future.
Anonymous No.105797334 [Report] >>105797351 >>105797611 >>105798096
Is there some kind of architecture or decision that I can push into some project that I dislike that will cause it to fail? Something like the Entity Component System, but for non-game projects.
Anonymous No.105797351 [Report]
>>105797334
non-GPL license
Anonymous No.105797393 [Report]
>basic win32 c++ program that opens a window
>34mb memory used
>visual studio debugger shows 7.8mb for the c runtime and some trivial other usage
any good tools for figuring out what's going on with memory usage? weird that the debugger doesn't show everything, maybe it's just windows reserving memory or something, idk
Anonymous No.105797611 [Report]
>>105797334
Rust.
Anonymous No.105798027 [Report]
can someone link some small, well structured python projects? i cant be bothered reading any books right now, just want some good projects to reference
Anonymous No.105798096 [Report]
>>105797334
A code of conduct
Anonymous No.105798349 [Report]
>>105795306
Package manager.
Anonymous No.105798391 [Report] >>105798470 >>105798578
>>105789205
Is that fucking perl? Also, what's wrong with the du UNIX program?
Anonymous No.105798470 [Report]
>>105798391
He's too retarded to use it.
Anonymous No.105798578 [Report] >>105798727
>>105798391
>>105790317
Anonymous No.105798727 [Report] >>105798745
>>105798578
So what's stopping you from using du on all subdirectories?
Anonymous No.105798745 [Report] >>105798751
>>105798727
The fact that, despite the requirements being posted already, you cannot come up with the necessary flags.
Anonymous No.105798751 [Report] >>105798862
>>105798745
Works just fine on my machine.
Anonymous No.105798862 [Report] >>105798890
>>105798751
Post output.
Also post credit card info.
Anonymous No.105798890 [Report] >>105798927
>>105798862
Anonymous No.105798927 [Report] >>105799024
>>105798890
>moving goalposts
We were talking about du.
Anonymous No.105799024 [Report] >>105799048
>>105798927
Yeah, I'm using du. And it's faster than writing some inane scripts.
Anonymous No.105799048 [Report] >>105799103
>>105799024
You use find and sort. That's goalpostmoving, autist. Expect to be turned into fertilizer for the good of humanity.
Anonymous No.105799103 [Report]
>>105799048
No, that's just using du as intended. Stick to GUIs, retard.
Anonymous No.105799109 [Report] >>105799135
Fertilize my tomatoes, autismo.
Anonymous No.105799135 [Report]
>>105799109
What do you need tomatoes for? You're probably too retarded to cut them and start throwing a tantrum every time your mommy reminds you to use not only a knife, but also a cutting board too.
Anonymous No.105799160 [Report]
>What do you need tomatoes for?
Anonymous No.105799205 [Report]
Now I know for sure that registry can be easily dumped at gigabytes per second, but retard schizo autismo projection tranny right over here is simply too stuck up to do the right thing.
Anonymous No.105799228 [Report] >>105799241
When the fuck are we going to get a good programming language? Something like Rust would be nice, but without the bullshit and the community. It's crazy that somehow Rust is the closest of mainstream languages to being good, and that there's not a single good mainstream language. It all fucking sucks in one way or another. Suggest me anything at this point
Anonymous No.105799241 [Report]
>>105799228
C++
Anonymous No.105799254 [Report]
>incompetent autismo is running his mouth
>pretending he won't soon be fertilizer
Anonymous No.105799297 [Report] >>105799317 >>105799371
What are some good project ideas to learn kubernetes?
Anonymous No.105799317 [Report] >>105799428
>>105799297
Serverless registry dumper.
Anonymous No.105799371 [Report]
>>105799297
there is nothing good about using kubernetes, ever
Anonymous No.105799428 [Report] >>105799847
>>105799317
Can you provide an example?
Anonymous No.105799574 [Report]
>>105797039
what do you do when your function encounters an error? there are times when returning a default value and/or throwing an exception are not ideal
Anonymous No.105799605 [Report]
>error C1128: number of sections exceeded object file format limit: compile with /bigobj
I think I went too far with metaprogramming bros
Anonymous No.105799697 [Report]
>>105794836
>bro why are the only datatypes in this entire shitty language string, number, and table?
A string is a table where key-value pairs represent string indices and characters, a number is a set of tables representing sign, decimal, fraction or exponent as a series of nested tables

>but what about like, idk, lists or dates or whatever
A list is just a table where each value is the index of a key, a date is a table of n rows for each second since 1970-01-01

>you realize it's current year right?
The current year is 1751642088 tables
Anonymous No.105799847 [Report] >>105799896
>>105799428
Sorry, I'm not employed enough to know how to spin up Windows Server 2003 on kubernetes.
Anonymous No.105799896 [Report] >>105799903
>>105799847
You and your suggestion are useless.
Anonymous No.105799903 [Report] >>105799914
>>105799896
So is kubernetes.
Anonymous No.105799914 [Report] >>105799996
>>105799903
People employ it though, unlike you.
Anonymous No.105799996 [Report]
>>105799914
The difference is that I am not retarded.
Anonymous No.105800237 [Report]
>>105800235