What are you working on, /g/?
Previous thread:
>>105724992
>>105764157I'll agree with your bait because I'm too lazy to properly learn the other two.
>>105764139you'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)
>>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.
>>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
>>105765219Congrats, your post has made me sleepy.
>>105765219I've been transcribing all my loose notes into my new journal during the heat
>>105765168>no argument>ad hominemconcession accepted
no reply required
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.
>>105765537I think you should detransition before it's too late.
>>105765537>I'm writing a trading agentYeah, I figured that's what you meant when you wanted to make sure your program doesn't crash.
>>105765565Currently I only do back-testing with it. Its not connected to anything. Do you mean "state pattern" has a tendency to crash?
>>105765589Aren'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?
>>105765608Not really. I am writing it in common lisp, R and python. Most of the logic is in CL.
>>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)))))
...)
>>105765737yeah, literally this but more complex. Apparently this is not "clean"?
>>105765793If letrec contains no side effects and s0 is returned as a start state I can't imagine how it could be better encapsulated
>>105765834>>105765737I'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)))
>>105765894>>105765834>don't use objects or OOMy life is 100% easier with CLOS than juggling lists around for the things I'm doing.
>>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 transitionthat 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
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
>>105766723Is it a clover/kuroba fork? Can I have it?
>>105766930no, it's my own and very incomplete
>>105765899>My life is 100% easieryou mean 100% slower because every token is an allocation
>>105767358Good thing I don't care.
>>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.
>>105768034Learn awk if all you need is to juggle text.
>>105768080i 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.
>>105768100>i want to interface with databases toohttps://metacpan.org/pod/DBI
>>105768100Usecase for databases?
>>105767358what are you on about
>>105768121this
>>105768128 and querying is nicer than parsing dzhigabouht single string jsons.
>>105768128>>105768214I have no use for data or "querying" it.
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?
>>105768288design it all to work online with interfaces and shit? like how theres SAX for xml
>>105768263Not a (me) problem.
>>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>
>>105768546>modulesnot real
>>105768546>falling for danish tricks again
>>105768583this
show me a compiled module
you can't
>>105768605>drawn chimera penis>>105766723>>105765413>scantly clad cartoon girlsFuck you "people". You should be banned from posting images.
>>105768583>>105768605so no, thanks lads I can continue to be old and stuck in my ways
>>105768647Oh my fucking goodness, you fucking autistic crybaby.
I hope you meet the chainsaw that was the source of this addition.
>>105768546They are good in theory, but they're still not widely supported, and they kill parallel builds.
>>105768670>I can continue to be old and stuck in my waysThe true c/c++ way. If it works, it works.
>>105768791For once you made a good, funny post, well done registryschizo.
>autist with no discernable skills or charisma has an opinion about humor
>>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}
>>105769066Looks like you couldn't follow the guide.
>>105769090Why 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?
>>105769149Install Gentoo.
>>105764133 (OP)C# isn't a programming language.
>>105764157Rust is awesome stop hating
>>105768791Bjarne is possibly the most chaddest programmer alive after John Carmack
>>105770101Indeed, he has done so much for C programming language, much more than C++ even.
>>105770101Not to mention Carmack is a C++ expert
>>105770101getting 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 languagesmeme, doesn't really change this
>>105770711C++ was always slop, Bjarne wanted it to take Bell Labs and the world, and it took all corpos, so he got his wish.
C++ is beautiful, elegant, a joy to both read and write.
>>105771085This, but unironically.
>>105771085Had 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.
>>105771249Modules don't solve this.
>>105771085Indeed, a treat for both the eyes and the fingers.
>>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.
>>105771368And I say that you created this hell by using templates everywhere even when you don't actually have to.
>>105771368Don't fucking post ChatGPT spam here.
>>105771405This. I never use templates. Shit fucking sucks.
>>105772161yeah they're pretty good when you're in a good language
Modules never ever.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1300r0.pdf
>>105770056>hateI don't hate Rust - it simply doesn't deserve that emotional investment. But C++ is a cancer upon the world.
only imposters who can't actually program hate C++
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.
C++ is better than fine, it's grrreat
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
>>105773373This is normal for windows servers.
>>105772533My 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.
>My C++ code generates identical assembly to C
Whatever you say, incompetent autismo.
>I write bad C++ and it resulted in bad assmbly
>this is the fault of some swedish guy or whatever the fuck he is
>incompetent autismo moves goalposts
>as always
And that's why actual people want to see you reduced into a bloody pulp.
>>105773952when are you going to livestream your suicide? it must be painful being this retarded all the time.
>>105773996Soon, it really is tiring being this retarded all the time.
>>105773996But 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.
Sorry, I'm a psychopath, so I'd rather murder your entire family.
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.
I'm not the originator of that label, so it's a nice self-own of your incompetent autismo ilk.
>>105774158It's actually a perfect description of what you are.
just fucking write in goddamn assembly and you won't have this fucking problem you goddamn retadrs
>>105774183>reeeeeee is it moving or is it copying I just don't know better invent illegible syntax to try to figure it outyou would know immediately if you just WROTE ASSEMBLY
>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.
>>105774183I already told you why assemblyshit is inadequate.
>>105774183I was going to write assembly but then I got filtered by Intel's 16,000 page manual for modern processors
Yeah, we (that is, normal human beings) noticed you were utterly confused by SFENCE.
>>105774318I'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.
>moving goalposts
Nope. Talk about SFENCE, or don't talk at all.
Sorry, but I don't copy memory, so sfence has no usecase...
>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.
>>105774359You will never be a woman.
>they beat the chin out of you too
Grim.
My parent don't take me to the hospital after they beat me
>parent don't
We know, Ivan.
>>105765537>I am getting filtered by this Design pattern stuffThey 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
My partner doesn't beat me before taking me to the hospital.
Damn. I knew autists had bad spatial awareness, but I didn't know it's so bad you regularly go to the hospital.
>>105774404uncle bob did not invent design patterns
design patterns are not intended to "simplify coding"
>>105774453my 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
>>105774486design 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
ready to learn C++ once again? Sutter claims reflection will be a pivotal change to the language.
>>105775406The 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.
>>105775406>We can provide a better implementation of make_integer_sequenceHow is this better than:
template <typename T>
class integer_sequence {
T start;
T end;
T current;
};
?
>>105775469that's not an integer sequence.
https://en.cppreference.com/w/cpp/utility/integer_sequence.html
>>105775639Shut the fuck up retard. You literally CANNOT explain why every single value must be stored in memory instead of computed when needed.
>>105775676lmao, brainlet spering out over things xe can't understand
>>105775442I WILL be one of them, and you WILL have to deal with my code. git gud.
>>105775774The 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.
>>105775774I simply won't use your code, faggot.
>>105775876>>105775993I hope you don't consider a career programming in C++. you might be in for a surprise.
>>105776019I don't consider codemonkery a career.
>>105775406Can't wait for 2032 when people start upgrading to C++26
Why would I want to work in a dump that uses C++? They might as well demand Python or PHP.
>>105776070>dump that uses C++That's a good way to describe Windows.
>>105775406Nah 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.
>>105776591Who's gonna tell him?
>>105769356what is it then?
>>105776780Scripting language.
>>105776794scripting languages are programming languages you fucking retard.
>>105764157Python btfos each and every languages. Cniles need not apply.
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
>>105777444>jeetcentral.comopinion discarded
I mean, since when do incompetent autismos have any self-preservation instincts? They would happily jump into a chainsaw.
>>105777444I advocate for python because it's quick and computer autism isn't my job, it's just makes my job quicker.
Seethe, ranjit.
>>105777444being faster than the slowest isn't really something you should celebrate...
>>105777444Honestly if ChatGPT says python is bad, maybe I should kneel...
Wow. There's a bunch of goners in this thread.
file
md5: 1ba3acd70b3e0a648a99b2a76831a4a3
๐
lol
>>105779219based microshit
>>105779219BASED! It absolutely MUST cost money to make money.
>>105776780A miserable little pile of secrets
>>105772920Was the goal of the C version to be as unreadable as possible?
>>105773952Yes I've seen this before
https://youtu.be/kdlIlIIHCz0?si=6Iavpj9WqvbqN24c&t=276
And this video is 10 years old
>>105780441Are you seriously expecting me to listen to someone with that accent? Fuck no. I got standards.
>>105780509It's funny that you say so because that accent is amazing.
Your standards are absolute shit
>that accent is amazing
Turd worlder detected, opinions discarded with prejudice.
>>105780574>>105780509I like it when he goes
>hmmmmm
No actual human being cares what you like.
Why can't you click on the post number to reply?
It filters autists. That alone makes it worth it.
look at what you're doing to rust developers
are you proud of yourselves?
>>105781083holy shit its the it guy
>>105781083>are you proud of yourselves?Yes.
Yes, I am.
>>105776794Now that you can run it without a .csproj file, it might replace Python as my goto scripting language.
>>105781083Fearless, safe, blazingly fast
>>105780416No, the goal was to prove that Cniles are incompetent, using several shifts instead of tzcnt for example.
>>105781083Rustacean here
uh who is this even? Am I supposed to know him?
>>105781485Krusty the Klown
>>105781485>rust user doesn't even recognize the founder of his religion
>>105782101Graydon Hoare?
Uh nah that can't be him. There's barely any images that come up in Google
>>105782366That's Gracie Hoare, you deadnaming fascist chud
>>105782453*Whore
stop deadnaming
>>105782453>>105782101>>105781083prove to me that's him and I switch to C++ today
>>105782469you know the retard hasn't been involved with the language for close to a decade right?
>>10578248210 years rust free and he still looks like that? Grim.
>>105782469>Follow theirGithub confirms
>>105782491there's no detransitioning
file
md5: 901d19a8b9cfc118ec92a1ce68d47cce
๐
>>105781083reminder to BDFL all your projects if you care about them.
>>105782537remember when linus's deranged daughter held his grandchildren hostage unless he agreed to suck that troon's CoC?
1) one module per file, optimal parallel builds
2) full program compilation, optimal inlining and optimization
pick one
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)
>>105782872>are you sure this is going to get me a job?
>>105782884LMAO, imagine having to work to make money.
>>105782821Both? 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
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;
}
I can now get into the main menu and render fonts
>>105783096>jai does thishow
is there a better language/library for bulk processing tabluar data from csv files than python+pandas?
still working on the prime numbers, should have it done by tomorrow or Friday boss
Anyone in here in the Jai beta?
How do I get in?
>>105783920my dick is dry
i need it not dry.
>>105783920entrance fee is 1btc
double main() { ... }
problem? ;)
>>105784555>not returning a pointer to a com interface
>>105784555>being retarded on purposeWhy don't you cut your dick off next?
Are there any interesting alternatives to the stack/heap structure
>>105784639memory is just like a human construct man we made that shit up
>>105784678And 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
>>105784691Static allocate everything.
>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
>>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"
>>105784756Your 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.
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.
>>105784788why 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
>>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.
>>105784722This 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.
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
file
md5: afa4ad26872dc5dbfe4cd69983179b82
๐
>"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
>>105785190>I'm tired of being shit at street fighterHow is it even possible to be bad at this?
>>105784799make separate components that perform a single task that should work for all.
literally almost never is it the best option.
he actually got filtered by comments
>>105785248Beating women is easy, now beat a man.
>>105785347You need to learn your Street Fighter lore
>>105785369The only lore I need is long history of men beating women because they somehow enjoy it.
>>105785248specifically 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
>>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 HAPPENSWHO THE FUCK DESIGNED THIS SHIT
>>105786407>want to use a ternary operator>doesn't exist but somehow "a and b or c" is magically equivalent to "a?b:c">>105786499making 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
>>105786615Doesn't seem like that needs a table.
>>105786615>unironically find myself asking the question whether functions can return values or not>>105786657A 'table' is like a dict, not a database.
>>105786762Yeah, no usecase for UI.
>>105786770Have you considered that there might be data that needs to be read and analyzed while deciding what to display in the UI?
>>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
disregard that I suck cocks
>>105786786Why don't you analyze it then?
>>105780416No, that's an exclusive C++ penchant.
Vibe coding won.
https://www.youtube.com/watch?v=rf-efIZI_Dg
>vibe coding won
against /dpt/, but only because /dpt/ didn't even try.
>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.
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.
>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.
>>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.
>>105788947Imagine 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
>>105788725This image actually taught me how to use std::enable_if finally. Thanks anon
>>105782821You can have both.
http://www.mlton.org/
>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.
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.
>>105789312>spent their livestakes me 15mins every time it's an actual issue (never).
>>105789567That 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
>>105789205Oh 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.
>>105789205Can 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?
>a program exists that does just that
>inb4 du
I want *all* subdirectories.
Fixed the image transparency
>>105790317Explain what brain damage caused you to imagine that a program older than you doesn't work.
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.
Holy shit I can't believe that just worked
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.
>>105792524>Compiles to CI cannot imagine the garbage and your shame.
file
md5: 05287413b919ef34dedc5370a89de9dc
๐
Is this eslint or neovim's fault? I'm new to both JS and Vim.
>>105792548>>105792524One of these posts is extremely retarded. The other is a frogposter.
>frogposters are not extremely retarded
Opinion discarded with prejudice, do not respond, you deserve to be murdered brutally.
>>105792524Hi, I'm Brendan Fraser, and this is a great idea. I'm going to invest $500,000,000,000 in your start-up company.
>>105792707WHAT? 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.
>>105792524Haha, 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.
>PTI
Humanity is completely fucked.
>>105793083>Humanity is completely fucked.That's what I thought when MIT stopped teaching 6.001 with Scheme.
Turns out I was right.
>>105793098Didn't the MIT completely give up with their X11 specification? That was the point of no return for me.
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.
>>105783318project
- 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?
>>105792524The 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)"
>>105788725if (Add(1.0, 0.5) > 1.0)
printf("Not ACK.");
else
printf("ACK!");
C just worACK!
>>105789342std::enable_if is basically obsolete since if-constexpr and concepts.
>>105794234I honestly find C++ bizarre. Like, it's electronic judaism. I mean, gas the C++ programmers, holy war now.
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));
}
>What are you working on, /g/?
cheaper alternative to volume raymarching shaders for potato GPUs (i.e. phones)
>>105794517shh 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);
}
>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!
>>105794798fixed
#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);
}
>>105794840improved
#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);
}
programming is like magic, like crafting new spells.
problem is that it feels like all spells already exist
>>105794986>All the books have ever been written>All the movies have already been watched>All the music has already been played
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
>>105793630I 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).
>>105795004bro 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
>>105794986Anon, that is the most NPC thing I have ever heard from anyone.
Do you even have a soul?
>>105794836It'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());
>>105795072Resurrection of gmod machinimas from 15-20 years ago that turned into brainrot explosionslop for toddlers.
ida
md5: 6e9f436a5f1418cfb6006ca2417ac40f
๐
>>105794986If 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.
>>105795004exactly, glad you understand
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?
>>105795306How the fuck are you going to use a database without a front end?
```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;
}
```
>>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
thoughts on std::expected? is it worth sacrificing RVO over?
>>105796303Sometimes 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?
>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
>>105795306use sqlite and a database to store application data and config to disk
more common than you'd think
>>105796336if it's hilarious then how come i'm not laughing?
>>105796076why 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.
>>105797010Because your autistic mind wants to protect itself from its impending future.
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.
>>105797334non-GPL license
>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
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
>>105797334A code of conduct
>>105795306Package manager.
>>105789205Is that fucking perl? Also, what's wrong with the du UNIX program?
>>105798391He's too retarded to use it.
>>105798578So what's stopping you from using du on all subdirectories?
>>105798727The fact that, despite the requirements being posted already, you cannot come up with the necessary flags.
>>105798745Works just fine on my machine.
>>105798751Post output.
Also post credit card info.
>>105798890>moving goalpostsWe were talking about du.
>>105798927Yeah, I'm using du. And it's faster than writing some inane scripts.
>>105799024You use find and sort. That's goalpostmoving, autist. Expect to be turned into fertilizer for the good of humanity.
>>105799048No, that's just using du as intended. Stick to GUIs, retard.
Fertilize my tomatoes, autismo.
>>105799109What 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.
>What do you need tomatoes for?
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.
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
>incompetent autismo is running his mouth
>pretending he won't soon be fertilizer
What are some good project ideas to learn kubernetes?
>>105799297Serverless registry dumper.
>>105799297there is nothing good about using kubernetes, ever
>>105799317Can you provide an example?
>>105797039what 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
>error C1128: number of sections exceeded object file format limit: compile with /bigobj
I think I went too far with metaprogramming bros
>>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 whateverA 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
>>105799428Sorry, I'm not employed enough to know how to spin up Windows Server 2003 on kubernetes.
>>105799847You and your suggestion are useless.
>>105799896So is kubernetes.
>>105799903People employ it though, unlike you.
>>105799914The difference is that I am not retarded.