[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1731518748965402.jpg (231 KB, 1287x1800)
231 KB
231 KB JPG
What are you working on, /g/?

Previous: >>103161905
>>
>What are you working on
Losing my will to bother.

void foo(int p)
{
if(!p)return;
int a[15];
int x0[64];
asm
(
"nop"
:"+m"(x0)
,"=r"(a[0])
,"=r"(a[1])
,"=r"(a[2])
,"=r"(a[3])
,"=r"(a[4])
,"=r"(a[5])
,"=r"(a[6])
,"=r"(a[7])
,"=r"(a[8])
,"=r"(a[9])
,"=r"(a[10])
,"=r"(a[11])
,"=r"(a[12])
,"=r"(a[13])
,"=r"(a[14])
);
}

push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp,0x148
test ecx,ecx
je LABEL
nop
LABEL:
add rsp,0x148
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret


Why the fuck are stack shenanigans happening BEFORE the branch?
>>
>>103184209
>asm instead of __asm__
>LABEL
larping

>>103184086
cute, would breed 3 children.


>>103184086
Am I going insane or is it impossible to go backwards in a UTF-8 byte stream?
Like say that you have a quote character and you want to go backwards in a loop to count the backwards slashes prior to it to see whether it holds semantic meaning... impossible, you have to keep state.
>>
>>103184583
>going backwards in UTF-8 is impossible
>larping
Yeah, I guess you can take a flying leap.
>>
File: FB_IMG_1731297836942.jpg (112 KB, 1080x998)
112 KB
112 KB JPG
ABSOLUTE WIN
>>
>>103184681
I can't wait for the Supreme Court to rip itself apart over this.
>>
File: 1730654767664.jpg (133 KB, 736x736)
133 KB
133 KB JPG
>converting from 5/6/5 16-bit color to 8/8/8 24-bit
>image is missing red channel
>took me 30mins to realize u8 r = pixel & 0xf800 will always be zero
>>
>>103184209
from http://6.s081.scripts.mit.edu/sp18/x86-64-architecture-guide.html

The callee is responsible for perserving the value of registers %rbp %rbx, and %r12-r15, as these registers are owned by the caller. The remaining registers are owned by the callee.
>>
>>103184752
Wanna delete this post before you no longer can't?
>BEFORE the branch?
>BEFORE
>>
>>103184583
>Am I going insane or is it impossible to go backwards in a UTF-8 byte stream?
I remember finding unget is only guaranteed for 1-2 bytes in some streams
>>
So has this thread always been the samefag moderator and a couple of (based) blogposters?
>>
>>103184086
I fucking love Douki-chan
>>
>>103185197
No, people used to actually post progress they've made on projects here
>>
File: 1720867530913914.png (14 KB, 195x197)
14 KB
14 KB PNG
>6 pm
>blasting drum n bass
>dark room with color reds all over
>enough money in the bank not to have to wagecuck for a good year
>shitty personal project that will never end up anywhere on the screen
it's programming time
>>
>>103185197
Who and who?
>>
File: 1702577076310365.gif (4 MB, 300x533)
4 MB
4 MB GIF
>>103185430
Living the dream
>>
>>103185197
There used to be tripfags but we killed them all
>>
File: 1717101882808.jpg (49 KB, 896x491)
49 KB
49 KB JPG
>>103184086
any of you write a program that was kinda non performant, and it made you consider buying a new computer, but then you dedicated more energy to optimizing your code, and you threw the new computer idea out the window?
>>
>>103185430
Comfy. Especially that cushion of 1 years expenses. I have 7 years saved, but I'm still wage fucking for some odd reason. Why bros, why?
>>
File: cat.jpg (98 KB, 934x1243)
98 KB
98 KB JPG
how to keep motivation for project?

Been working on my compiler but progress is getting slower, it takes ages to implement something end to end now and I haven't even gotten to the tedious part
>>
>>103186631
should have accomodated everything
.t C function pointer syntax irreperably killed 3000 lines of logic, making me rewrite everything with muh new shiny test-driven approach and slowly putting the whole thing on hold
>>
>>103184681
>trump says
he isn't actually going to do it, he's "negotiating."
>>
in win32 does defining unicode just swap out all the ascii versions of win32 functions for the wide versions, or is there other magic going on that I should be aware of?
>>
>>103186738
this, he made all the same promises during his first term and in the end did nothing
>>
>>103184086
strange day, procrastinated a bunch but still got a utf8 json decoder, encoder, fetch/add/remove library done,
I dont even know why i did that, i was autistic about running a long algorithm on machine code instead of php but bruh,
>>
tcl fucking sucks.
>everything is string but all our string operations suck
>>
>KUSER_SHARED_DATA
Surely this massive blob of shit is useful for something
>>
>>103187267
I hate strings so much it's unreal
>>
Haskell?
>>
>>103187385
You know it
>>
>>103184209
because you wrote retarded code that sucks, kill yourself
>>
>>103187433
you could use this reply to any post in /dpt/ in any thread since the dawn of time
>>
>>103187286
much easier to determine the windows version than the "official" "approved" "methods"
>>
it's weird that this page
https://graphics.stanford.edu/~seander/bithacks.html
does't have the trick to align to the next multiple of a power of 2. Is it too simple for this page or what?
>>
>>103187875
Meme page, too many ways to do it.
>>
>>103187267
same thing with list/arrays since a string containing space can be used as a list/array
it also sucks that it doesn't have a filter function and that all the most important functions have a fucking brain dead retarded argument order
the retarded fake hash table with $var() also sucks and mutating a nested list also sucks
perl is just better and if tcl's strings and data structures worked more like perl's it would suck that much
>>
>>103187912
>too many ways to do it
I only these 2
(value + pow2-1) & ~(pow2-1)
(value + pow2-1) & -pow2
>>
*know
>>
>>103187990
You probably won't need more than https://godbolt.org/z/n1qnWGWsW on non-meme system.
>>
>>103187965
>perl is just better
Friends don't let friends do Perl.
But you, I don't give a fuck about you. You want Perl? You use it.
>>
>>103187990
>value = 9
>pow2 = 4
(9+4-1) & -4 = 12 & -4 = -4
0001100 & ...11100 = ...11100
!= 16

?
>>
how do you become a bit wizard?
>>
>>103187965
>the retarded fake hash table
It's definitely a real hash table. It might not be doing what you think you want, but it's real enough.
>>
>>103188068
>>103188087
next *multiple* of a power of 2
>>103188073
is *is* better with strings and arrays
>>
>>103188140
oops, still doesnt get you to 10 does it
>>
>>103188087
>12 & -4 = -4
It's 12 on a standard 2's complement machine. All the zero bits in the top of the 12 cancel out all the one bits in the top of the -4.
>>
>>103188131
what I really meant is that it's not a first class citizen or something
>>
>>103188160
>still doesnt get you to 10 does it
Not if you are using 4 as the power of 2 to round up to a multiple of.
>>
>>103188168
>it's not a first class citizen or something
Ah. You want a dictionary then?
>>
>>103188166
oh right i am sleeping
>>
>>103188185
I guess? but yes, the dict function they made fixed the issue with original $name(index) thing. It probably was an issue with the original tcl's evaluation though. The way their everything-is-a-string thing works is diametrally opposed to the idea of references and references are what is needed to have real nested data structures.
>>
>>103188268
it's also a problem for lexical scoping
>>
File: 1730167750913745.jpg (230 KB, 1240x1754)
230 KB
230 KB JPG
>>103187385
>>
Man I'm so mad. I spent a whole bunch of time creating a GUI in Nuklear + X11, but now I cant because there is a bug with how images are clipped in scrollable content. So now I'm learning FLTK and it's such a downgrade for ease of use...
>>
>>103188268
>The way their everything-is-a-string thing works is diametrally opposed to the idea of references
Yes. It's a different value model entirely, where values are immutable and don't have individual identity. This lets the implementation share values a lot more; they're actually references, but with copy-on-write semantics so other uses can't observe the changes you make.
>references are what is needed to have real nested data structures.
No. You just seem to think you need to have ways to reach into a value deep inside a structure and modify it. I've always found that to be a source of subtle bugs.
For the cases you need something that complex, you've got variables and you've got objects. Those are named entities, and mutable.
>>103188278
No. It just doesn't and that's not about to change (because fuck knows how much user code would be broken by that). Most of the time you don't need lexical scoping as you have the ability to run code in parent scopes (and only Perl has Perl's retarded rules for non-my variables). You also don't typically need it for callbacks as you've got coroutines instead, and they're nicer than a nested stack of inherited-scope callbacks (or promises) as you can use genuine control flow for the state machine model.
There's probably cases I've not covered. Don't care right now.
>>
File: 1727969750563631.png (66 KB, 392x324)
66 KB
66 KB PNG
wtf I haven't even finished learning the last one yet
>>
Been trying to get the endpoint of a website so I don't have to scrape it. Got an Algolia search endpoint so I tried using it. For some reason it works with some items but not others. Hoping anyone here who has used Algolia can help me out.
>>
>>103188730
>c++
c99 is all you need
>>
>>103188730
they havent even implemented 23
>>
>>103188730
Instead of adding new features, C++ needs an update where they just deprecate the shit out of everything until a core useful subset with no redundancy is left.
>>
File: 1731617277978958.jpg (408 KB, 2048x1918)
408 KB
408 KB JPG
>>103188730
><debugging>, <hazard_pointer>, <inplace_vector>, <linalg>, <rcu>, <text_encoding>
>std::quecto, std::ronto, std::ronna, std::quetta
Amazing sepples
>>
>>103188921
>check code in 2030
>wow it's a collection of mediocre algorithms I could come up with on my own
What's even the point? If collective of dozens of competent programmers cannot do better than one, it should be a 3rd party library
>>
C# code is pretty fast, turns out
I love JIT compilation!
>>
>>103188921
>marrying (legit) geek qt3.14 and making the smartest kids in the world just to have us all starve in the imminent depression
sounds very comfy
>>
File: yes.png (83 KB, 205x183)
83 KB
83 KB PNG
>>103187385
yes
>>
>>103188644
>You just seem to think you need to have ways to reach into a value deep inside a structure and modify it.
Yes you can have immutable values and data structures but fuck that.
>For the cases you need something that complex, you've got variables and you've got objects. Those are named entities, and mutable.
That doesn't solve the problem of having mutable nested data structures. For example a struct containing a stack and a hash table, among other things.
>Most of the time you don't need lexical scoping as you have the ability to run code in parent scopes
That would be a good response for the inability to pass things by references, but for lexical scoping?
But yes functions have their own scopes of course, I'm not sure what I was getting at it's not fresh in my head. I do remember that there was problem concerning $name(index) and nested data structures.
>Perl's retarded rules for non-my variables
non-my variables are global variable. maybe you're thinking of the keyword local that doesn't change the fact that the variable "local"ized is global. global variables have their use but in most cases it's a bad idea to use them anyway, as you should know already.
>>
>>103188801
This honestly
>>
How are you preparing for Advent of Code?
>>
I am not (going to participate)
>>
>>103189957
Catching up on days I've missed from older years. Zoomer bug larva killed this /g/ tradition last year so not holding my breath on the threads being even remotely enjoyable.
>>
What's your favorite lang and graphics api for gamedev?
For me, it's... uh... I haven't found one yet to be honest
>>
>>103184209
>Why
Because compilers are retarded and you simply shouldn't trust them for performance critical stuff.
>>103184583
I don't understand what you mean by "keep state" or why this is hard at all. You can literally just AND the most sig bits of utf8 bytes to check what kind of byte you're in. You can count backwards slashes easily, you're just over-complicating things in your own mind.
>>
>>103190030
This. Work on things that are actually useful.
>>
>>103190394
i thought that the top bits signaled only when the encoding length would stop though?
Like, the second byte could be 110..... and be a two byte encoding or it could be 111..... or 000..... or whatever and keep going, thus making it impossible to move backwards, i might be wrong, i havent tested shit yet though utf8 is supposed to support 1 million+ characters off of that 4.3 million 4 bytes offer so removing 1+3+4+5 bits from the equation completely instead of only one of each's states seems strange
>>
what's the alternative for tcl/tk that can be embedded in C or has C bindings?
>>
>>103190945
There's always Lua
>>
>>103190420
Nothing I do is useful.
>>
>>103190968
there's no GUI for lua though
>>
>>103190983
yeah never mind. GUIs are tough.
>>
>>103190976
psyop
>>
what's the syntax for formatted code
`int foo = "bar"`
<code> #define PP cock</code>
>>
int a;
fug
>>
>>103191410
read the sticky
>>
>>103184086

I LOVE U DOKI CHAN
>>
>>103184086

I can shit out binsearch, mergesort, dfs, bfs and twosum on a whim.

What else should I do to prepare for interviews?
>>
>>103191826
not reddit spacing
>>
>>103191826
Instead of learning all that, you should have gone to meetings / parties and connect with the lead.
He would hire you and say that they will teach you what you don't know.
>>
>>103191915
This, having a job was never about any skill other than bootlicking someone higher on social ladder until there's enough of your drool on the boot that it inevitably flows down and makes them slip which is when you kick them down, beat them up and steal their suit, not your problem anymore, onto the next victim.
This is why normalfags mock people who are unemployed, they don't care what you do or what you can do or what you like doing, all they care is social ststus, the more money you earn, the better you are, that's why rich successful people who never worked a day in their life are highly regarded, whereas a humble NEET who spends less per year than the faggot wagie berating him per year is kicked down further on the spot, nothing else matters.
If you went to university and found 0 people to fuck over by being better nepotism candidate than themselves, you wasted your time, congrats.
>>
I spend my time making numerical algorithms for fun and to go fast as possible but I find many programmers don’t know or care about them. I’m not sure why not.
>>
>>103192318
all they care about is money, you should only be polite to your coworkers, but leave it there, because you can never be friends, anyone with actual aspirations in life is either your manager or someone even higher up, cattle aren't it
>>
>>103191826
actually building shit?
>>
I don't know why but I love Haskell so much
>>
File: 1707817195853629.png (1 KB, 420x27)
1 KB
1 KB PNG
Anyone familiar with vim/neovim and lsps and stuff? I'm using clangd, everything seems to work right, it'll autofill in a function signature like this, I can immediately type and fill in the first argument, but then I'm stuck with no way to move to the next argument to fill in? There has to be a hotkey or something to move to the next parameter but I'm not seeing one.
>>
>>103187443
because [sic] you wrote retarded [sic] code that sucks [sucks what?], kill yourself [sic]
>>
>>103190241
What the fuck really? Damn. I didn't go last year because I was too busy with work
>>103189957
Writing C++ utility file
>>
>>103190241
AoC was always cringe.
>>
>>103193201
Should be <Tab> and <S-Tab> by default in nightly. Check
:h vim.snippet
. Also check blink.cmp it's really simple and just works but still kinda new.
>>
>>103184086
I'm coding my own CAD software with the goal of making it usable for 3d printing

C# and avalonia (but I'm writing base libs in plain c# so I might change frameworks)
>>
llvm style? (y/n)
>>
>>103194021
I hate homo apple cock suckers so fucking much
>>
Are there idiot proof spring security guides that help you secure certain endpoints behind user auth and authorization? The more I look into the matter the more confused I get. Someone recommended me keycloak as a standardized authentication method but again all the info I found is confusing and when I try to do just as an example says I receive some generic error when compiling the code because the guide has been based on a past springboot/keycloak version
>>
>>103194021
I'm assuming that's the same as Clang style, in which case I use it just because it's ubiquitous and there's a lot of tooling around it. Basically just use any popular style that can be enforced by tools. Or don't. Who cares.

>>103194067
I don't think LLVM is owned by Apple.
>>
i have discovered pretty based trick in c/cpp
>#define Breakpoint_a() asm("a:;nop")
and in your .gdbinit
>set breakpoint pending on
>break a
and it always put a breakpoint for you excatcly where you wanted if it was moved
also allows you to actually break at the end of the scope
>>
>>103194021
https://youtu.be/ns7jP1-SRvw
>>
>>103194253
I don't know who that is
>>
Complete noob here.
"Completed" by first ever project today.
I've only been coding for 3 days but I've been watching BroCode pretty religiously for Java and Swing concepts.
In a completely unoptimised way (obviously, but I want code that runs first) I managed to make a simulator for War the card game.
>GUI
>Sounds
>Animations
>Game Logic
>Timer
I'm happy.
>>
>>103194253
That's actually pretty clean for an OOP project on the scale of LLVM.
>>
File: 1641993143074.gif (183 KB, 1062x1218)
183 KB
183 KB GIF
Bros help. As someone with little programming knowledge, how would I go about if I want to build a lightweight desktop widget that displays a few lines from a series of texts that periodically changes based on a length of time selected by the user? Kind of like a Bible verses app but not the Bible. The thing shouldn't be heavier than a few megabytes. I mean I know it's just displaying a string from an array of arrays, but how does one even go about creating a desktop widget? Is this possible with just some Python and Java knowledge?
>>
>>103184086
>What are you working on, /g/?
Learning about how to multithread, instead of studying kotlin and c++ for my exams.

>anon stop
No, I need to go faster! There's no time to learn stupid syntax! More speed! I am the lizard king!
>>
So maybe I'm learning disabled but I've been trying to learn python for years and I still don't know a lick of it. Is there some easy way of writing programs? How did you learn to code? At what point did you start writing 100+ LOC programs?
>>
>>103190746
nvm bros you can go backwards in utf8
>>
>>103195151
When you see FUNCTION(number) you run "man number FUNCTION" in your terminal
nanosleep(2) for waiting the set amount of time
read /usr/include/linux/random.h for generating randums
open(2),read(2),write(2),close(2) and mmap(2) for general programming

with qt this is piss easy until you have to integrate it into the "desktop widgets" system, no clue about that
>>
File: 1703496989816.jpg (295 KB, 1290x1287)
295 KB
295 KB JPG
>>103195579
I don't know what any of this means. I'll just give up.
>>
>>103195327
I started out with python, never even managed to write a working program with it unironically, then i picked up c++ and did jeetcode-light websites, then i started writing 500~LOC working scripts in c++, then I wrote a big program in c++ and ported it to C (it will work someday) because fuck sepple and now the thing I m̶a̶d̶e̶ ̶a̶ ̶V̶1̶.̶0̶ ̶o̶f̶ ̶b̶u̶t̶ ̶a̶c̶c̶i̶d̶e̶n̶t̶a̶l̶l̶y̶ ̶d̶e̶l̶e̶t̶e̶d̶ ̶a̶n̶d̶ ̶a̶m̶ ̶a̶g̶a̶i̶n̶ making requires multiple languages

Learn C, its too simple to fail anybody and instead of interacting with cretin larpers telling you "yeah programming hard give up like me" you will get autistic cretins pressuring you into learning and making things
>>
>>103195590
you could also just fucking look at the upper part for more than 20 seconds and google "qt" you black gorilla nigger
>>
File: 1731689169266301m.jpg (76 KB, 777x1024)
76 KB
76 KB JPG
>>103187038
Okay, Vijay.
>>
>>103195650
>pic
They're framing it like it's a problem...
>>
>>103195650
Damn now they'll have to join the central indian agency instead
>>
File: 2024-11-08_20-16.png (319 KB, 472x416)
319 KB
319 KB PNG
This is my C++ math library I'm making from scratch.
https://pastebin.com/LV6krt2L
What are your thoughts on it?
Also, am I overengineering it as I tend to do with C++ code? Should I just use C instead? I'd use C instead but the lack of features I take for granted in C++ (such as std::vector, std::thread, std::unordered_map, std::string, templates, lambdas, etc) drives me away.
>>
>>103195716
the matrix multiplication implementation is extremely naive
Look into actual matrix multiplication algorithms and if all you find is circlejerking design one yourself based on bitshifts
>>
File: improvers.png (13 KB, 463x333)
13 KB
13 KB PNG
99.9% of this thread
>>
>>103196000
prayer is the greatest form of debugging
>>
File: 1731694051-978x248.png (47 KB, 978x248)
47 KB
47 KB PNG
The idea presented by the paper "Trees that Grow" seemed like a great way develop a language from an initial syntax tree. I'm trying it out right now. I'm fairly early on in the process so I'm not sure I have enough experience with it to say if it's worth it but it seems like a lot of up front boilerplate. Has any anon ever developed a language with this approach and was it worth it?
>>
>>103196163
GHC uses it
>>
>>103196167
I knew that going in which is a good endorsement that it's worth a shot. I suppose I'm mostly curious in anons' personal experiences and thoughts with it.
>>
Hear me out
Add a <-> operator that swaps variables
This would obviously only be sensible in reference based languages
>>
>>103196349
std::swap already exists
>>
>>103195327
Java is the easiest language for me to wrap my head around. Python infuriates me and with Java I'll have a good start for C++ once I figure out garbage collection and header files.
What helped me was to read about concepts and try to implement them based off the documentation and really really thinking about why it works, not just hoping it does work. Avoid looking at tutorials, think of something simple in real life and try to code that.
>>
>>103196349
Collections.swap(); already exists
>>
the exchg instruction is pointless in the local variables model.
>>
>>103196542
>Python infuriates me
Why?
>>
>>103196617
Indentation and it seems too simple in language that my brain doesn't like it
>>
>>103196662
Yeah, the whitespace is ugly, I'll never argue against that
>>
Before trying to write data structures and algorithms, try cleaning your room first.
>>
>>103197089
What about the lobsters Dr. Peterson?
>>
File: tarnished.png (377 KB, 640x640)
377 KB
377 KB PNG
>>103197089
>clean your room
>the room
>>
File: 1709750747835124.png (469 KB, 1177x1296)
469 KB
469 KB PNG
wtf did cmake mean by this am I compromised now?
>>
>>103197302
I can still see some trash in that pic
>>
>>103197485
>running anything but your own or GNU or BSD software as root
lol
>>
>>103197485
>windows
>am I compromised now
anon, I...
>>
>>103197485
Message received
Glory to Chaiwan
>>
>>103195650
You better have been 12 when he was elected the first time. He let more people in than Obama did in his first term.
>>
a little over 2 more weeks until advent of code my niggers
>>
I spent over a year coding a library no one will ever use (this most likely includes me). I did it for free in my spare time.
this is basically about me: https://www.youtube.com/watch?v=qXD9HnrNrvk
>>
>>103197709
at least you had kids, right?
>>
>>103197089
sounds irrefutable
>>
>>103197498
So clean it up woman
>>
>>103197702
I need to DNS block it this year. don't want to waste any more time in this mud pit.
>>
File: 1731700852025465 (1).png (342 KB, 640x640)
342 KB
342 KB PNG
>>103197779
Done
>>
File: scribble_giger.jpg (399 KB, 820x1181)
399 KB
399 KB JPG
>>103184086
code has been simplified
time to compile and test...
>>
>has useless trash in room
>lesson 1: clean your room
>throws shit out
>lesson 2: make your room beautiful
>brings all the shit back
thank you, doctor
>>
>>103191826
python isnt a real language anon. Any tard and 15 mins can do the same.
>>
>>103197485
whichever fuck at microsoft decided to build the entire os around utf-16 is retarded
>>
>>103194244
You can do this with normal labels in C as well, they're scoped to the function they're in, e.g. break func::label will set a breakpoint on the label label in func
Useful especially with gdb python scripting
>>
(define (λ)
(let ((μ (quote (λ))))
(list μ μ)))

(define (ζ x)
(if (eq x (quote (λ)))
(list (quote (not (λ))) (quote (λ)))
(list x (quote (not x)))))

(define (φ f)
(let ((x (f (quote (λ)))))
(if (equal x (quote (λ)))
x
(φ f))))

(define (ψ)
(define (ξ x)
(list x x))
(ξ (quote (ξ))))

(define (ω)
(define (τ)
(list (quote (τ)) (quote (τ))))
(define (ρ f)
(if (equal f (quote (τ)))
(list (quote (not (τ))) (quote (τ)))
(list f (quote (not f)))))
(ρ #'τ))

(define (π)
(define (σ x)
(list x x))
(define (θ f)
(let ((x (f (quote (σ)))))
(if (equal x (quote (σ)))
x
(θ f))))
(θ #'σ))


>tfw tfw (λ) returns ((λ) (λ)) returns (((λ) (λ)) ((λ) (λ))) returns
>>
>>103197709
I didn't know they were so cute
>>
>>103189446
>I do remember that there was problem concerning $name(index) and nested data structures.
You don't put those inside other arrays, and there's never been a supported way of doing it. (It actually was possible to do so at one time, but that was a bug and the only syntax for doing it was gross.) "Arrays" are defined to be associative maps from string keys to simple variables.
Most of the time, using some sort of structured value as the key works well enough. When you want something more nested, you've got dictionaries (which are insertion-ordered maps) that were new in 8.4 (which is now two decades old so "new" lol) where you can use any value at all as a key and stack them up inside each other as much as you like. (The test suite takes that to stupid levels of nesting; you don't need to.) The only real restriction is that you can't put a value inside itself, either directly or indirectly; if you try, you end up putting a copy inside instead.
>>
>>103190945
The main option for doing a GUI in C right now is GTK, from the people who reject features for not having a use case they can comprehend.
Tcl/Tk 9.0 should be buildable into a single DLL/shared library without external support files. Bind your operations as commands and your globals as linked variables and you can use a very thin layer of Tcl code to hook up your application code to Tk. Direct binding's possible, but major annoying and not worth it; much easier to have a little extra binding layer.
>>
I feel like I should be avoiding switch statements but I can't explain why...I just feel like I shouldn't.
>>
>>103198990
You could test to see whether your feelings are true
>>
>>103198990
based. if is binary, good. switch is poly, bad
>>
>>103199074
A sequence of if-else clauses is binary the same way an orgy is monogamous, whereas a switch is exhaustive in a single step which is more akin to a gangbang
>>
>>103198990
when using an enumeration i use them, otherwise i dont.
Has anyone tested whether gcc ends up doing something like
movl 32(%rcx),%eax
lea 85(,%eax*8),%eax

for code like
enum{
PRX_NIGGER=85,PRX_COCKSUCKER,PRX_FAGGOT,
};

?
>>
>>103199037
bool doesLikeSwitchStatements(bool v) {
switch (v) {
case true: return true;
case false: return true;
};
throw std::runtime_error("You VILL use ze switch statements. And you VILL like it!");
}
>>
(,%eax,8) or whatever
>>
>>103199183
>warning no default branch
wojak.png
>>
>>103199183
what the fuck is an std::runtime_error or a throw
>>
>>103199225
its like longjmp but slower
>>
File: file.png (503 KB, 907x851)
503 KB
503 KB PNG
>>103197856
>Never forget the big boys
>>
if you still believe in compilers your gnot gonna make it
>>
Little by little, writing my own 6502 Assembler in Standard ML (will rewrite it in C++ for my 6502 simulator). Got the first pass down, updating the symbol table and getting the right bytes for them. Since a lot of instructions have they addressing mode, I'm using a deque for addressing modes on first pass so that on second pass I don't need to waste time finding out what are the addressing modes again.
I have been putting this project away for a long time so I'm happy I'm finally doing and almost finishing it.
>>
>>103199611
>simulator
why call it that and not emulator
t. a genuine not knower
>>
whats a good first project? i rike video games.
>>
>>103199587
>gnot
I'm gnot a gnelf
>>
>>103199690
snake written in JS for the browser
>>
>>103199696
i was thinking of something among the lines of gg deals if i wanted to make a game i would just boot up poonity
>>
File: GMwIZTHWQAAlSAY.jpg (1.67 MB, 4096x3072)
1.67 MB
1.67 MB JPG
>>103195327
there is no secret, you just have to chose something to build and build it. Then at some point while you're building it you realise you made the most retarded choice in the world when designing your code and either restart (unlikely) or just abandon ship and maybe revisit in a few years. If you want to go faster read how others did it, you learn a lot that way but NO TUTORIALS. Just think about how you'd do it and if you don't want to rollback 5h of coding check online see of the thing you're doing is done.
Each time you'll find that the LOC before you hit the wall get larger and larger and don't hit the walls as hard, you refactor more quickly (tests help a lot for this, particularly for dynamically typed langs).
Btw the walls I'm talking about are things like too much coupling, dogshit interfaces, retarded datastructures, overabstraction, etc...
>>
File: weht.png (255 KB, 471x451)
255 KB
255 KB PNG
is real programming hard than gamedev programming?
>>
File: 1705836717227906.jpg (38 KB, 640x960)
38 KB
38 KB JPG
flunked out of a CS degree over 10y ago, went as far as implementing red and black trees in C iirc
what's the best approach to get back in the saddle? grind leetcode?

I don't want a job, I just want to get proficient at it. I remember how things work, but I feel like a retard once I open a text editor and start typing
>>
>>103199675
Because they are not the same. I only care about the state of the CPU register and some memory "connected" to after running a program for 6502 ASM study. Thing cycles, etc are not important. Since I'm not trying to emulate the CPU, it's a simulator for analysis and study.
>>
>>103199787
"real programming" includes large parts of "gamedev programming" including all the low level parts since it's technically realtime multimedia application dev but a lot of gamedev "programming" isn't real programming
even godot's bootleg python pigdin is more respectable than unreal or unity blueprints
>>
>>103199778
the unspoken wall is tilting the balance of tested code to written code too steep in favor of the latter, good luck pulling code out of x modules to make them testable with the rest of the code you have not already tested, "pushing through" is NOT an option never get fooled, you just end up with more shit to test nothing ever suddenly comes out perfect after being shit aside of a recursively descending text parser
>>
>>103199847
fuck the bus latency eh?
>>
>>103199787
gamedev is real programming
>but he is not writing opcodes for instructions the assembler doesnt support >:(
back in the day BASIC was machine code.
>>
Which is best for simple indie gamedev:
>standard C
>C-style C++
>semi-oop C
>modern C++
Looking for something that strikes a good balance of performance and ease of use.
>>
>>103200161
a gun
>>
>>103200161
try all four pick whichever you're most comfortable with
i think dearimgui has a link to the C-style C++ manifesto, the ISO core guidelines are basically a good definition of "modern" C++
would absolutely not recommend doing OOP in C, literally the only reason people ever do that is they're flattening out a lang with OOP features to a C ABI, it's the only one i feel like is objectively trash

for me it's C++26 with https://github.com/bloomberg/clang-p2996/blob/p2996/P2996.md
>>
>>103200161
C++ is the dark souls of programming languages
>>
>>103195327
>is there some easy way of writing programs?
watch some youtube tutorial and do what they do with slight changes to test out the underlying concepts.
>How did you earn to code?
90% self-taught on youtube and doing small projects that I was interested in. I basically no-life'd it, studying about 10 hrs a day. the other 10% were mentors that helped me, especially concerning high level concepts and how they connect.
>At what point did you start writing 100+ LOC programs?
Within a month- I was being paid to program within 3 months. That was 3~ yrs ago.
>General advice
If you're not sincerely interested in programming, and you're doing it because the salary is 90th percentile, you better really love money or change your path. if you are sincerely curious and want to do something you're passionate about all I can tell you is to chase your curiosity and learn just what you can do with these tools and how they work.
>>
File: scrapped project.webm (3.82 MB, 1536x860)
3.82 MB
3.82 MB WEBM
I'm a codelet who only knows Unity. I tried programming outside of it for the first time and got filtered at the part where I needed to install the steamworks API for my cpp project. Is it over for me? I don't like programming, I just see it as a means to an end for shit I want to make.
>>
>>103199712
>>103199690
depends on the games you like. maybe a damage calculator or max life calculator? maybe you should look into basic pixel scanning and input automation, if you're up for more of a challeng.
>>
>>103200391
oh i could do something like an autobattler or turn based game. should i go with c++ or pickup python?
>>
>>103200344
a lot of programming is dealing with delayed gratification in a mature way. occasionally you'll realize you've been quickly putting things together and getting them to work- it is points like these you should stop and smile about what you've done so far... even if you did something as supposedly simple as getting a cpp api to work you should congratulate yourself. if you beat yourself up whether you succeed or don't what is the motivation?
>>
>>103200488
I just never thought that setting up libraries would be such a pain in the ass and so manual. It's 2024 and I still have to move a bunch of files around manually by dragging and dropping.
I guess you're right, once I figure this out I'll know how to do it better next time.
>>
File: doesntfeelsafe.jpg (30 KB, 512x380)
30 KB
30 KB JPG
>decide to learn vim
>you know what i'll install that basic kickstart.nvim one since it's "basic"
>watch the recommended basic video in the repo readme
>goes from "do the tutor xd" to extreme detail about how to configure the whole thing and lsps and shit in lua

perhaps this was a mistake and i am too stupid for this.
>>
>>103200344
>the dark souls slide that makes you unhittable
based

Install arch, there is a binary package for steamworks in the AUR: https://aur.archlinux.org/packages/steamworks-sdk

You might get filtered if you know nothing about general computing like resolving domain names or what persistent storage is
https://wiki.archlinux.org/title/Installation_guide
>>
>>103197869
>>
>>103200439
>oh i could do something like an autobattler or turn based game
that's a good idea. personally I suggest python. a lot of things in C++ are difficult to work with when first starting out, but it depends. if you have experience with one of these languages use that one.
>>
nvm i am blind
>>
File: cpp_dependency_resolution.png (401 KB, 1924x1580)
401 KB
401 KB PNG
>>103200344
like 99% of people including those who have been formally taught the language struggle with the concepts behind C++ dependency resolution and build systems
it's probably the number one question people ask
for some reason explaining you need to add flags for the include directory, library directories, and individual library file is never enough
i'm not typing it out again, pic related is the quick rundown

build systems help manage that, everyone uses cmake even though it's shit
in cmake you add library directories (same idea as explained in the image) with target_link_directories, include directories with target_include_directories (same idea as explained in the image) and link to libraries with target_link_dependencies
sometimes a library might include a cmake installer which lets you use find_package to load a fake library that sets the other two automatically
>>
>>103200524
I gotta learn a whole ass operating system? I'll switch to it eventually but I'd rather learn how to do it the proper way in case I get a job (most likely working in windows)
>>103200574
Thanks.
>>
>>103184209
what's this supposed to do? what's asm and why do you need 15 of those?
>>
>>103200161
C style C++
Operator overloading for vector/matrix types is too convenient to give up IMO, even if you use nothing else from C++
>>
>>103195716
Your matrix multiplication isn't good, as mentioned. But it's ok as a naive start because you have to start somewhere.
The big picture is that you want to start by breaking your gemm operation up into conformal blocks (look this up).
Once you've got that sorted, you want to optimise these blocks to minimise moving data between the registers and main memory. So you want to pick a size of these blocks which fits in the registers. There are some subtleties here, so it'll require some reading.
The goal should be to recast C += AB into a sequence of rank-1 updates to C. This is good because rank-1 updates can be done as a series of axpy operations. You can then optimise these axpy operations because all they are is going to be FMA operations.
So the trick to really high speed is to optimise these FMAs because you're going to be doing a lot of them. This is the idea of something called a microkernel. Normally you'll even write this in assembly.
>>
>>103195716
>>103201836
https://planetmath.org/conformalpartitioning
>>
>>103201836
Another point worth mentioning: Notice that whether you're storing matrices in row or column-major order (let's say wlog you're storing them in column-major order), when you do C += AB naively like this, you can access A by e.g. columns, but then you're having to access B by rows. This is something else to pay attention to. How would you solve that issue?
(Hint: there's a reason BLAS functions have all those arguments!)
>>
>>103200161
for me it's modern c++
>>
>>103184086
>Max depth: 8
Which way, nested JSON drilling man?

data["lines"]["skin"]["1"]["dialogue"]["1"]["japanese"]

data = flatten(data)

data["lines skin 1 dialogue 1 japanese"]

data = DDrill(data)

data>>"lines">>"skin">>"1">>"dialogue">>"1">>"japanese"

data >> "lines"
>> "skin"
>> "1"
>> "dialogue"
>> "1"
>> "japanese"
>>
>>103202142
const json = {
file: {
document: {
nested: {
1: {
value: 12
}
}
}
}
};

const pathString = "file document nested 1 value";

const val = pathString.split(' ').reduce((curr, key, i, arr) => {
return curr[key];
}, json);
>>
What do you use for your build system?
>>
>>103202393
cmake
it sucks but most stuff uses it which means handling dependencies is smoother and if you need to packages installed with vcpkg are adapted to cmake
and it's the only build system that supports obscure targets and cutting edge software
try building something with an experimental version of clang, maven shits itself
try building something for AMD's version of CUDA, cmake is your only real option
>>
>>103202674
>maven
*meson
got them confused
maven's a java build system i think
>>
C++ lads. Do you use exceptions, or make and use your own error function that aborts the program?
I tried both and it seems the latter is more optimal...
>>
File: 1700626945215847.png (37 KB, 499x322)
37 KB
37 KB PNG
>have project open in neovim
>run cmake on project in another terminal
>neovim start exponentially increasing in memory usage until I force close it
>it keeps happening
>>
>>103202393
xmake its fast and just works also uses lua
>>
>>103202739
I use asserts.
>>103202816
Clangd?
>>
>>103202908
>Clangd?
yeah, some kind of known issue? I see people talking about high clangd memory usage, but this is an actual runaway memory leak

I don't even know why they'd interact, it's not like cmake is editing the source files
>>
>>103202739
std::expected and error codes + a basic error logger spitting out the std::source_location
sometimes exceptions in constexpr code

>>103203051
clangd is the code completion engine literally everything uses for C++ and is a LSP server and a good chunk of clang itself
cmake's probably spitting out clang compilation databases which clangd then picks up
give it a chance to properly save the serialized AST or make a local .clangd config file and tweak the settings till you get performance you like
>>
Alright, let's say I have this in model/repository/whatever layer.
def get_post(id, transaction):
return transaction.query("select content from post where id = ${id}")

def update_post(id, content, transaction):
return transaction.query("update post set content=${content} where id = ${id}")

Then in my service layer, I want the ability to make a post all lowercase.
def make_post_lowercase(id):
sql.transaction(def (trans):
content = get_post(id, trans)
content = content.lower()
update_post(id, trans)
)

But there's a problem- my DB's default isolation level is READ COMMITTED, and I used SELECT not SELECT FOR UPDATE, so there could be a anomaly here.
I could update get_post to use FOR UPDATE, but I also want to use that function without locking for situations where I'm not updating anything.

Do I add a separate get_post_for_update? Do I add an extra parameter to the function and include FOR UPDATE if it's true?
Do I add an update_post_content function which accepts a lambda, does a SELECT FOR UPDATE, calls the lambda with the current content, uses the return value to do an update?
>>
reinventing the crab
https://github.com/carbon-language/carbon-lang/discussions/4273
>>
0 AND DROP * FROM post;--
>>
>>103204118
Don't worry, I know about SQL injection. I wrote python-ish psuedocode for my question but I'm actually using this:
https://github.com/porsager/postgres/
You can write
const [post] = await sql`select * from post where id = ${whatever}`;

and it'll be correctly handled (param replaced with a placeholder and sent separately). It's not just string interpolation, although it does feel a bit uncomfortable at first and could lead to errors when switching back to something that doesn't support this.
>>
File: hp6rU7Q.png (439 KB, 3000x2400)
439 KB
439 KB PNG
A sigwait worker loop is slightly slower and uses slightly more CPU than a nanosleep(0) atomic loop.
>>
>>103206108
what if you have 5 billion of them
>>
I cant understand how async works in c# those retards have overcomplicated the fuck out of it. Also it seems half the dumbfucks are confusing it for multi parallelism and the other half are confusing it for concurrency, neither of which it actually is.

In c++ it's just:
>This method blocks because it has to waits for a result externally
>Let's create two separate, non blocking, functions: One that simply starts the work and returns immediately, and one that simply checks whether the work is complete and returns immediately
>The user can now himself control execution while they are waiting for the external results to complete
What is wrong with this? Why do I need to mark methods as async and shit? What does it even do I still don't understand desu
>>
I am trying to figure out if I should be using singletons in python.

This says they are bad:
https://python-patterns.guide/python/module-globals/

I think the argument falls apart if you are creating something that requires some logic. I am creating a class that will update the db if a value changes. Otherwise it will load once and keep everything in memory. I know python doesn't really have encapsulation. That doesn't mean I want all my CRUD functions loose.

>>103206564
Safety rails. Async requires everything to be to Async. Variables are isolated to prevent deadlock. Nothing is wrong with what you put. It assumes that you will do something stupid. If I recall (from years ago) correctly it will completely crap the bed if you do something to update a label on UI from an Async function.
>>
is there something like sudo on windows so I don't have to keep opening an administrator console when using choco?
>>
>>103206564
>Why do I need to mark methods as async and shit?
because async sucks
https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
>>
>>103206619
Singletons are fine as defaults, but they must be override-able. In your case, you should have a kwarg defaulted to None in your constructor for the reference to the db, but uses your global singleton if not provided.
>>
>>103200320
Lmao
>>
>>103203640
Wow. Carcinization occuring in real time.
Is Carbon going to be literally just Rust but without the borrow checker?
>>
Starting to get tired of neovim. It's not really that good as an IDE-lite (ala vscode). Is there any good free IDE-lite (that's not vscode cause vscode is not good) that plays nicely with i3?
>>103207666
>Rust but without the borrow checker
as someone who's not into rust, this interests me desu
>>
>>103207968
>this interests me desu
it defeats the purpose
>>
>>103207968
emacs? zed? the latter barely has support and plugins for anything though
>>
File: PLC ladder logic.jpg (97 KB, 1280x720)
97 KB
97 KB JPG
Does anyone here consider PLC ladder logic programming to be real programming? I'm doing it for my course and I just want to belong :(
>>
>>103207968
What's wrong with vscode?
>>
Never really used gdb or lldb before but I'm not hating it. Doesn't seem like any of the lldbinits out there for nice UIs work with Windows though.
>>
File: 2024-11-16_17-25.png (41 KB, 1282x690)
41 KB
41 KB PNG
Finally, a sign of life after a day of trying.
>>
>>103205005
That's why I prefer to write parameter substitutions in
:colon_style
as that's not used by most programming languages as a native substitution scheme. One less potential fuck-up to worry about.
>>
>>103206564
>Why do I need to mark methods as async and shit?
Because those languages compile and/or execute the code differently if you do that. There are other ways to do it (such as making it all async so you can pretend none of it is).
>>
File: o fuck.png (1.24 MB, 1548x1230)
1.24 MB
1.24 MB PNG
>>103208088
Ladder logic? Real, alas. One of the most miserable ways of programming ever invented, from what I've heard.
Feel for ya. Push through that course and then drop that shit forever.
>>
:)
>>
File: blackBook.jpg (117 KB, 1388x1388)
117 KB
117 KB JPG
>>103208088
whose fault is it that all the graphical interfaces from 1990 to 2010 had these eye-searing white backgrounds?

Is it because GUI's were initially used just for making graphics and typesetting meant to be printed on white paper, and the color scheme just stuck around?

I switched to Linux in 2004 in part because using the Terminal was the only way to have a decent Dark Mode experience back then.
>>
>>103208655
in Zig this is just
const std = @import("std");

pub fn main() void {
const pred = true;
if (pred) {
var foo: []const u8 = "hello world";
std.debug.print("{s}\n", .{foo});
foo = "bye bye world";
std.debug.print("{s}\n", .{foo});
} else std.debug.print("false", .{});
}

it compiles without the test since pred is comptime-known.
>>103208734
it's because computers were used in brightly-lit office environments.
In 2004 I was also living in darkness, but it eventually started to fuck with my eyes so much to only have a single source of light in a room. After I switched to always having some secondary light, I didn't care so much for dark mode.
>>
>programming for years
>failed 2 out of 3 intro to computer science exams
i might just end it
>>
>>103208758
Didn't see much point in dark mode (except as a gimmick) until I got an HDR screen.
>>
>>103203193
>my DB's default isolation level is READ COMMITTED
So pick a non-default, duh; you know you've got an update coming so you can plan ahead for it. You want to avoid upgrading transactions in production code.
It doesn't matter in toy code. It only really matters when you start having real concurrent accesses.
>>
I'm working on a mobile app for tourists when they dock in my country from the cruise ships. what kind of must-have features you think the app should have ?
>>
>>103184086
I miss him so much bros
>>
>>103206619
>I am trying to figure out if I should be using singletons in python.
True singletons? Rarely, and only for things that it's a really nasty programming bug to make several of.
Global constants of various sorts? No problem at all.
Global mutable values (by design)? Be careful, as you can easily get in a mess. Not saying never, but they're a code smell.
>>
File: single_digit_iq.jpg (28 KB, 640x332)
28 KB
28 KB JPG
>>103209348
>but they're a code smell
>>
>>103208758
>it compiles without the test since pred is comptime-known.
I'll definitely look optimising compile time literals for my little toy
>>
ImRAD sucks ass and is an embarrassment on the whole team.
>not stable
>clunky
>embracing more C++ cancer like templates
There's no reason to ever use it
>>
>>103208655
main = do
let pred = True
if pred then do
let foo = "hello world"
print foo
let foo = "bye bye world"
print foo
else print False
>>
1 constant pred
: hw ." hello world" cr ;
: bw ." bye bye world" cr ;
: f ." false" cr ;
: go pred if hw bw else f then ;
go
>>
>>103208734
control systems aren't allowed to use color anymore. At first it was diversity, then it was disability compliance.

>It shows green.
>Does that mean it is safe? Green means go.
>Does that mean it is unsafe because it is currently running. Spinning things are bad for hands.

if only we had a standard instead of every fucking PLC programmer thinking they are the smart one. I'll curb my rant by saying that safety system buttons should be considered "1" when not pressed and you should be reacting when you don't receive the signal.

>>103209348
Thanks. That fits along what I have been thinking.

I am loading the entire lookup for a piece of information for efficiency. It is already stinky. I am justifying to myself by saying that it will only be modified during setup changes and not during normal operation. That is mostly true, but not completely.
>>
am I supposed to be writing my projects as a collection of libraries, or is that just some dumb corporate thing?
>>
File: 1731816925872640.png (118 KB, 651x739)
118 KB
118 KB PNG
>>103197592
You need to go back, Venkatesh.
>>
>>103211104
>huh, it sure would be nice if I could reuse that code from my other project in this one, but it'd take longer to unravel the spaghetti than to just reimplement it from scratch
>>
File: example.png (12 KB, 1376x92)
12 KB
12 KB PNG
4chan post IQ estimator (NSFM)(NOT SAFE FOR MIDWITS)
Load in Chrome/Brave extensions with developer mode
https://www.mediafire.com/file/letqd9gem6hve9i/chan-iq.rar/file
>>
>>103211225
In MASM I could extend the language to do literally anything I want with macros. Therefore MASM is the best programming language.
>>
>>103211225
>60 years of innate extensibility
>basic arithmetic expressions are still an ugly unreadable mess
>>
>>103211237
fasm2 has like an entire scripting language layer on top of it
>>
>>103211237
c has those too, they're call FUNCTIONS
>>
>>103211293
just pick your favorite infix math macro
>>
>>103209307
>what kind of must-have features you think the app should have?
obviously a list of tourist spots nearby. maybe good food places. a "language" section that helps communicate would also be useful (where is the bathroom, directions to such and such place, etc.). educational content about your country would also be interesting. finally, I challenge you to webscrape all cruises from all popular providers so tourists can choose which cruise is theirs and receive reminders about the cruise schedule.
>>
>>103211182
>>103195650
>pajeet writes code for cheaper!
>NOOOOO! I WANTED TO WRITE CODE FOR CHEAPER!
>>
>>103207968
>Starting to get tired of neovim.
why?
>>
>>103206108
futex allows you to do silly shit like wake multiple threads or make the mutex process-local instead of system-wide though
>>
>>103206108
for me it's pthread_yield
>>
>>103209307
mine monero with it
>>
>>103209307
aggressive fetching of information on national enemies (this will be part of the final product whether you like it or not)
>>
File: MAGA_RITSU.png (140 KB, 324x351)
140 KB
140 KB PNG
>>103184086
>tfw code passes the most segfaulty test without a segfault on first try
:D
>>
>>103170517
I finally remembered it well enough to make an implementation that works.
Basically, you take data from the rdrand instruction, copy it to rax, do some massaging to it so it's not too small or too big, put the unmolested random number into rdx and then mul. Your new, semi-random number is in rax. All you need to do from here is exchange rax with rdx to regenerate again.
It's not a good regeneration technique. You shouldn't regenerate too much and you should never use it for anything meant to be cryptographically sound or approaching true random, but it is many times faster than basic rdrand and for quick and dirty assembly applications, specifically those where simplicity is king, it's not a terrible option and does the job quite well.
>>
>this is what the registry retard means by "random number regeneration"
OK, so now we can all agree that you are schizophrenic about optimization because it is the only thing you *can* comprehend.
>>
>>103212362
I'm not registry retard.
Also, it's not my fault you only speak your hyper-domain-specific dialect of asbergers instead of English.
>>
>>103212406
>not my fault you only speak your hyper-domain-specific dialect of asperger's instead of English
Cope, a basketball coach yelling "TURN" has a very different meaning than a railway supervisor doing so has, you might not be a schizo but missing one symptom of mental retardation doesn't excuse you from a positive diagnosis.
>>
>>103212333
Just use an MCG? Rdrand is slow, meant for seeding, not as a quick PRNG
>>
>>103212656
PRNGs have evolved a lot in recent years, now we use xorshift-mul hashes like https://github.com/skeeto/hash-prospector
>>
        char byte_one = ptr[0];
if (byte_one & 128 == 0){ return 1;}

>optimized away because char is signed
I HATE THE COMMITTEE, CHAR IS USELESS FOR FUCKING CHARACTER PARSING
>>
>>103212900
The whole 'plain char' thing is kind of dumb, but you're still a retard.
>>
STILL OPTIMIZED AWAY WITH uint8_t, THANK YOU GCC.
>>
>>103212900
what are you even trying to do here
>>
>>103212968
checking the length of a utf8 character
static int utf8_charlen(uint8_t* ptr){
uint8_t byte_one = ptr[0];
if (byte_one & 128 == 0){ return 1;}
else if (byte_one>>5 == 6){ return 2;}
else if (byte_one>>4 == 14){ return 3;}
/* else if (byte_one>>3 ==30) We don't bother to check if a stream is wrong. */
return 4;
}
>>
>>103212900
>>103212926
128 can't be a signed char so I guess that's the problem

>>103213036
here's mine
int utf8_char_size(const uint8_t *c)
{
const uint8_t m0x = 0x80, c0x = 0x00,
m10x = 0xC0, c10x = 0x80,
m110x = 0xE0, c110x = 0xC0,
m1110x = 0xF0, c1110x = 0xE0,
m11110x = 0xF8, c11110x = 0xF0;

if ((c[0] & m0x) == c0x)
return 1;

if ((c[0] & m110x) == c110x)
if ((c[1] & m10x) == c10x)
return 2;

if ((c[0] & m1110x) == c1110x)
if ((c[1] & m10x) == c10x)
if ((c[2] & m10x) == c10x)
return 3;

if ((c[0] & m11110x) == c11110x)
if ((c[1] & m10x) == c10x)
if ((c[2] & m10x) == c10x)
if ((c[3] & m10x) == c10x)
return 4;

if ((c[0] & m10x) == c10x) // not a first UTF-8 byte
return 0;

return -1; // if c[0] is a first byte but the other bytes don't match
}
>>
>>103213053
This is why amdgpu is 400k handwritten lines
>>
File: browsing.png (950 KB, 1464x1080)
950 KB
950 KB PNG
>>103184086
will anyone program things for me for money? I dont really want to do any myself.
>>
File: Untitled.png (293 KB, 816x639)
293 KB
293 KB PNG
programming a private wow server from scratch. i just got the auth/login server working.
>>
>>103213109
post pgp key and an unmoderated forum you would like to shit up.
>>
>>103213216
http auth is anticonstitutional cancer, be a man and use a cookie
>>
>>103213240
??? I dont want anything like that, I just want someone to extend a github I found and fork it for money.
>>
>>103213253
I meant "drop a pseudonymous contact"
I will do it
>>
File: this is ART.jpg (165 KB, 1024x1024)
165 KB
165 KB JPG
>>103213280
i dont see what you mean. you want me to be anonymous? with money? you know that doesnt work right? do you only accept bitcoin? because the only encrypted payment I'd ever make is called cash in hand. nothing I want you to work on is illegal or even morally shadey but I dont have any intention of adhereing to some poinless show of opsec if you are terrified of taking work here.
>>
>>103213298
I am terrified of taking work here and I guess this time I won't, thank you for your time.
>>
File: 1701440184904083.png (25 KB, 300x300)
25 KB
25 KB PNG
>>103213357
if you are that scared we probably shouldn't work together then since this website is basically a surrogate parrent to me.
In any case good luck with your projects,
>>
>>103213253
>I just want someone to extend a github I found and fork it
Tell us what you want, maybe it's right up someone's alley
>>
>>103213441
Theres this hydrus clone (not a fork, just a similar, and imho, better, image database program)
called FEMBOY that automatically builds a database and tags images based on deepbooru. the problem I have with it is I want it to run through the deep booru database files multiple times. so for example, a pony, or fetish, or pixel art, WAIT, or even OCR pass could all be done in turn for each image if it could only be programmed to do this. As it is right now it does everything it already needs to do per say, but if you want to use more than one AI database, you are forced to either Rebuild another database with its own set, or abandon the functionality of the deepbooru model you replaced with another.

Ideally this thing could be expanded to tag just about anything, and when I tested it, it ran on pretty outdated hardware pretty respectably. I tried asking around on twg but no one there wants to do commission based work. I really feel like we've been sleeping on this as an entire board. We deserve to have the best image sorting software at our fingertips, and it's honestly halfway built for us, but I am not a programmer, and i dont really have time to do it.

https://github.com/k1rak1ra/FEMBOY

I'd like to commission someone to do that, I'll be releasing the fork under a pretty permissive loisance and i dont really plan to sell it, but I do want to include some anti censorship based license amendments.
>>
>>103213519
You cant just fork that guy's code and release it under something other than gpl3 (aka it cant be permissive) lol, you do have good odds of finding the exact person if you make a thread on outer /g/ though
>>
>>103213585
outer g?
no idea what it is
anyway I dont really plan to sell it so I dont see an issue in including meme loisances against censorship.
>Is +NIGGER compatible with (A)GPL?
>Inclusion of additional legal notices is allowed under §7(b) of the (A)GPL assuming they do not infringe on any of the freedoms granted to the user by the license.

based on this it seems like there wouldnt be any legal complications to what I plan to add but I'm not a lawyer or anything.
>>
>>103213651
There's nothing he can do against you. +NIGGER helps chinks/Russians and the few odd westernfags who don't mind it.
>>
+nigger is not a license though
>>
File: Sam_Hyde.jpg (76 KB, 529x635)
76 KB
76 KB JPG
i've decided to give up on becoming a programmer for the check.
i just want to make stuff now. can i just focus on just one language (i know C++ kinda from school and C# from unity) or should i learn other ones like python and js in case the situation calls for it? like if I needed to use a library written in python.
>>
>>103213724
no, you are not allowed
>>
>>103213724
>i've decided to give up on becoming a programmer for the check.
>i just want to make stuff now.
Based
>can i just focus on just one language
Yes. Preferably C/C++
>or should i learn other ones like python and js in case the situation calls for it?
You could learn them if you ever needed them
>>
>>103213724
>can i just focus on one language
learning a language shouldnt need that much focus
>or pick up things as i go
yeah if you were thinking of learning every shitlang on earth to be ready for anything you were thinking wrong, you learn whatever you need on the go to interface with a dependency or whatever
>>
>>103213949
C++ along with python is something I feel like i should know. thoughts on using C++ as a main and python as secondary because of ai libs?
>>
>>103200161
there is no reason to limit yourself to any subset of C++. modern is always better.
>>
>>103214185
there is no such thing as "modern" c++
>>
>>103214197
modern as in the latest standard and according to current core guidelines
>>
>>103214211
There is no widespread support of the latest standards in the big 3 compilers

There is no agreed upon definition of what is modern. C++ is a meme
>>
>>103214250
it's kinda obvious you can only use what is available to you at the moment. you are a bit special, aren't you, anon?
>>
>>103214263
It's been over 10 years of people talking about "modern" and "safe" C++ subsets and I've yet to receive two answers that are the same. I'm not special, I'm sick of the handwaving away of problems
>>
>>103214282
>It's been over 10 years
it's been over 30. what is modern changes with time. that's why it's called modern.
>handwaving away of problems
what problems?
>>
in k this is just
p:1;f:{:("hello world";"bye bye world")};$[p;f@0N;0]
>>
>>103202393
"clang -Wall -Werror -std=c++20 program.cpp -o foo" >> build.sh; chmod +x build.sh


I do want to learn how2cmake, though, but I will be keeping my shit restricted to one single file
>>
>>103214349
cmake is awful
>>
>>103214297
"Modern" was pushed starting with C++11 but wasn't really bugfixed until 14

>what problems?
Tons of problems that you're obviously being obtuse about
>>
>>103214297
what does f(x) mean?
>>
>>103214282
>waaaaah I can't decide on my own what I like, I have to be told by someone else how to program
>>
File: Clipboard01.png (127 KB, 324x592)
127 KB
127 KB PNG
>>103214368
modern C++ is as old as the language itself. for example, my copy of picrel is pre-C++11 and uses type lists to achieve what you would use variadic templates for today. the language had evolved, but these concepts were known long before C++11. doesn't matter what you call them: modern, effective or whatever.
>>103214370
widdle baby discovered mvp? you will get over it. use uniform initialization.
>>
>>103214370
In programming, f(x)f(x) is a mathematical notation commonly used to represent a function. Here’s what it generally means:

Function Name and Input:
ff: The name of the function.
xx: The input (or argument) passed to the function.

For example, f(x)f(x) means a function ff takes xx as an input.

Output:
f(x)f(x) returns some value based on the computation defined within the function.

Example in Programming

Here’s how f(x)f(x) translates to code in popular programming languages:
Python
def f(x):
return x * 2 # Example of a function doubling the input

result = f(5) # Calling the function with x=5
print(result) # Output: 10

JavaScript
function f(x) {
return x * 2; // Example of a function doubling the input
}

console.log(f(5)); // Output: 10

General Purpose:
Encapsulation: Functions like f(x)f(x) encapsulate a block of code, making it reusable.
Abstraction: Helps abstract details by focusing on the input and output relationship.
Mathematical Representation: f(x)f(x) can represent mathematical equations, transformations, or real-world models.

If you have specific contexts in mind, feel free to share, and I can provide a more tailored explanation!
>>
>>103214590
>f(x)f(x)
Please explain in depth with a demonstration how a machine learning model can simulate the experience of hell
>>
>>103214609
it never says nigger!
>:OOOOOOOO
>:'(((((((((((
>no NIGGER!?!??!
>D::::::::::::::::::::::
>>
>>103214580
I'm aware of that book and other uses but when people mention "Modern C++" they specifically mean post-C++11 constructions
>>
>>103214650
They should limit the availability of books with "modern" in the title
>>
>>103214650
maybe. personally, I would have hard time going back to anything older than C++17 (mostly because of if-constexpr). giving up concepts would be painful too (C++20). when I said modern, I actually meant modern.
>>
>>103184086
PLAP PLAP PLAP PLAP PLAP
GET PREGNANT
GET PREGNANT
GET PREGNANT
>>
>>103214590
i really hate how python syntax looks
>>
https://en.cppreference.com/w/cpp/language/constraints
I thought going forwards meant making source code smaller? What the fuck is this?
>>
>>103208758
zig as a language is horrible, it doesn't do anything to solve problems C has
>>
>>103213669
>>103213722
did you just assume that loisances loisance?!
I plan to add a much more extensive list of buzzwords than just the all mighty N but basically its in the same spirit as it.

is outer /g/ some smuglo. ghost town? I get the feeling a retard like me would be strung up for visiting a lot of places like that will ban you for making typos like /a/
>>
>>103214714
>plap
>with a loli
virgin confirmed
>>
>>103215223
>>103215223
>>103215223
>>
>>103214959
compared to what we had before for constraining templates, this makes code smaller
>>
>>103215077
outer /g/ is /g/ outside of the general, generals are like their own boards
why are you naming smuglo here when 4chan is an anime-hater website?
>>
>>103213036
>>103213053
In Forth this is just
: u8len ( c-u) >r true case
$00 $80 r@ and = of 1 endof
$c0 $e0 r@ and = of 2 endof
$e0 $f0 r@ and = of 3 endof
$f0 $f8 r@ and = of 4 endof
0 swap endcase r> drop ;

https://www.ideone.com/x8ekIw
>>
>>103213519
not the author of this, but he's part of bibanon. Here

https://github.com/reasv/panoptikon

https://panoptikon.dev/search
>>
>>103212767
https://www.pcg-random.org/posts/does-it-beat-the-minimal-standard.html



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.