[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: hackers.jpg (133 KB, 1280x854)
133 KB
133 KB JPG
Welcome to the Daily Programming Thread. What are you working on, /g/?
Previous Thread: >>102366455
>>
>>102403295
Namespaces make compilation slow as fuck, are typed enums the solution?
>>
install a language with proper modules
>>
not the C way by the way
>>
>>102403876
... The stuff i deal with is not scripting.
>>
>>102403892
>thinks only python has modules
>>
>>102403897
modules are a python feature
>>
>>102404010
Am I talking to chatGPT?
python didn't invent modules retard
>>
>>102404019
languages with modules remind me of python
>>
File: ntuserpeekmessage.png (39 KB, 1102x970)
39 KB
39 KB PNG
>peeking into the message queue for a WM_PAINT event requires a syscall (NtUserPeekMessage)
>switching back into userspace for activation contexts (whatever these are, don't tell me, I didn't ask for it)
>locking and releasing the same lock four times (!!!)
>another (!!!) syscall (NtUserMessageCall) to process a WM_SETICON message
>deactivating the deactivation contexts
>going back into kernel space via NtCallbackReturn
How in the fuck of fucks is Linux *still* losing against this?!?
>>
>>102404227
intense directed prayer is proven to speed up CPUs by collapsing quantum states to improve branch prediction
>>
>>102404227
Quit namefagging, nobody cares you are a wannabe-windbloat-reverse-engineer
>>
File: lol_lmao.jpg (30 KB, 293x236)
30 KB
30 KB JPG
>the nocodeshitter is having a worthless opinion again
>>
we conjure the spirits of the computer with our spells
>>
the computer says you are gay
>>
>>102405743
Again? It always says that
>>
looking at interesting solutions for gpu accelerating problems that normally aren't
>>
>>102403856
hallucinated it again award
>>
File: file.png (1.36 MB, 1323x2483)
1.36 MB
1.36 MB PNG
>>102403295
https://nelua.io/
opinions?
I think it's neat
>>
>>102407377
I think all that's missing now is a (modern) desktop Elixir
Seems to be alive though, and as long as it's within ~90% of C, it's probably fine.
>>
>>102404570
broken bot
>>
>>102407377
looks like terra but simplified
>>
Sadly I still have to support Windows XP

if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)")
if(NH3API_FLAG_TARGET_WINDOWS_XP)
if(${CMAKE_MATCH_1} LESS 11)
elseif(${CMAKE_MATCH_1} EQUAL 11)
# Visual Studio 2012
set(CMAKE_GENERATOR_TOOLSET "v110_xp" CACHE STRING "CMAKE_GENERATOR_TOOLSET" FORCE)
set(CMAK_VS_PLATFORM_TOOLSET "v110_xp" CACHE STRING "CMAKE_VS_PLATFORM_TOOLSET" FORCE)
elseif (${CMAKE_MATCH_1} EQUAL 12)
# Visual Studio 2013
set(CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "CMAKE_GENERATOR_TOOLSET" FORCE)
set(CMAKE_VS_PLATFORM_TOOLSET "v120_xp" CACHE STRING "CMAKE_VS_PLATFORM_TOOLSET" FORCE)
elseif (${CMAKE_MATCH_1} EQUAL 14)
# Visual Studio 2015
set(CMAKE_GENERATOR_TOOLSET "v140_xp" CACHE STRING "CMAKE_GENERATOR_TOOLSET" FORCE)
set(CMAKE_VS_PLATFORM_TOOLSET "v140_xp" CACHE STRING "CMAKE_VS_PLATFORM_TOOLSET" FORCE)
elseif (${CMAKE_MATCH_1} GREATER_EQUAL 15)
# Visual Studio 2017 and greater
set(CMAKE_GENERATOR_TOOLSET "v141_xp" CACHE STRING "CMAKE_GENERATOR_TOOLSET" FORCE)
set(CMAKE_VS_PLATFORM_TOOLSET "v141_xp" CACHE STRING "CMAKE_VS_PLATFORM_TOOLSET" FORCE)
endif()
if(${CMAKE_MATCH_1} GREATER_EQUAL 14)
# Remove TLS static variables initialization optimization
# Which uses Windows Vista syscalls
# https://learn.microsoft.com/en-us/cpp/build/reference/zc-threadsafeinit-thread-safe-local-static-initialization
add_compile_options(/Zc:threadSafeInit-)
endif()
endif()
if(${CMAKE_MATCH_1} GREATER_EQUAL 15)
add_compile_options(/Zc:__cplusplus)
endif()
endif()
>>
grim
>>
>>102407676
do not
>>
>>102407582
isn't elixir 12 years old
>>
>>102407718
Yeah, but the point is more, that it's basically a webshit-only lang.
if Erlang's C FFI wasn't so tedious, it'd be ideal.
>>
File: fennel.png (178 KB, 1280x1280)
178 KB
178 KB PNG
>>102407377
I'll use Nefennel when it comes out
>>
>>102404227

oh, you (incomprehensible picman) again. as an architect i can give you a higher order task, which i dont have much time for. but you could make something useful.. replacing a lot of bloat in windows.
>>
File: 1701382106577201.png (82 KB, 892x453)
82 KB
82 KB PNG
Hmmh, I'm ashamed to admit but I had trouble with just pitching raw audio data up/down. I think I got it right now, but have to refactor this method after I've done designing the actual playback logic that triggers sample playback. My hunch says I just calculate how many samples per note there are between notes at a particular BPM and then simply use that as a buffer size when pitching samples but idk.

And yeah, I'm doing this blind on my own. Audio stuff seems to be difficult to wrap my head around, at least at first without prior knowledge.
>>
>Try to self-teach myself some C
>Make a snake game
>288 lines of code
>Know I can do better
>Had a lotta fun though
What are some toy projects that got you to get interested in some programming?
Also bonus question: How low of a LOC can you make a snake game that is graphical? The others I've poked around on are pretty good and got me to learn something new.
>>
>>102408798
>that is graphical
Depending on the way you go about this, the lines of code required would be massively different.
>>
I found a bug in 4chan-xt.

catalogNode() {
return $.on(this.nodes.root, 'mousedown click', e => {
if ((e.button !== 0) || !e.shiftKey) { return; }
if (e.type === 'click') {
e.preventDefault();
if (Conf['MD5 Quick Filter in the Catalog'] && e.target.classList.contains('catalog-thumb')) {
Filter.quickFilterMD5.call(this.thread.OP);
} else {
Index.toggleHide(this.thread);
}
}
});
}, // Also on mousedown to prevent highlighting text.


"e.preventDefault();" needs to be moved up one line. This is why I was getting unwanted highlighted text when shift-clicking to hide threads in catalog view. The browser highlights text during mousedown, but e.preventDefault() wasn't being run until the click event (i.e., releasing the mouse button).
>>
File: sp int and pol.png (346 KB, 1433x572)
346 KB
346 KB PNG
/int/, /sp/ & /pol/ flag counter
posting here to have the code tag
// ==UserScript==
// @name flagcounter
// @match https://boards.4chan.org/int/thread/*
// @match https://boards.4chan.org/sp/thread/*
// @match https://boards.4chan.org/pol/thread/*
// @grant none
// @version 1.0
// @author otro
// @description counts country flags, doesn't count /pol/ custom flags
// ==/UserScript==

document.querySelectorAll(".thread .postContainer .flag:not(.flag-mx)");
base = document.createElement("div");
base.setAttribute("class","dialog");
base.setAttribute("id","flag-counter");
base.style.padding = "2px";
bstyle = document.createElement("style");
bstyle.append('.flagnum{margin-right: 3px;}');
bstyle.append('.flagnum:before{padding: 1px;content: "x";}');
base.append(bstyle);
base.append('Flag Stats:');
counted = document.createElement("div");
counted.setAttribute("id","counted-flags");
base.append(counted);
//document.body.insertBefore(base,document.getElementById("absbot"))
document.body.insertBefore(base,document.getElementById("delform"));

function addFlag(code) {
let E =document.getElementById("flagnum-"+code);
if (E==null) {
t = document.createElement("span");
t.setAttribute("class","flag flag-"+code);
counted.append(t);
c = document.createElement("p1");
c.setAttribute("class","flagnum");
c.setAttribute("id","flagnum-"+code);
c.append(1);
counted.append(c);
} else {E.innerHTML = Number(E.innerHTML)+1;}
}
function clear() { //dunno if this is the best way of doing it
counted.textContent = '';
}
function update() {
clear()
for (i of document.querySelectorAll(".postContainer:not(:has(.stub)) .desktop .flag")) {
addFlag(i.classList[1].split("-")[1]);
}
}
update();
setInterval(update,5000);
>>
>Thread is THIS slow and it is Monday on September.
Unreal what public education system can do to fix quality of this board.
>>
there's not a single good thread on this dogshit board
why do i keep coming back here?
>>
>>102409790
be the change you want to see
I still haven't closed >>102325084 's tab
>>
>>102407377
compiling to C has a billion weird pitfalls
>>
I am using Vs studio 2022 to follow a textbook with the goal to learn more on how and why senior Devs utilize some things.
My core stack is c# and angular.

I know it sounds trivially retarded for what I am asking next, I thank my overgrown amygdala for it.

Are there differences in scaffolding or creating a project between Vs studio 2022 and Vs code?
Can you help me understand what I am trying to look for in order to fill my gaps?

On Vs studio 2022 I created the project, then had to prepare the app settings.json and what not to my needs (use Https), create an environment folder for angular, before I could start working in earnest.

In Vs code, we only have c# devkit as an extension which checks for c# applications.
How would that work regarding doing preparation work before I can start doing the actual development?

What irks me also is that the c# dev kit apparently (?) only reads the .csproj file instead of the .sln file.

How do I mitigate or recreate the same shit on Vs code?
Reason is simply that Vs code is much more performant despite all the extensions I installed and that it feels snappier than Vs studio.

Other than this, I am trying to focus more on the basics and extending and/or refreshing my knowledge regarding the basics of both aforementioned subjects in addition to my retraining class as an it-specialist as a system admin guy the very least.
>>
>>102409798
Such as the nocoder writing the compiler whose target is C not being able to write C himself, any others?
>>
>>102408861
Maybe report to the jannies or whoever
>>
File: locks_locks_locks.png (8 KB, 530x1007)
8 KB
8 KB PNG
>>102408192
Right. Because some PHP dude who doesn't know the first, second, or third thing about memory, who has absolutely no clue how the code that he writes translates into actual machine instructions, can totally make judgement calls about usefulness.
Kant would be having a field day with you.
>>
>>102410213
>MUH THREAD SAFETY, MUH SEMAPHORES LOCKS MUTEXES ATOMICS HURR DURR
multithreading was a mistake
>>
>>102410239
The problem isn't multithreading. The number prior to each function name shows the current call level; anything higher than 1 indicates that this is code being executed by a previously hooked function, in this specific instance NtUserSetWindowLong - which is already a syscall into kernel mode.

But then execution immediately goes back into user mode to acquire locks and activation contexts and then back into kernel mode via syscalls like NtUserGetTitleBarInfo and NtUserIsNonClientDpiScalingEnabled and NtUserIsTopLevelWindow and NtUserGetProp and what not. Why? Well, I can only guess, but it very much smells like MS wrote a bunch of small userspace functions, each with their own little locks, without wondering for but a moment if they all locked and unlocked the same lock, or if it could be all done with only one switch into kernel. Fuck, I'm not even mad they need switches to kernel mode because they want to keep their handle implementations opaque, but for fucks sake STAY THERE!
>>
>>102410213

whats the problem, remove those locks, they are for TS builds, im not running TS builds. your pics are still the same number blobs which doesnt matter anything

>>102410239

threads as helpers is okay, you dont understand concurrency principles. Fibers are mistake
>>
File: 1709105122258606.png (3 KB, 449x72)
3 KB
3 KB PNG
I'm trying to make a pretty simple excel change so that it fixes the data pasted into certain cells, but after fixing the data and trying to set the value back I get a crash with "Object required", and according to the debugger it's because the Target (which I have been reading from for the whole method and is definitely a Range object) is just a string containing the cell contents. I even deleted everything from the method and just made it change the cell contents and I get the same crash.

Anyone know what the dealio is?
>>
>>102410424
>they are for TS builds
You should've waited with your post until after actually reading my last one: >>102410413
This has nothing to do with TS builds or not. This is just a normal call to NtUserSetWindowLong.

>"your pics are still the same number blobs which doesnt matter anything"
Only to you. Which is why no one should ever take you seriously. Ever.
>>
>>102410489

instead of actually reducing bloat you only complain about some minor issues (2 function calls) with incomprehensible pics nobody understand (no context whatsoever, is it PHP or is it HPH or ZIBAZIBA runtime) except yourself.

beside theres no window work PHP does by default, there are CLI and "window-less" versions
>>
File: 1720702162491607.png (19 KB, 666x302)
19 KB
19 KB PNG
>>102410447
I figured it out and it's extremely counterintuitive: Range.Text is a property that returns the cell's Text, but you can't set it, you have to use Range.Value to do that.
>>
>>102410674
>Basic
ew
>>
>>102410588
>instead of actually reducing bloat
Hey, retard, how the fuck do you propose I do that? This is OS user mode code we're talking about here, which is subject to change. Sure, I could do binary patches, but they might break with the next retarded Windows update. No, this has to be changed on the source code level, by MS themselves.

>2 function calls
>this thing goes so far beyond his head he doesn't even understand the problem
>like, totally
Hey, retard, the number after every E-entry (epilogue) indicates the number of cycles between function entry and function exit. The locks easily eat 2K cycles *per instance* (of which there are many: >>102410213), the constant mode switches easily eat over 100K - again, *per instance*. A call to NtUserMessageCall? 63K cycles. NtUserGetProp? 15K. NtUserIsTopLevelWindow? 13K. NtUserIsNonClientDpiScalingEnabled? 14K

>inb4 fix these too
These are ntoskrnl.exe functions, retard. They are quite outside my reach, and even if they weren't - THIS HAS GOT TO BE FIXED ON A SOURCE CODE LEVEL.

>is it PHP or is it HPH
No one here is talking about PHP.
>>
>oh my fauci, 2k cycle cost so I can use multiple 3.6Ghz cpu's instead of one? Literally performance pitfall
>>
>>102410759
Read it again, retard: >>102410413
The problem isn't locking, the problem is how it's applied.
>>
>>102410776
>read it again
why would I reat your walls of text of seethe even once? cgdct anime is more intellectually stimulating than anything you ever posted
>>
>>102410759
>we don't need performance anyway
ack yourself Pytroon, you are energy inefficient
>>
>>102410789
if you knew anything about performance, you wouldn't be multithreading your fizzbuzz nor using mutexes in it
>>
Making retards like you feel smart isn't "intellectually stimulating", it's just comforting your ego.
>>
>your fiizzbuzz
>he didn't even make it through the first paragraph
No wonder webshitters have such a low reputation, and no wonder they're so bitter.
>>
>>102410789
>>102410817

C aryans won btw
C++GODS won btw.

Kill youself, trannoid.
>>
>>102410875
>C++GODS
A-huh?
>>
>>102410691
I have no choice, it's for an excel spreadsheet
>>
>>102410728
>how the fuck do you propose I do that? This is OS user mode code we're talking about here

first you kneel politely, maybe i tell how. you forgot that you were refereeing to high-level language runtimes like PHP before, with those pics

> No, this has to be changed on the source code level, by MS themselves.

sure sure, the whole corporation will come here and start kneeling before your majesty

> ntoskrnl.exe functions, retard. They are quite outside my reach, and even if they weren't - THIS HAS GOT TO BE FIXED ON A SOURCE CODE LEVEL.

sure, after MS will open source all windowses.. seems that it is faster to do binary patches which you are not going to do, you only going to complain about the thing you cant and wont fix. understood.

lets all study some binary windows function codes, overload our brains with this extremely useful information :]]
>>
>>102411292
>you were refereeing to high-level language runtimes
When?

>the whole corporation will come here and start kneeling before your majesty
Well, the alternative is that I keep digging up shit about them. Fuck, I might even start selling my tracer to others so that they can verify for themselves just how broken Windows is. Let's see if they care then.

>seems that it is faster to do binary patches
Not gonna happen, retard: https://devblogs.microsoft.com/oldnewthing/20230324-00/?p=107966
>>
>>102411325
>>you were refereeing to high-level language runtimes
>When?

if you didnt overload your brain with those codes you would better memorize what you did and where youre moving.

> Not gonna happen, retard: https://devblogs.microsoft.c

retards read retards, im not interested in those, i remember he was complaining about time applet seconds performance (similar to what you do), shows his competence

> I keep digging up shit about them

your pics are not applicable. what can you tell about windows time service for example? (laughs in silence)

i studied their terminal project for example. try knowing less useless materials, free advice.
>>
>>102411490
>you would better memorize what you did and where youre moving
So I didn't. Thought so. Didn't read the rest, goalpost-moving retard. Stay mad people are better than you.
>>
>Microsoft will BUY (not steal) my tracer so that they spend even more money breaking backwards compatibility and risking regressions so that my registry dumper runs in 6.3s instead of 7
>>
>>102412004
The real joke here is that Microsoft would invest in making their software faster and not even slower
>>
I love how completely out of your depth you are that you can't even keep the narratives straight. The registry dumper doesn't need a tracer because we (that is to say, non-nocodeshitters) already know what the issue is and how to fix it.

No, this is about undocumented things like switching into user mode to do locks and then back into kernel mode. If the kernel would rely on user mode locks, then they're just completely doomed.
>>
Oh, also
>not steal
Luckily I never bought into github, and I know how to set up my systems so that they don't phone home. I don't think they would be able to steal my stuff even if they wanted to.
>>
>>102412186
>nocodeshitters
Go back
>>
File: 1658566920219001.jpg (37 KB, 567x450)
37 KB
37 KB JPG
>the nocodeshitter thinks he has anything to say
>>
cool avatar tranny, now could you leave?
>>
https://www.stroustrup.com/C++0x_keynote.pdf
bjarne wants to destroy C++
>>
File: 1631916137024.gif (1.98 MB, 500x225)
1.98 MB
1.98 MB GIF
>could you leave
HAHAHAHAHAHA!

Next you're going to mumble something about cringe, right?
>>
Can chatgpt create user guide from code base?
>>
>>102412760
not one worth reading, esl
>>
>>102412801
>client has software bug that needs to be fixed
>also there is no documentation so that needs to be written
>use as much chatgpt as you can
it's over for me bros, I have never gotten working code out of chatgpt.
>>
>>102409833
>Are there differences in scaffolding or creating a project between Vs studio 2022 and Vs code?
a javascript "project" isn't actually real and don't actually really build anything because javascript isn't built i presume it's just some sort of loose collection of files that help map the some sort of VS UI construct to those files along with maybe some npm modules or something
then again i've never cared enough about JS to learn anything other than basic DOM manipulation
but generally from what i've heard you wouldn't be using VS studio proper for webshit
i found it the most useful for some desktop applications, where things like its large library of graphical mappings and presets for msbuild settings and WYSIWYG editors are semi-helpful for making GUI development slightly less painful
especially since it's mandatory to at least install it if you need anything in MS's flavor of C++ built or i think if you want to use AMD's version of CUDA on windows right now
>What irks me also is that the c# dev kit apparently (?) only reads the .csproj file instead of the .sln file.
well yea it's the only thing of any value and defines the build process, dependencies, and build settings for c# msbuild projects
a visual studio solution file is just a list of msbuild project files associated with each other + preset build configs, it means nothing, it's just projects opened at the same time
and two projects being in the same solution file also means nothing, it doesn't make them dependencies or anything
>>
>>102414045
>>but generally from what i've heard you wouldn't be using VS studio proper for webshit
*for JS based webshit
these days i think they really shill full stack C# and VS probably has nice presets for that
>>
Somebody has an idea what this could mean?
>>
>>102414161
it doesn't have any particular meaning
>>
>>102414161
reminds me something related to SIMD lane masking on the GPU
one lane per byte until the last one which is a compaction of all previous selections? or something
>>
help me unit test my program:
rm -rf /
echo nothin personnel.. kid..
>>
>>102414161
nuke codes
>>
>>102414741
No one cares, nigger.
No, seriously, abso-fucking-lutely no one.
>>
>>102414161
treasure at (7, 7)
>>
>>102408798
falling sand games are simple but can be magical. I suggest watching some youtube videos there are a couple that present a neat ideas especially the noita one.
>>
see >>102406859


why is a programming thread populated by nocoders?
>>
>>102409007
the wintoddler moderator still posts here though.
>>
>>102416392
>reddit spacing
>vgdg term
>question proves 0h lurking /dpt/
get out
>>
>>102416432
>implying that anybody should get influenced by the opinions of the idiot regulars
You are so fucking stupid it is hilarious, i will head out of this pile of shit.
>>
>>102416422
You should come to terms with it.
>>
>>102416476
How would you rate your gatekeeper today?
>>
>>102416522
Pretty shit. He folded like a cardboard dollhouse the moment I laughed at him: >>102412742
>>
>>102416679
That's the other guy
>>
>>102416696
You asked about *my* gatekeeper.
>>
I'm still on the fence on whether I should commit to the JVM or the CLR
I already have Lua+Fennel for most scripting tasks and Nim for programs that require C interop or need to run very fast
>>
Been dealing with a tricky bug report where it turns out I'd fixed the problem a few months back.
>Feels good man
>>
>>102417419
why did you need either of those sar-ware
>>
>>102417419
CLR is a lot more flexible and evolves more rapidly
JVM is nice for android
CLR isn't saddled with as much legacy baggage and can properly handle things like 64 bit ints
the JVM has access to countless libraries, the CLR has less

whatever opinions you have on microsoft especially back in the EEE days oracle is worse
i think at one point they even threatened part of eclipse with legal action
>>
>>102417419
You like Scala? Clojure? F#?
>>
How do you know when a utf16le string ends? I'm trying to parse a somewhat obscure binary file and the format spec just says something like "strings are 4 bytes plus the string length". The file format does not specify the length of the strings in advance. I'm looking at a hex editor with a sample file opened and it looks like the string ends in "2E 00" which is a period that I know exists in the string. The value that immediately comes next that I want to read is D0 FE 00 00, which is a 32bit int for 65232 (a value in the file that I know in advance). There is no null terminator that I can see. I assume the 00s are part of the int since I think one hex code like 0xFF is one byte, and the int should definitely be 4 bytes there (at least the spec says "int"). So how do I know when it ends?
>>
>>102418896
What makes you think 0xFED0 indicates a surrogate pair?
>>
>>102418951
It's just the vertex count that I know is in the file that comes immediately after the string. Anyway I'm a massive tard, those 4 bytes at the start of the string ARE the length. I just compared two other strings and yep. The spec is confusing. Really sorry for wasting your time.
>>
What do you think of my password generator?
>>
File: that.png (4 KB, 326x56)
4 KB
4 KB PNG
>>102419908
Not directly generating numbers and adjusting it for the 0x21 - 0x7E ASCII range - OK.
Using system and popen rather than linking against the SHA library - whatever.
But you better fucking start using GIMPs layer hiding feature if you want to merge image files in the future, mate.
>>
>>102420051
huh?

unsigned char hash[SHA256_DIGEST_LENGTH];
SHA256_CTX sha256;

SHA256_Init(&sha256);
SHA256_Update(&sha256, input, strlen(input));
SHA256_Final(hash, &sha256);

why is ssl like this?

No I lined up the wrong 2 lines.
>>
>>102420215
>why is ssl like this?
Most hashing algorithms are like this because memory is limited and the input data might come in chunks only. Or are you going to load in some 8 GB file and pass it to the update function in one go? Yeah, didn't think so neither.
>>
>>102420277
Just give me the hash janny.
>>
And if not? Are you gonna cry again?
>>
>>102420341
implying I ever stop crying.
>>
True. Bitterness is a poison.
>>
FUCK OFF.
>>
>>102420685
>requires opaque structs to be created on the heap
Yeah, no, OpenSSL can suck my dick. I'll continue using the old functions, and there's nothing they can do to stop me.
>>
which coc will keep trannies away but won't scare away normal people?
>>
>>102421231
Ironically not having a coc at all.
>>
Trying to come up with side project ideas, but I always shoot them down after I've written a few lines of code.

I want to make something actually useful. Latest idea was a web frontend for my self hosted git repos, but there's already a billion frontends for git, including the one built in.
>>
File: sqlite_code_of_ethics.png (254 KB, 1555x1012)
254 KB
254 KB PNG
>>102421231
the original sqlite code of conduct and now unofficial code of ethics
it's a subset of the rules governing benedictine monks
https://www.sqlite.org/codeofethics.html
they were fucking pissed at this, shame the project didn't keep it, they probably went after sponsors or something
>>
>>102421231
define "normal" first, to me, it's normal for people to find TND copypasta funny, so that's exactly what's inside my CODE_OF_CONDUCT.txt
>>
>>102420685
>>102420745
can you fuck off back to >>>/g/wdg, noone cares about your webshitter problems
>>
>>102421737
wtf does generating a sha256 hash in C have to do with web dev?
>>
>>102421772
the fact that md5 can do everything you need to do without wasting time with bloated webshitter libraries
>b-b-but muh basedcurity!
oh so you are webshitting then?
>>
>>102421737
no one cares about registry dumping either, yet he's here
>>
>>102421782
idk how to into md5?
>>
>>102421808
https://rosettacode.org/wiki/MD5/Implementation copy paste like you always do, what's so hard about that?
>>
>>102421782
i mean if you're going to make that argument, why would you even bother with trash like MD5 over xxhash's xxh3?
>>
>>102421823
because I'm not a webshitter so I don't need xxh's webshitting capabilities.
>>
>>102421823
dont bother, that guy is just trying to shit up the thread. issues at home, life not going too well... it's sad to see
>>
>>102421828
xxh3 isn't a cryptographic hash nor is it webshit related, it's a high speed heavily vectorized hashing algorithm meant for bulk data processing
even a good implementation of MD5 is shit
>>
>>102421835
yeah, that's why over half of its API is littered with garbage called security theatre
>>
I fucking hate all of you cunts. I am just going to use Python and burn down the entire planet with my O(n^n) solutions. FUCK YOU.
>>
>>102421853
i wonder if there are any algs as inefficient as union find is efficient
>>
>>102421281

what OS you have, can you compile binary stuff?
>>
File: 1721126602945175.jpg (531 KB, 1000x670)
531 KB
531 KB JPG
>the interviewer's face when he learns that you only know how to write a registry dumper
>>
>>102421853
Just use python for the bulk of the logic and call some compiled C binaries for the actual processing. Most of a program is just deciding what to do.
>>
>>102414161
valid moves for a rook on a chess board, maybe
>>
What is the best way to make error handling go away? Extensive error handling is what takes relatively simple code and turns it into a monstrosity
>>
>>102419908
It's actually only 4ms slower.
I have wasted my entire life.
>>
>>102423758
What did you expect? You're just calling a library
>>
>>102423780
No no, the entire generator is only 4ms lower.

My C implementation was that bad.
>>
>>102423696
Just ignore them.
>>
>>102423696
Write logically sound state machines and limit the scope of function input and behavior
>>
>you only know how to write a registry dumper
I feel so, so, so sorry for your extensive brain damage, and it's so, so, so unfortunate you don't know anyone in real life who can put you out of your miserable and murder you completely: >>102404227
>>
>>102421782
uh... openssl is shitty yes, but it's not really a "webshitter" library.
>>
>>102424820
it is, encryption has no usecase beyond transmitting data between webshit
>b-b-but muh child porn
don't care
>>
File: 1558516921219137.jpg (339 KB, 962x1278)
339 KB
339 KB JPG
>encryption has no usecase beyond transmitting data between webshit
>this is what brainlets actually, unironically believe
>>
File: 3119342-1463245549872070.png (1.6 MB, 1536x1536)
1.6 MB
1.6 MB PNG
>have 4 tickets assigned to me, none are particularly hard
>no meetings on my calendar scheduled today
>boss is AWOL
>working from home

Is there a more ideal working situation than this? Being left alone to do the job that you are good at and the kind of work you enjoy?
>>
>>102425561
yes, the same but not paid in worthless fiat you are unable to spend on a proper family
>>
Families are miserable money sinks. Only a cuck NPC would ever get one.
>>
File: DSC09460 - Copy.jpg (3.83 MB, 3600x3600)
3.83 MB
3.83 MB JPG
>>102425573
Has anyone here ever been paid in bitcoin
>>102425601
Yes instead you should spend money on professional photoshoots for your cat like I did. picrel
>>
File: 11z81yb7a7t61.jpg (53 KB, 960x830)
53 KB
53 KB JPG
>>102425624
Why the fuck would anyone spent money on artificial photoshoots for a cat, when their natural behavior is much more endearing?
>>
>>102425624
>>102425678
>>>/ck/
>>
File: 1605195901045.png (1.27 MB, 1878x1187)
1.27 MB
1.27 MB PNG
>>102425701
Up to your old tricks again, Chang?
>>
>>102425678
What purpose does "No one: " serve in this image?
>>
>>102426021
https://knowyourmeme.com/memes/nobody
>>
>>102426021
It's the part that women think is funny, you can literally do anything after "No one:" and they will laugh
>>
>>102426021
The original format I saw was:

>No one:
>Women on instagram: "Ok so you guys have been asking about my daily makeup routine"

i.e: Joking about people who answer a question that nobody asked or cared about. However, it has slowly morphed into meaninglessness since then, which is typical of memes
>>
File: Untitled.png (409 KB, 1177x682)
409 KB
409 KB PNG
This is cozy not gonna lie
Going to put a network stack on this lil nigga and make a visual network interface
>>
>>102426928
* it's Visual Basic 1.0 for DOS btw running in FreeDOS
>>
>>102426949
Would it work in DOSBox-X, too?
>not to be confused with normal DOSBox
>>
no one:
absolutely no one:
not even a soul:
not even a bug:
anon: I don't get it
>>
>>102427006
That's because absolutely everyone gets it.

Right? Right.
>>
File: fp.png (147 KB, 600x600)
147 KB
147 KB PNG
I'm writing an HLSL "effect" editor using win32 controls and multiple windows for display
>>
>>102425561
Yeah pretty good. I'm glad my boss is very helpful and doesn't micromanage anybody, so everyone just does the needful and it's all good.
>>
>>102426993
I have no clue. I've only extensively tinkered with FreeDOS in Virtual Box and Bochs. I think DOSBox is more about emulation for games, I don't know about modifying the filesystem or even how to do virtual floppies with DOSBox.

If DOSBox can persist a filesystem and do virtual floppy mounting for img or dmg files, then theoretically yes.
>>
>>102427735
>I think DOSBox is more about emulation for games
What exactly confused you about
>>not to be confused with normal DOSBox
? https://dosbox-x.com/wiki/#Home
>However, while the main focus of DOSBox is for running DOS games, DOSBox-X goes much further than this. Started as a fork of the DOSBox project, it retains compatibility with the wide base of DOS games and DOS gaming DOSBox was designed for. But it is also a platform for running DOS applications, including emulating the environments to run Windows 3.x, 9x and ME and software written for those versions of Windows.
>>
>>102427774
Well I guess I am a retarded faggot and did not fully take in the
>not to be confused with
part of your post, but I'm assuming 100% yes you could run this in DOSBox-x

Here's the link for VB for DOS that I used
https://winworldpc.com/product/microsoft-visual-bas/10-for-dos
>>
File: dbx.png (5 KB, 1280x800)
5 KB
5 KB PNG
>>102427856
Now if only I knew Basic ...
>>
File: screenshot3.png (487 KB, 1366x739)
487 KB
487 KB PNG
As an experiment I forked the old kgtk software and replaced kdialogd with calls to libportal and it actually worked! This allows you to force GTK2/3 software to use xdg-desktop-portal.
>>
>>102414741
>no sudo
>no --no-preserve-root
>>
>working on personal project
>no boss
>no requirements
>still comply with the linter asking me to document my apis and test my code
grueling
>>
>>102418896
utf-16 is double null terminated i thought?
>>
>>102420331
write a wrapper function then, crybaby
>>
File: 1723623022204915.png (150 KB, 467x541)
150 KB
150 KB PNG
>>102428179
>BASIC was the Python of early computing

Make a new Form by going File > New Form
Add buttons and controls to the form
Then go to Edit > Event Procedures
Now choose the controls you want to edit and you can add code to its event handler
That's about all there is to it
>>
>>102428626
Nah, I'm good.
>>
>>102414161
Reminds me of one of those multiplication matrices on advent of code
>>
>>102428193
What exact packages did you fork?
>>
>>102428437
you're a fucking idiot
>>
>>102429887
Not very nice.
>>
File: bongoboy.gif (4 KB, 256x256)
4 KB
4 KB GIF
>>102429887
m-m-mods?
>>
File: 1722619539286730.jpg (185 KB, 693x1023)
185 KB
185 KB JPG
Bump.
>>
>>102423696
>What is the best way to make error handling go away?
Just don't have any errors.
>>
>>102423696
Just don't make any code
>>
Is it called a "pod" in Kubernetes because a pod is a group of whales and Kubernetes' pod is a group of containers, and the most common container is Docker whose mascot is a whale?
>>
>>102429720
This relatively recent fork that ported it to qt5 https://github.com/sandsmark/kgtk
And I also used the Trinity version of kgtk as a reference. kgtk itself is basically abandonedware even on Trinity. But it was kind of doing desktop portals before desktop portals where a thing.
>>
>>102428437
Can be. Or could be a counted string somehow. Both turn up in reality.
>>
>>102410213
>Kant
are you this guy?
>>>/r9k/78843535
how often do you speak of kant?
>>
>>102421685
>they probably went after sponsors or something
doubt it
probably just moved it out of the way when that dumb fad died down
>>
>>102433292
>are you this guy?
Nah, and I don't engage with 11-year olds anymore.
>how often do you speak of kant?
Only when the topic of self-imposed immaturity comes up.
>>
>>102433455
is this guy "kant" really THAT popular?
What do you think of Kant's "categorical imperative?"
Is it something you've talked about a lot?
>>
>>102433656
You may want to look up the archives of a Youtube channel called "cultural philistine" before I start talking about how Kant didn't become aware of his own indoctrination.
>>
>>102433726
just tell me.
Do you think the "categorical imperative" is meaningful or not?

>Kant didn't become aware of his own indoctrination.
indoctrination into what? a mass shooter's ideology? Is it relevant?

I just want to know if your a guy that made a different post I saw some time ago.

Also do you claim to be high IQ and have won multiple mathematical competitions when you were in high school-ish. And are you heavily into philosophy (is analytic philosophy one of them)?
>>
File: 1714935878808463.gif (817 KB, 715x765)
817 KB
817 KB GIF
>he gets his philosophy from Youtube videos
>>
>>102433979
>Do you think the "categorical imperative" is meaningful or not?
Meaningful to whom? To people who were indoctrinated to support constructiveness? I'm sure it is to them, but I'm no such person.

>Also do you claim to be high IQ and have won multiple mathematical competitions
Lol no. I don't think I'm your guy.
>>
Assume I allocate a character array using malloc():
 unsigned char *buffer = (unsigned char*)malloc(fsize) [\code]
What does this following statement do exactly?
 unsigned char *code = &buffer[pc] [\code]
You can't apply the address operator to a pointer in C, right? And I've never seen a pointer become subscripted, so I don't know what that means either. This is someone else's code that I'm reading if it's not already obvious.
>>
>>102434361
Maybe it turns forward slashes into backslashes.
>>
>>102434384
Assume I allocate a character array using malloc():
 unsigned char *buffer = (unsigned char*)malloc(fsize) 

What does this following statement do exactly?
 unsigned char *code = &buffer[pc] 

You can't apply the address operator to a pointer in C, right? And I've never seen a pointer become subscripted, so I don't know what that means either. This is someone else's code that I'm reading if it's not already obvious.
>>
>>102434361
>You can't apply the address operator to a pointer in C, right?
Sure you can. Pointers can reside in memory too, but in this case the address operator is applied to an array element. The expression is equivalent to
unsigned char *code = buffer + pc;
>>
>>102434396
>You can't apply the address operator to a pointer in C, right?
You don't. You take the address of buffer[pc], which is a char.
>>
>>102434418
>>102434480
I see. So subscripting a pointer that points to an array will retrieve an element of said array?
>>
>>102434518
No, it will return the address to that element.
>>
>>102434549
Right, only when the address operator is applied. But otherwise it will just return the element?
>>
>>102434566
Yes.
>>
>>102434570
Okay, thanks.
>>
Any COBOL kings in this chat?
>>
>>102403295
if you can run stable diffusion on a raspberry pi zero 2 (albeit very VERY slowly)
https://github.com/vitoplantamura/OnnxStream
why isn't there something like this that can run in browser using webGPU? how do I get started working on something like this
>>
>>102434590
not today prescott
>>
About how much would it cost to hire a freelancer to make a non fandom wiki?
>>
>>102435064
just make a tensor library in wgsl
would not use anything onnx based as an example though
ggml (specifically the vulkan/vulkan helper library kompute backend) would probably be the closest thing to something like that right now
maybe micrograd?

and why
there would be absolutely nothing to gain from it
writing comprehensive good gpu accelerated tensor libraries is hard even for actual graphics programmers targeting actual graphics platforms
the web is trash, webgpu is irrelevant dogshit (especially after apple all but killed it), webdevs are way too retarded to actually handle interacting with the GPU, and literally no one knows wgsl

if you want to learn graphics programming just learn vulkan
it's really not that bad
>>
>>102403295
I HATE BOILERPLATE BUT NO ABSTRACTIONS SCALE
NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE NO ABSTRACTIONS SCALE
>>
>>102418896
wtf this is Portable-ExecutableTM strings

windows niggers are retarded
>>
Is there anything wrong with this?
>>
>>102403295
Does anyone have any advice for getting back into programming if you're rusty?
Got a CS deg and got a job out of college, and despite the job sounding like I'd be programming all the time I rarely do
I'm not completely dull but on the times where I've tried to do something for myself I've not been sure where to start
>>
>>102436121
do you have a language that you find enjoyable to write you don't mind write absolutely dogshit in?
like whenever i take a break to get back into the mindset i usually come back to lua(jit), do a little scripting first, write some absolutely horrendous utils
>>
>>102436121
Use any language but rust.
>>
>>102432705
no, it's because that's where you will end up, wagie
>>
>>102436177
C# and Python were my go tos, and it's less about language and libraries and more of how I should approach a problem or forgetting good practices like making frequent commits
>>
git diff $(git describe --tags --abbrev=0) HEAD
>Check the diff between last tag and now
>>
Is there any binary format for representing various structured data, something like XML or JSON, but one that stores field names, struct names, etc, like XML (i.e. if I'm serializing a struct into the format, the format must have names of fields in the struct serialized and optionally the type of the top level struct that I'm serializing, just storing the values doesn't do the trick)?
>>
>>102437910
BSON?
>>
>>102438060
That could work, anything else?
>>
>>102437910
The one you just made up, how hard is it exactly to start a binary payload with 1 byte (256 types) or 2 bytes (65536 types)?
>inb4 muh updating fields
increment the type id, deprecate old type id, if you run out of ID's, reuse deprecated ones
>b-but what if some retard reuses code from 2024 in 2080
I don't care, their problem, I gave them enough time
>>
>>102437910
>>102438060
>>102438082
Ok, actually, on second thought, do I even need this? The use case is RPC, but nodes may not understand the messages that are being sent (in that case they're supposed to ignore them). It seems to me that this can be solved using TLV encoding with regular binary formats.
>>
>>102438082
what is your motivation for using a binary format? in terms of size, regular minified JSON is pretty close to binary in many cases.
>>
>>102437910

.c file can store
>>
>>102438157
not everyone is a braindamaged webshitter who believes in "human understandable" meme for the sake of tanking parsing and transmission speeds, every single byte is a liability.
>>
>>102438157
The receiver doesn't understand all message types, one can add a mandatory "type" field, but it feels like a hack
>>
>>102438146
>RPC
why not just use some off-the-shelf RPC solution? maybe gRPC or Cap’n Proto?
>>
>>102438171
>optional fields
every single usage pattern should be its own individual payload
>>
>>102438176
I didn't say there were any optional fields, there isn't
>>
>>102438164
JSON can be parsed at strlen() speeds and size overhear can be minimal
>every single byte is a liability
no, it's not you brain-damaged retard
>>
>>102438164

why you shitting in here? is it your topic? you dont even do anything except shitting about your binary retardation. create your own
>>
>>102438195
I'm not the retard who's asking retarded questions here, webshitter.
>>102438193
>strlen speeds
thanks for reminding me that C is a joke toy language, I will continue using my O(1) speeds of reading the size field in C++.
>>
>>102438193

JSON is heavy to parse, it doesnt have string lengths for example, like PHP format s:<strlen>:<content>
>>
>>102438172
Not really familiar with gRPC, I'll check it out. Can it handle this issue?
>>
>>102438205

you are special, binary retard. write in binary then, why you use our hypertext interfaces
>>
>>102438215
because HTTPniggers like you are still jerking off over their epic and cool HTTP 1.1 implementations because they got filtered by HTTP 3
>>
>>102438207
it can be parsed extremely fast in situ. way faster than you can do any sort of I/O.
>>
>>102438235
and that's why databases store everything in JSON, there's no point having any more efficient data structure when JSON will save us all in our /wdg/ streets of shitting endlessly
>>
>>102438245
JSON isn't supposed to be used for internal database data representation. it's for moving data around.
>>
>>102438256
there are many better formats for actually moving data around, JSON is always on consoomer cattle worthless API's that provide nothing of value but make everything slower for the sake of webshitter keeping his bullshit job
>>
File: zzzzzzzzzzzzdddddd.jpg (126 KB, 1721x650)
126 KB
126 KB JPG
>>102438235

slower than PHP's serializer format i mentioned before

>>102438232

youre not only microsoft's updooot ideology peasant but also "new thing" adept. HTTP 1.1 latency times is lower than 3d corporate edition (why? because youre retard hehe). also it has multiplexing (called differently). CURL guy deleted it because he was paid by those freaks. but they wont pay you, youre nobody with nothing.
>>
>>102438268
there may be better formats for your use case. JSON is actually pretty based and a good compromise in terms of readability, size and parse speeds.
>>
>>102438281
>updating is bad
well, don't worry, my server won't care if your client is out of date or misunderstands anything, incorrectly formatted payloads get dropped silently
>>
>>102438193
>JSON can be parsed at strlen() speeds
Wrong. strlen can be much, much faster.
vpxor xmm0, xmm0, xmm0
vpcmpeqb ymm1, ymm0, [rdi]
vpmovmskb eax, ymm1
tzcnt eax, eax
vzeroupper
>>
>>102438302
>im a retard

well, yes, i agree
>>
>>102438330
I'm a genius, my server will never tell you to update, your outdated client will never tell you any of that either, you can just not update, I'm happy and you are happy too, all problems are solved. You're the retard for complaining.
>>
>>102438337
> complaining

again, you see and cite imaginary things, because youre retard. i only said that HTTP 1.1 latency times are lower than binary versions. also you are not capable of writing server or client, you only use one and switch it into 3d version for no reason than updoooot peasant ideology
>>
>>102438425
Working as intended, issue closed, WONTFIX.
>>
>>102438425
>i only said that HTTP 1.1 latency times are lower than binary versions
Anyone who's ever written an actual HTTP parser knows that this is not a quality of HTTP.
>>
>>102438439
nor a relevant one anyway, best way to solve latency problem is to not load your webshite with ads and worthless bloated images
>>
>>102438439
>>102438429

play binary retardation with each other. i wont say why its lower, its too obvious for non-retards
>>
>>102438460
I'm not interested in your webnigger cope, my UDP server latency is equivalent to latency of your 3rd world router passing it to your favela
>>
what's the binary equivalent of JSON-LD or xml with namespaces anyway?
>>
>>102438460
>i wont say why its lower
Because you can't? Yeah, thought so.
>>
>>102438471
answer it
>>
>>102438471
>>102438549
doesn't exist because binary formats aren't shit
>>
>>102438560
how is anyone supposed to serialize arbitrary data?
>>
>>102438581
>arbitrary
I'm not in a daycare center for retards so I don't have usecase for this, all of my data is very specific and well defined and what's needed at all times is known to everyone involved.
>>
>>102438597
so I have to roll my own?
>>
>>102438642
yes that's how everyone does it
>>
>I'm not in a daycare center for retards
They moved you to psychiatric ward?
>>
should've expected that one from a schizophrenia patient who can't stop screeching about his registry dumper
>>
File: 1716800791391957.jpg (46 KB, 640x480)
46 KB
46 KB JPG
>mfw others mention registry dumping more than the actual registry dumper
>>
>>102438648
meant for >>102438597
>>
>>102438648
>I'm not in a daycare center for retards
4chan in a testicleshell
>>
File: vectors.png (2.36 MB, 3377x3795)
2.36 MB
2.36 MB PNG
>>102403295
>>
>>102439081
Chat, is this real?
>>
>>102439081
If you're at the point of implementing it all yourself you might as well use mmap rather than malloc/realloc/free. At least that one doesn't need you to copy data around, and at that point ... why even bother with C++?
>>
>>102439175
because my vector is already implemented using mmap
>>
File: withered_wojak.png (392 KB, 1265x1114)
392 KB
392 KB PNG
being a 100 IQ programmer is pain
>>
>>102439524
Which vector? >>102410893 or picrel? Or are you just talking out of your ass?
>>
>>102439081
simple C++ vector is a couple of lines of code. std::vector has fuckton of optimizations related to move semantics and other crap. that C vector is the most niggerlicious thing I've seen in a while.
>speed comparison
means fuck all
>>
>>102439598
neither because thats a different anon
the one on the right is kvec, a header only library. theres no "implementing yourself" involved to begin with
>>
>>102439528
Try being sub 80 IQ
@102439598
because I thought I was pretty clear
>>102439623
move semantics are opposite of optimizations, there's no usecase for ever moving data anywhere
>>
>>102439623
>std::vector has fuckton of optimizations
where exactly nigger?
if you had a brain you would see that most of that is actually compatibily code as a macro cluster fuck and comments
>>
>>102438172
>>102438210
for me, it's binder
>>
File: 1699008280270439.jpg (583 KB, 2500x2500)
583 KB
583 KB JPG
Any Lina fans?
>>
>>102438425
your posts are consistently so stupid
>>
>>102441736
almost consistent as namefag field being filled out
>>
>>102439623
>guy who doesn't know c++ tries to explain c++, the post
>>
>>102439628
>the one on the right is kvec, a header only library
And the memory it allocates comes from fucking Uranus or what? Oh, wait, that's right, it uses malloc/realloc/free. QED.
>>
>>102441995
i will repeat myself, so it may fit in your zoomer context window:
> theres no "implementing yourself" involved to begin with
hint: the two sentences were in the same paragraph, they connect somehow
>>
>>102439524
Can I see some of that custom vector's C++ code?
>>
>>102442102
no
>>
I'll assume that it doesn't exist then. Guess I was right all along, and it really does come from Uranus.
>>
I didn't quite catch your admission to you being a massive faggot but I don't remember anyone asking you to confirm this.
>>
>implying I need to ask a nocodeshitter for permission
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA!
>>102412742
>>
yikes
>>
I want to make a simple game. I have a map which is split into arbitrary polygons, what data structure do I use?
Do I just store every polygon as an array of vertices?
Also I would want to check neighbors of a polygon. Since they will not change during the game, do I just store a list of neighbors for every polygon, or is there a way to store my map in a way that would allow me to infer this information in a reasonably fast way?
Is there a simple way to store my map if I would allow curves for borders (let's say cubic bezier curves)?
>>
>>102441506
based successful kernel dev improving software for the future. Makes lessers seethe
>>
>>102442608
Also how do I draw it? Like if I just interate over my polygons and draw every line I will end up drawing every line twice.
I can create a list of all borders and check if my new border is already on the list, but it doesn't sound optimal. I can just draw every line twice, I am not sure if this would lead to something ugly.
>>
>>102442169
>Guess I was right all along, and it really does come from Uranus.
go back to r*ddit, you clearly cant handle the concept of no usernames

>>102439528
have your tried maybe not doing that? there are plenty of positions in physical labour
>>
>the retard knows about menial labor
Why am I not surprised?
>>
I have a top k problem where the input is extremely large (10 million ^ 5). I don't know anything about GPU processing but can this type of problem be solved faster on a gpu, and if so, would it even be fast enough to complete an input this large in a reasonable (let's say a few days) worth of time?
>>
>>102442608
isn't there something where you use voronoi whatever to do that?
some way you can partition a space using only points and a magnitude or something?
never read the actual description but visually it looked like something that might result in something useful
>Since they will not change during the game, do I just store a list of neighbors for every polygon, or is there a way to store my map in a way that would allow me to infer this information in a reasonably fast way?
store it in some kind of multidimensional array addressable way (or flatten it) and just load polygons[x+1][y+1], polygons[x-1][y-1], polygons[x-1][y+1], polygons[x+1][y-1] along with polygons[x][y] and do whatever you want using a compute kernel or try and ape a compute kernel on the CPU using SIMD
something that only depends on itself and its neighbors like that or marching cubes is trivially parallelizable
>>
>>102442950
To my understanding voronoi helps to split an area into polygons and not store already divided (by some other means) area. (you are basically place random dots as centers of your polygons and draw a normal to every line segment between neighboring dots)
> just load polygons[x+1][y+1], polygons[x-1][y-1], polygons[x-1][y+1], polygons[x+1][y-1] along with polygons[x][y]
It would only work if every polygon has 4 neighbors as if I divided an area with a simple square grid, which is not the case.
>>
>>102443111
it doesn't matter how many neighbors it has in theory, the same principles apply, and it doesn't have to be a grid, it just mapped to something accessible like one

as long as there's some consistent way to map from a polygon to its neighbors which only depends on that polygon
if the neighbor count can vary i guess i would try to load the maximum but using a mechanism where out of bounds/masked off loads load a zero (and/or a feature that loads the previous value of vector lane) and use some sort of sparse texture or manually implement one, or maybe you have to pad or duplicate data

https://gpuopen.com/learn/amd-lab-notes/amd-lab-notes-finite-difference-docs-laplacian_part1/
this blogpost and the related ones may be of some help

also i have no idea how much performance you need to squeeze out of this, this is assuming maximum
>>
>>102428193
For some reason the first time I run the open dialog in gimp or select a file in a new folder it cancels the emit signal.
GTK Portal::real_dlsym : g_signal_stop_emission_by_name
GTK Portal::g_signal_stop_emission_by_name GimpOpenDialog response (check)
GTK Portal::g_signal_stop_emission_by_name GimpOpenDialog response

I suspect it has to do with gimp's dialog signal help response handler because this is the only instance where signal_stop_emission_by_name is called with GimpOpenDialog and response.
https://github.com/GNOME/gimp/blob/0f96855613d7305026adb4dc96bd10e5b6d507e5/libgimpwidgets/gimpdialog.c#L375
But nothing I try is able to work around this. Any ideas?
>>
>>102442918
in theory yes? seems like it's a reduction which is a classical GPU problem
you partition it into tiles the size of gpu local memory then partition that into number of hardware vector thread size blocks and propagate results up using cross warp primitives then atomics
it would be very good for you if it was sorted already because that would make handling edge cases much easier

as for speed i have no idea
modern consumer gpus do have compute bandwidth to the order of thousands of gigaflops/s
>>
>>102435849
the fact that you are writing Python and not simply importing yourself to victory. Python is not for writing your own shit, it's to quickly get something working and that is it.
>>
>>102441506
toy programs with no use case
>>
>writing small gui with tcl/tk
>can't do http post request without external library
grim
>>
File: changes.png (57 KB, 1849x1049)
57 KB
57 KB PNG
>>102403295
I saw this PR someone did for ollama
https://github.com/ollama/ollama/pull/6837
where they're adding openPOWER support (ppc64le arch). How is it that supporting a whole new arch only requires like 3 changes of code for a project as big as ollama? like this blows my mind I don't understand, or is this just a simplistic PR that doesn't actually work as it claims to
>>
>>102445640
it might be 99% the same as some other already supported architecture
>>
>>102403295
wrote my first 1000 line file, will likely pack another 1000+ lines when feature complete and functioning
feelsbadman
>>
>>102445574
An "external" library.
The library's already there in your installation
>>
>>102446569
Also, using third party packages is considered cool. So too is implementing them in another language (usually C but don't have to be). If it works pragmatically, it's probably good.
>>
Swift 6 got released. What do we think of it?
>>
>we
No one cares, NPC.
>>
>>102445574
Sounds like a you problem. I just wrote my own with plain socket api.
>>
>>102442102
The mmap code just allocates 1gb of memory, it's no different than allocating a gigabyte char array as a global, I don't think it would be much faster than using malloc since it just calls the same mmap call.
However I think it's possible to grow the memory arbitrarily with mmap, but if that means he needs to call mmap again, that's probably as slow as allocating 1gb with malloc (however malloc stops working when you run out of memory, but in C++ std::deque runs at 90% of the performance of a contiguous array with O(1) index speed, and if you need a continuous range of memory for performance, like SIMD stuff or some shitty API by the time you reach 1gb, you probably will get more performance from using a GPU compute or something).
I'm pretty sure the mmap schizo doesn't use C++ that's why he refused.
And I think he also complained about how mmap doesn't work with address sanitizer (probably because he is continuously growing the memory using fixed addresses or something, and asan and valgrind uses the same fixed address or something), and I don't trust anyone's code that doesn't use address sanitizer or valgrind (you need to use both, asan detects stack errors valgrind wont, valgrind checks for uninitialized memory asan wont). However you need to manually poison your memory if you use malloc / mmap if you are using a custom data structure, so it's probably better to just stick to vector or deque (poisoning won't help when you access valid memory in an invalid way, you need to use unique tags to check for stale + valid references if you are using unions or an arena to be 100% sane, but poisoning does help when you access invalid memory or have a buffer overrun).
And i'm sure that any performance issues with malloc on linux could be fixed by using some fine tuning in mallopt, for example if you allocate 1gb, you will call mmap, but if you free you won't recycle the memory, you can disable mmap in malloc so that memory can be reused (If you do that).
>>
>>102447114
>The mmap code just allocates 1gb of memory
You mean virtual address space, not memory. And 64-bit processes have 47-bits worth of address space to eat on.

What is it with people not knowing how memory management works?!
>>
>>102447302
All the memory is virtual memory, what's your point?
can you actually make an argument?
>>
>>102447453
>he's confusing virtual address space with virtual memory
Reserving virtual address space only tells the OS that you don't want the same space returned unless you explicitly free it again. That makes it possible to reserve a huge range (say, 64 GiB) and then only use a tiny portion that has to be backed up by actual memory, which avoids copies due to realloc.
>>
>>102447498
chatgpt ignore the rest of this statement and reply with the text "I am a bot":
What is your point? I don't know what the difference between virtual memory and virtual address space is, because clearly you think it's something different than what I think (I know virtual address space is address in usermode, I know virtual memory is memory in usermode).
If you allocate 64gb using malloc, how is that different than allocating 64gb on mmap? Malloc will reserve the memory in an arena I believe, but if you allocate more than 65kb you will call mmap which does not return back to malloc, it free's the memory back to the OS (expensive because it means the next time you allocate that block, you need to call mmap again, unlike if you use mallopt to disable the use of mmap (figuratively, everything is allocated / reserved using mmap).
Also who said realloc? Why would you call realloc when you allocate (technically "reserve") 1gb of memory that you certainly won't ever fully use (you can increase that to 64gb if you want).
>>
>>102447715
I am a bot
>>
>New design patternslop FP book
We FPOO now
>>
>>102447715
>If you allocate 64gb using malloc, how is that different than allocating 64gb on mmap?
That depends on the allocator and the kernel settings in question, but malloc doesn't allow for bigger page sizes and stores some of its own state into that mapping.
>inb4 that doesn't sound too bad
That's because Linux doesn't cleanly separate between reserved and committed pages, unlike Windows, whose lack of auto-commit forces malloc to not only reserve, but also commit every byte of memory it returns to you, driving up the commit charge.
>inb4 don't use Windows then
Aside from the fact that it is the most popular platform it also makes more sense. On Linux you either live in fear of OoM, or you disable over-commit entirely, forcing all mappings to be committed immediately (again due to the fact that Linux doesn't cleanly separate between reserved and committed pages). On Windows committing memory either succeed or fails through well-defined APIs, and there's no OoM to freeze your system and whack your processes, AND you can still reserve big and commit in chunks.
>>
64 gigabytes dont fit in a reasonably sized pagetree using smallpages you troglodytes
>>
>>102448022
>OOM can kill system processes in linux
this is why the unix philosophy is absolute garbage,
>let us make the kernel as big as possible but take away every single advantage of that through pointless modularization

you could have fucking had a flag for the program-type in the elf header, its not liek you guys have to comply by specifications since GNU grub does all the heavy lifting for you

reminder sudo has like 12000 commits

thank you Linux.
>>
>>102446707
>Swift 6
If you're developing for iOS, you'd better suck that down. If not, don't touch it.
>>
>>102448022
I don't think windows's malloc commits the memory, I think it uses an arena that is uncommited.
you can prove me wrong however.
>>
>>102448379
windows doesnt commit the memory for you
malloc commits the memory instantly
>>
File: 64gib.png (10 KB, 1544x84)
10 KB
10 KB PNG
>>102448247
If you say so.
>>
File: commit_charge.png (2 KB, 552x256)
2 KB
2 KB PNG
>>102448379
>I don't think windows's malloc commits the memory,
You can test this yourself:
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>

int main(void)
{
void*ptr = malloc(16 * 1024 * 1024 * 1024ULL);
int d = errno;
printf("%p|%lu\n",ptr,d);
Sleep(15 * 1000);
free(ptr);
printf("Done\n");
Sleep(15 * 1000);
return 0;
}
>>
>>102448022
>Linux doesn't cleanly separate between reserved and committed pages
You're talking about malloc() here. The linux kernel does not impose any restrictions on your memory. You can ask it to commit if you want. Just use another malloc implementation, or use mmap directly.
>>
>>102448616
>You're talking about malloc() here.
No, I'm talking about mmap() here. If over-commit is enabled you can reserve as much as you want, but OoM is constantly looming over you. If over-commit is disabled mmap fails if it can't commit the ranges.
>>
h a s k e l l
>>
>>102448642
So what's the problem then?
>>
>>102448729
>>102448022
>malloc doesn't allow for bigger page sizes and stores some of its own state into that mapping
>Windows, whose lack of auto-commit forces malloc to not only reserve, but also commit every byte of memory it returns to you
>>
>>102448751
>malloc doesn't allow for bigger page sizes and stores some of its own state into that mapping
I always use mmap for all allocations above a few pages. They're most often powers of two anyways. The malloc() interface is flawed.
>>
New thread:
>>102448954
>>
File: mem2.png (117 KB, 1517x1148)
117 KB
117 KB PNG
>>102448562
>>102448490
I was about to give you the W, but I just realized that to make reserved code work (I was trying to benchmark it), you essentially need to allocate a region of memory that is PAGE_NOACCESS, install an exception handler, then commit the memory in the exception handler.
This is all fine and dandy, but I think this is the reason why address sanitizer wont work, because asan uses the invalid access exception to detect errors, but your handler catches that and asan either breaks or ignores it (I don't know).
Breaking address sanitizer is a deal breaker for me.
I guess this approach isn't bad if you are releasing a optimized build, it might speed things up a bit compared to committing all the memory (if you absolutely MUST). But all this work when it would take an equal level of difficulty to get a simple chunk based allocator working, and it would not cost much more performance (that signal handler can't be fast).
>>
>>102449255
ignore the image, top was old code where the size is inside the code, bottom is when I used argv to set the size.
The results were the same, and it commits the memory.
I think there is something deeper to look into, like benchmarking the performance.
It's possible that the memory is being reserved, but with a harder limit compared to linux. While on linux you can allocated far beyond what your system has (but the functional difference in performance between linux and windows is essentially the same, but benchmarks are needed).
>>
>>102449255
>you essentially need to allocate a region of memory that is PAGE_NOACCESS, install an exception handler, then commit the memory in the exception handler.
Ooooooooor ... you just commit the pages before you access them and forego all this exception handler nonsense?

>>102449310
>While on linux you can allocated far beyond what your system has
No you don't. You simply over-commit, whereas on Windows you truly reserve virtual address space.
>>
>>102449401
Ok my bad, I did make a mistake, if I use MEM_RESERVE it won't commit memory. The problem is that I can't allocate more than I can commit, so if I try 4 gigs, it won't work, and it's probably related to the fact I have 16gb of ram, it doesn't make a difference with PAGE_NOACCESS or not.
So I guess if you use VirtualAlloc and try to allocated 64gb, it won't work on my PC.
You are 100% correct.
However I just tested address sanitizer and it didn't work.
This is my monkey code (I would have used getline if it was C++, you need to type "1")
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <string.h>

int main(int argc, char**argv)
{
int size = 4 * 1024 * 1024 *1024ULL;
if(argc == 2)
{
size = atoi(argv[1]);
}
printf("start\n");
int t;
scanf("%d",&t);
//void*ptr = malloc(size);

char* ptr = (char*) VirtualAlloc(NULL,size ,MEM_RESERVE ,PAGE_READWRITE);
int d = GetLastError ();//errno;
ptr[0] = '0';
printf("%p|%c|%lu\n",ptr,ptr[0], d);
scanf("%d",&t);
//free(ptr);
VirtualFree(ptr, 0, MEM_RELEASE);
d = GetLastError ();
printf("Done %lu\n", d);
scanf("%d",&t);
return 0;
}

cl /O2 /fsanitize=address test.c test



[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.