/tech/ - Technology

Technology & Computing


New Reply
Name
×
Sage
Subject
Message
Files Max 5 files32MB total
Tegaki
Password
[New Reply]


1504024316530.png
[Hide] (137.5KB, 478x365)
Nobody wants to make the thread edition

See also /agdg/ at >>>/v/ for videogames.

What are you working on?
Replies: >>13615 >>13694
1_out36.webm
[Hide] (1.1MB, 1000x650, 00:43)
I learned that FFmpeg can record your screen, so I immediately decided to make a screen recorder to replace ShareX. It's so much more convenient to have everything I need pop up and configurable immediately, than going to some settings screen in a menu within a menu within a menu and still not getting the settings I really want, all while various other hotkeys are hijacked by the program.

It records a lossless mp4 at the moment. I wanted to add a way to compress the video after recording, but I'm not sure how to add it into the UI since I'll probably want to configure the format and bitrate anyway. I'll just use a batch script to compress videos for now.

The audio is also very awkward, I have to type the name of the audio device somewhere manually since FFmpeg can't select it on it's own, and I have to enable some recorder device in my audio settings. I'm pretty sure other programs like OBS can just record whatever comes out of the speakers, but I don't know how to do that.
I could just query audio devices with FFmpeg and then pick a random one or give a dropdown selector with all the options, but it would still require you to have a recording device enabled in your audio settings.
Replies: >>8956 >>8967
>>8955
Here's also the ffmpeg command in case anyone is curious:
ffmpeg -y   -f dshow -i audio="Stereo Mix (ASUS Essence STX II"   -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size 600x400 -i desktop   -c:v libx264rgb -preset ultrafast -qp 0   -c:a libopus -b:a 320k   "output.mp4"
The audio="" is where you need to put your audio device, which you can query with this command:
ffmpeg   -hide_banner   -f dshow -list_devices true   -i dummy

On Linux you need to use something other than "dshow".
Replies: >>8957
>>8956
Oh and the recording is stopped by typing "q" into the ffmpeg command line.
Just learning C for now, and I'm getting much farther than I ever have previously in my life trying to do this. I'll learn Vulkan immediately after so I can try my hand at a "game engine" (Which might also be useful for 3D animation, who knows?).
Replies: >>8974
>>8955
Finished it for the most part and uploaded it here:
https://sundee.neocities.org/regioncap/index.html
You'll have to manually compress recorded videos afterwards.
>>8958
>'ll learn Vulkan immediately after so I can try my hand at a "game engine"
It's going to take years of programming and math study before you can write a game engine.
Replies: >>8976
>>8974
A game engine, no.
A good game engine, yes.
Replies: >>8977
>>8976
1) I have all the time in the world to study (I tried starting out in the morning about a week ago and was able to study for about 10 hours that day)
2) I mainly want to do it because its fun

If I can get moneys on some decently reliable donation platform or something for FOSSing my code that's just a cherry on top.
Replies: >>8988
thumbscat.jpg
[Hide] (14.2KB, 180x192)
>>8977
Good luck with your programming and programming studies anon. I'm also a NEET programmer.
>do subpixel font rendering
>can barely tell a difference
>it's 9-30x slower
Well that was disappointing. 4 different size comparisons, subpixel renderer on top, cached glyph sprites on bottom.
Replies: >>9011 >>9015
fonts.png
[Hide] (103.4KB, 878x568)
>>9010
Forgot image.
Replies: >>9012 >>9013
subpixel_font_rendering.png
[Hide] (11.1KB, 2012x120)
>>9011
You'd see some rainbow colors in the zoomed in versions if that was subpixel font rendering.
Replies: >>9013
>>9011
Realized that I forgot to do proper alpha blending (which is why one of them seemed brighter), that made it slightly faster (the difference doesn't go above 20x anymore). I guess it's because my blending function has a much faster branch for fully transparent and fully opaque pixels.

>>9012
I mean subpixel positioning, so the glyph starting point isn't aligned to pixels.
>>9010
How is the initial rendering done? I just thought of this quickly, but if this isn't being done already would it potentially be faster and better looking?
>Assess screen size, scale, window dimensions, etc.
>Select closest size of the chosen font available to the rendered size ("A" of font X has (clean) sizes 1, 2, 4, 8, etc... A scale approximately 6.5 times larger than size 1 would select size 8 and scale it downwards)
>Cache the font approximation for speed (You could have 1000+ extremely high quality sizes of font Xs character set due to how cheap storage is nowadays...)
>Insert characters according to the arrangement of the text
>Combine characters together into one massive, static texture that only needs to be translated whenever a page is moved rather than rendered frame-by-frame game-engine style (Think of my entire posts body as being one single image with interactivity imposed on top of it like buttons (cursor "collision"? (If that's the right term to use here)), text "highlighting", etc.)
As far as I know, browsers render game engine style with each frame independent of one another, right?
table.png
[Hide] (8.5KB, 609x145)
Any better ideas for formatting tables? This looks super ugly and clumsy.

I was going to separate cells with simply ||| or something, but the problem is that you need to be able to turn some cells into header cells.
Replies: >>9231 >>9233
>>9230
Markdown already solved that problem. Use markdown syntax.
Replies: >>9232
>>9231
Markdown is shit and gay and also retarded.
Replies: >>9306
table2.png
[Hide] (10.3KB, 604x242)
>>9230
I realized that the closing tag is unnecessary since you can't put cells or rows inside cells anyway. This makes it a bit more streamlined. Not sure which one of these is better though.
>>9232
Even if it was it's still a million times better than HTML.
What do I do when someone has assert() braindamage?
Replies: >>9319
>>9314
>assert() braindamage
What do you mean?
Replies: >>9320
>>9319
Nigger is out there writing functions that take an int and it has to be >= 0 so he calls assert(n >= 0), or he writes a function that takes a pointer and puts in assert(p != NULL), or he writes a struct and a set of functions to operate on it and asserts all the members.
 
He doesn't understand that either his checks either do nothing and shouldn't be there or the check should be in the release build, and that he's polluting the source code with a billion redundant checks in every callee instead of checking for bad values once where they are acquired. We already had a bug where someone else who also has assert() brain damage was not checking the return value of malloc() and assert()ing it instead.
Replies: >>9321
>>9320
assert() your dominance by slapping that bitch until he gets the message.
vs.png
[Hide] (14.8KB, 210x613)
I'm not sure if this counts as software but I made an ebin prompt generator. Probably the smallest program I've ever made not counting tests.
Replies: >>9590
>>9586
It outputs "<word> vs <word>"?
Replies: >>9625
Screenshot_2023-04-26_02-57-54.png
[Hide] (2.2KB, 579x611)
oh yeah check this scrub
int l=24;for(int i=l;i>0;i--){for(int j=0;j<i+l;j++)putchar(' ');for(int j=i;j<l*2-1-i;j++)putchar('=');putchar('\n');}for(int i=l;i>0;i--){for(int j=0;j<i;j++)putchar(' ');for(int j=i;j<l*2-1-i;j++)putchar('=');for(int j=0;j<i;j++)putchar(' ');for(int j=0;j<i;j++)putchar(' ');for(int j=i;j<l*2-1-i;j++)putchar('=');putchar('\n');}
Replies: >>9592
triforce.png
[Hide] (10.9KB, 942x1058)
>>9591
Impressive.
.jpg
[Hide] (67KB, 474x598)
>>9590
Yes.
ClipboardImage.png
[Hide] (59.2KB, 512x524)
Thoughts on Janet? Nice syntax and easy to deploy into a C/C++ project (only a pair of .c/.h files). It's been getting some traction on HN but I'm yet to try it.
https://janet-lang.org/
Replies: >>9678
>>9671
Post your program fag.
Is there any way to make Windows tell me why it's fucking closing my program? There's clearly a crash but it won't tell me why it crashes. GDB tells me jack shit either. Would SOMEBODY FUCKING TELL ME WHY IT'S BEING CLOSED? It's so fucking simple.

I'm setting SetUnhandledExceptionFilter but it's fucking doing nothing. I tested dereferencing an invalid pointer and that shit works, but the crash I'm trying to debug does not. Literally nobody is willing to tell me why my program is crashing and being closed.
Replies: >>9716 >>9726
>>9710
What sort of program are you trying to run?
Replies: >>9718
/tech/, you're invited to our C++ class open to everyone starting this coming Saturday. It's aimed at beginners, but we'll be digging into the more advanced stuff eventually as well. Cheers.
https://alogs.space/robowaifu/res/19777.html#19777
Replies: >>9723
>>9716
Why don't you think about it.
Screenshot_2023-05-01_19-17-37.png
[Hide] (30.8KB, 174x206)
>>9717
>cblawsblaws
crime of the century, c literally takes 15m to learn its only difficult for people whove filled their tiny heads with abstract junk like blawsblaws
Replies: >>9725
>>9723
C++ niggas don't even know what 1+1 is because + could be overloaded
Replies: >>9728
>>9710
Are you accessing the Windows system over a remote shell?
You get a graphical window showing the error when Windows kills your program, or the loader throws an error, and so on. There won't be anything in the command line.
Replies: >>9731
>>9725
>C++ niggas don't even know what 1+1 is because + could be overloaded
No, you cannot overload an operator where the only arguments are built-in types. 1 is a built-in type (int).
Replies: >>9729
>>9728
iostream uses the bitshift for overloading with builtin types, 
(char)'#' << (int)1 (which is fucking (char)'F') is for some retarded reason (char[2])"#1"
Replies: >>9730
>>9729
That's perfectly fine, since it's part of the standard, and up to each compiler implementor how they want to do the standard. The point is that you, a user, can't overload operators using only built-in types.
>>9726
I don't care about the command line, I want LITERALLY ANYTHING. The only difference between pressing the X to close the window, and my problem, is that any code after the crash won't execute. Nothing else happens, it just closes. It also crashes at random inconsistent locations so there's nothing that it crashes on.

>Are you accessing the Windows system over a remote shell?
No.

I solved the problem yesterday though, one of my libraries had a bug so a buffer didn't resize properly. I don't understand why the operating system doesn't tell me that it closed my program because of an invalid memory access, it can't close my program without knowing why it's doing it so why won't it just tell me? Fuck I'm so done with programming.

And GDB has never helped me solve this kind of problem because the call stack gets corrupted as soon as someone sneezes, so I don't know why I even still have it installed.
Replies: >>9738 >>9749
>>9731
it obviously does if its killed it, i think with winshit10 all error messages are disabled by default you have to disable 'Prevent display of the user interface for critical errors' in policies
>>9731
Well, if you have a corruption in the stack, the stack gets corrupted. That's normal.
Run the program under valgrind or OpenBSD (OpenBSD has strong memory protections, makes programs crash more often) and see if helps.
img.png
[Hide] (162.8KB, 723x486)
What features would you want in an image viewer?
When I started thinking about it, I immediately came up with some very basic things that I've never seen before, like a timeline for gif animations and the ability to quickly adjust the background color brightness for transparent images.

Viewer, not an editor.
>>10692
>What features would you want in an image viewer?
<Zoom in and out
<Move the view while zoomed in
<Toggle between fullscreen and windowed
<Rotation
<Doesn't take 30 minutes to load because you are creating thumbnails for every image in the same directory on startup
Replies: >>10698 >>10738
>>10694
>Toggle between fullscreen and windowed
By fullscreen do you mean like a presentation mode without UI?

>Doesn't take 30 minutes to load because ...
I wouldn't want the program to wait for anything at all. Even the current image loading should happen in background so I can skip to the next image without having to wait for it to finish first.
>>10692
Multiple windows spawning from a single process. Eye of MATE and LXImage both do this automatically. Cuts down on RAM use if you open more than one image, and also speeds it up once you have one instance already running. I consider this essential, but nothing else has it. Nothing else does this, but I wouldn't mind running it as a daemon, just like you'd do with a file manager, because opening images is such a common thing that there would be no downside to that. Also, zooming to fit the image to the screen/window, has to have that, but that's a common feature. I guess have other basic features. Copying the image to the clipboard, copying the path, opening the directory, opening it in another program. That kind of thing.
Replies: >>10721
>>10712
>Cuts down on RAM use
>speeds it up
>I consider this essential
I don't understand either one of these. Sharing memory between 2 windows will probably save you less RAM than what one image will take in memory, and I'd keep at least ~5 previous/adjacent images in memory to make it easier to switch back and forth between them. The program will also open instantly so I'm not sure what can be sped up from using an existing process. The only way to get meaningful RAM savings and speedups would be from viewing the same image(s) on 2 different windows, since then they could use the same image memory without loading or processing the same image twice. Technically it's useful but doesn't seem very meaningful in practice.

Having only 1 process open for the program would be cleaner for autistic reasons, but seems like a matter of opinion. I suppose the main reason you wouldn't want that is if the program is shit and freezes so you have to kill the process, but if the program isn't shit then maybe there's no reason.

All that said, I can probably(?) do that and I don't see why not.

>Copying the image to the clipboard, copying the path, opening the directory, opening it in another program
I was entirely focused on the viewing/browsing experience so I didn't consider any of these.
>>10692
>>10694
these, and support for stepping through an animated gif frame by frame.  I would also like to have customizable keyboard shortcuts, also do not invent your own keyboard shortcut scheme (use arrow keys or vim-like keybindings). Take inspiration from imv. It's pretty good.
If I have a mixture of I/O bound and compute bound tasks, is there a way to make these tasks share a thread pool without polling (doesn't scale, needs to be event based) or blocking (thread should go work on compute instead of blocking)? I don't care about latency, the program doesn't have any sort of realtime requirements.
>>10692
Could you share your code? Is it cross-platform?
>>10793
Just use libev or libevent. Or write your own with epoll and eventfd, which scales. Or a thread-safe queue + poll.
Replies: >>10801 >>10804
>>10793
pipe2( fd, O_NONBLOCK )
>>10798
Hmm, that sent me down an interesting rabbit hole: http://www.kegel.com/c10k.html
It seems others already long realized what I just realized, and now I have some reading to do. But I don't know which of libev or libevent is better...

It would be interesting if I/O readiness events came in as signals and I could add the I/O operation to the work queue from inside the signal handler, if signal handlers weren't scary. That way, I could have 8 CPU cores and a work queue being serviced by 8 threads, the 8 threads can be servicing compute jobs, then an interrupt comes in and hijacks a compute thread to add some I/O work to the work queue, the current job resumes, and when a compute job is over, the I/O job is serviced. The threads work nonstop and never block waiting on I/O, they're always either computing or servicing nonblocking I/O, there's no polling so it scales, and the program doesn't spawn any more threads than there are CPU cores to execute them in parallel so it doesn't cause excessive task switching. I wonder if such a design (or equivalent) is possible.
Replies: >>10804
>>10798
>>10801
I'm checking out libev, and I see some scary shit. They have their own syscall wrappers.

And http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#TIME_REPRESENTATION says:
>Libev represents time as a single floating point number
Fuck's sake.

On the other hand, libevent has 8 times the lines of code of libev. And libevent uses struct timeval throughout which is better but not perfect, it has several instances of code to convert timeval to timespec because all the OS APIs use timespec, and nobody thought to migrate it to timespec apparently.
I thought libevent had a chance to be good because an OpenBSD developer worked on it and it's in the OpenBSD base system, it's not. Turns out the version in the OpenBSD base is an unmaintained leftover nobody bothered to remove, it's not actually used by programs either, they use a version from the ports tree because the version in the base has fallen behind the standalone one and is missing functions. libevent is not even threaded because it uses global variables internally, libev has you pass a context to it so there's no such issue.

libev also uses relative times instead of absolute times for timeouts and the like, and then it documents what those times are relative to because it caches the time and doesn't update it every time so your 60 second timer might still be 60 seconds in the future in 120 seconds. It's absolute insanity. Dunno what libevent does here because I already don't want to use either library, no point in reading more shitcode.

Both libraries are extremely bad. Is there a good one?
cap_0.jpg
[Hide] (30.5KB, 240x240)
cap_1.jpg
[Hide] (30.9KB, 240x240)
cap_2.jpg
[Hide] (32.5KB, 240x240)
cap_3.jpg
[Hide] (24.1KB, 240x240)
cap_4.jpg
[Hide] (31.6KB, 240x240)
Tried to make a new captcha solution. I don't know how effective it is, and it's probably been done before. It splits an image into 9 cells, and then swaps one of the cells with a different image and randomizes the brightnesses.
It works pretty well for drawings, but often becomes very confusing with photographs.
Replies: >>10853 >>10854
>>10852
Forgot to mention that the goal is to select the one cell that was swapped.
sensors-16-01443-g001.png
[Hide] (562.3KB, 2833x1426)
>>10852
The randomization is good, but I think it might still be susceptible to frequency analysis. Pic 3 for example has a very obvious distribution in frequencies. Lots of hard edges and flat fills in the picture of the girl, but gradients and noisey speckling in the center left tile. Even after randomizing intensity that won't change. Is some spammer really going to write a custom FFT analysis script to bypass the captcha? Probably not. Maybe you could fuck with the frequency domain representation of the images in a way that's similar to what you're doing with intensity though?
Replies: >>10855
11.jpg
[Hide] (30.6KB, 240x240)
>>10854
I don't know much about frequency analysis, but it would be trivial to add varying amounts of noise or blurriness or gradients on each cell. May make it even harder to complete though. I don't think I'd use this captcha if I made a real website, it's cool because it can integrate the website's content into the captcha and gets new possibilities when people post stuff, but there's several flaws with it, for one there's a 1/9 chance to get it correct by selecting a random cell.
Replies: >>10858
>>10855
Could just try adding random noise to every pixel and look at the fourier transform. Might want to do it in linear color.

But yes, the algorithm here is not good, you have a much, much larger amount of possible combinations with e.g. the jschan captcha.
>>10692
I probably won't use your program, but a function I had come up with is a keybind to copy file location. I got this idea only because I was looking through my Steam screenshots which steam is abyssmal about its organization.
my_fleshlight.png
[Hide] (1MB, 926x1280)
SDL replaces the program's main() with SDL_main(). Christ, why can't people write libraries without pulling shit like this?
And don't give me "we need to init stuff" as an excuse because that's easy to do, just define an internal function that does the equivalent of pthread_once and use it on whatever subsystems need initialization. Also has the benefit that what isn't used isn't initialized.
Replies: >>10911 >>10927
>>10910
>SDL replaces the program's main() with SDL_main()
At least it's not Allegro:
<Thirdly, you must [in Allegro 4 and WIPs] write END_OF_MAIN() after the closing brace of your main function. If you don't do this, your program will not link properly with the Allegro library.
I'm guessing all windowing/multimedia libraries need to pull some tricks to work cross-platform, and those are not always elegant.
You could try one of these:
https://github.com/raysan5/raylib
https://github.com/emoon/minifb
>>10910
Put
#define SDL_MAIN_HANDLED
before the include.
slider.gif
[Hide] (185.1KB, 240x80)
How would you create a non-linear slider input?

Pic related uses a cubic scale so it's easier to select small numbers, but the white bar moves in linear scale and I'm not sure how to reverse the cubic value. I need to be able to change the size externally and move the bar based on from just the final value, so I can't use the mouse position to move it.
>>10928
You reverse the cubic value by taking its cubic root, my fellow high school dropout.
Replies: >>10930 >>10932
>>10929
That doesn't work with all easing functions.
Replies: >>10931 >>10933
>>10930
If accuracy is not important, lookup table.
Otherwise, polynomial approximation.
That_Fluoride_Stare.jpg
[Hide] (135.9KB, 680x974)
>>10929
>School is le good
>Dropping out from school is le bad
>>10928
Why cubic and not exponential since you don't need zero?
>>10930
Why wouldn't it work? It works for all monotonous functions for which you can compute an inverse. You can use bisection method or Newton's method if your inverse function doesn't have a formula.
Replies: >>10938
>>10928
use percentages and an inverse function { y=1-\frac{25}{x^{2}+25} }, 50-x is the value 100-(y*100) is the percentage the bar should be moved
>>10933
Cubic is just the first thing I threw in and then immediately realized that the bar is in the wrong position. The curve it makes is too steep though.
Is there any simple way to detect whether a string is a gibberish file name like "218023089aa48cbb59173d0e54ea24d87c118f2906ea0e44b4b566974411479e.jpg" ?
It doesn't need to be super reliable, I just want to detect a pointless gibberish file name and replace it with something else, but leave other file names in tact.

I guess I'd need to detect if there's a bunch of random segments of numbers and letters? Like: read a continuous string of numbers, then continuous string of letters, and repeat. If it alters between those ~6 times and the string is longer than 20 characters without any spaces, then it can be considered to be gibberish. Anything smarter I could be doing?
>>10963
Well, maybe you could do a dictionary check or something.
Replies: >>10965
>>10964
I think it's infinitely harder to detect if it's legit than if it's not, it could contain some short codes or weird technical keywords or names or foreign languages or whatever, and it's not guaranteed to be in any kind of correct format either.
Replies: >>10966
>>10965
You can train an AI to do it. Or try something smart like portion of string that are words.
>>10963
Maybe dumber is better than smarter:
Total number of characters if fixed length.
Range of number of characters if variable length.
Excluding characters if files you want to avoid detecting use characters the gibberish never does (e.g. spaces or underscores or CamelCase).
>>10963
names like that are easy, like you said you just count the times it switches from number to letters ie. grep -o  '[0-9]\{1,99\}[a-Z]\{1,99\}' | grep -c '.', if its higher than 5 its obviously a random name, same with caps like rDoiwTdERf
Replies: >>10971
renaming.webm
[Hide] (1.4MB, 990x690, 00:30)
>>10963
Seems to work ok with just this. I'm also checking for numbers longer than 10 characters to detect unix timestamps. I'm not entirely sure what I want to do though, maybe just delete the filename and prevent submitting unless it's changed manually.

>>10968
>same with caps like rDoiwTdERf
Good point, I'll see if I can include that.
Replies: >>10986
bonzi_it's_pretty_dead.webm
[Hide] (1.1MB, 150x214, 00:56)
>>10971
Oh my science! He's making the new chan that will revolutionize the "chan" industry!
>>10986
I've posted a lot of things I've worked on here but this is the first time someone randomly started crying about it. I wonder why.
Replies: >>10996
>>10994
Just a joke, friend. Chill.
Replies: >>10997
>>10996
Not me, I meant >>10986 to shit on you It not joke.
Replies: >>10998
>>10997
Not me either, I did actually meant >>10986 as joke and want to be filled with your seed.
>>10963
Is 1.mp4 a gibberish name? Filenames on most imageboards aren't random, they're either UNIX timestamps or hashes of the file contents. Filter by length and composition of the name. Other websites do the same a lot of the time.
Replies: >>11019 >>11022
>>11010
"1" could imply that it's first in a sequence, like page 1 of a comic.

I don't want to be too strict about it, I just want to detect names that obviously don't have any meaning, I'm specifically thinking about the hashes and unix time stamps that come from imageboards.
>>10963
>I guess I'd need to detect if there's a bunch of random segments of numbers and letters?
Hashes are a fixed length (e.g. 32 characters for MD5) and are only use 0-9 a-f (because a hash is just a big number and what you're seeing is the hexadecimal representation (a=10, b=11, c=12 etc.)

>pointless gibberish
The reason they use hashes is because the same file will always have the same hash. So you can upload the same file with different names in multiple posts and the server only needs to store one version of the file. It can also help you detect duplicates on your end to avoid wasting disk space.
Replies: >>11021 >>11022
>>11020
The source file name isn't useful for any purpose except tracking people as far as I'm concerned. To give an example, sometimes I edit an image and overwrite the original without changing the filename.
Replies: >>11022
>>11021
>The source file name isn't useful for any purpose except tracking people as far as I'm concerned
>>11010 and >>11020 explained to you exactly what the purpose is. If you're too stupid to understand then maybe we're wasting our time trying to help you.
Replies: >>11023
123.png
[Hide] (6KB, 676x227)
123.png
[Hide] (5.5KB, 620x259)
>>11022
>too stupid to understand
I think you're projecting. Tell me how you can use these filenames to identify which image is which.
freetard_security_theater.png
[Hide] (57.7KB, 808x391)
JJJ.mp4
[Hide] (885.9KB, 854x348, 00:10)
Replies: >>11161 >>11276
>>11137
>3dpd
>>11137
>freetard_security_theater.png
glad wiggers are figuring out their shits retarded 15 years after i noticed after hitting age of consent
now please remove all that PAM and such bullshit from the stock gentoo install
CSS nojs question
Is there any way, without javascript, to modify a value that is more complex than a true/false, and then read it from CSS?

For example, if I want to change a value between 1 and 100 and read it from CSS, is there any clever way to accomplish that? The closest I can think of is having 100 radio buttons each with their own CSS.
Scrollbar will let you adjust position linearly, but it's hard to make it do anything other than moving sideways.
Also a <textarea> can be dragged/resized in 2 dimensions, but that's very unreliable and kinda different on each browser.
Is there any networking library that uses io_uring?
I just want a fast networking library but it's impossible to find, but I assume that something that uses io_uring is fast by default.

I just don't understand why all these networking APIs are so fucking convoluted or why any of the decisions in them were made, so it's impossible for me to learn them, so I want someone to abstract it into a library for me.
>>11352
Ignore this question because I know that any answer is going to be shit that I hate.
>>11352
You can write one with liburing.
Or a simple search gets you https://github.com/scylladb/seastar
You also need to write your application around the "completion" concept instead of readiness.
>>11352
POSIX sockets goes back to BSD sockets.
BSD sockets was meant to be protocol agnostic in a time of rapidly changing network protocols and disjoint networks across the globe, when individuals had no access to networks and only members of organizations had access to that organization's network for that organization's purposes so there wasn't much point to encryption, the reliability features of TCP were nice but not always available or even necessary, and so on.

The idea was that at least your program worked in any of the world's many networks and hopefully the system defaulted to a sane, good protocol which would hopefully evolve over time.

Fast forward a few decades of experience and networking theory advancements and it turns out you can't abstract away the protocol from the programmer because it matters a lot, the protocols have been the same (with some retrofitted tweaks) for 40 years, you can assume IP over TCP or UDP, the incompetence of the corporations running the internet created something called ossification, reliabity is almost always a requirement but TCP's reliability features are antiquated and not always a good fit, and so on.

Maybe QUIC will make it better.
Replies: >>11372
Epoll looks like the best networking API to me. As far as I understand, it's the fastest API that uses regular file descriptors, and the API is very simple and straightforward.

I compiled all the relevant components into this example, I haven't tested it though:
static void epoll_add_socket (int epollfd, int socketfd, uint32_t events_to_watch_for) {
	struct epoll_event event = {
		.events = events_to_watch_for,
		.data.fd = socketfd, // The entire .data union is for user data, epoll doesn't interact with it.
	};
	// Note: If epoll's max socket cap is hit, then this returns -1 and errno will be ENOSPC.
	// The cap is something like 4% of RAM though, 90 bytes per element (444,444 sockets per 1 GB).
	epoll_ctl(epollfd, EPOLL_CTL_ADD, socketfd, &event);
}
static void epoll_remove_socket (int epollfd, int socketfd) {
	epoll_ctl(epollfd, EPOLL_CTL_DEL, socketfd, NULL);
}
static void make_socket_nonblocking (int socketfd) {
	fcntl(socketfd, F_SETFD, fcntl(socketfd, F_GETFD, 0) | O_NONBLOCK);
}

int main (int argc, char *argv[]) {
	// Initialize listening socket
	int listen_socket = socket(AF_INET, SOCK_STREAM, 0);
	struct sockaddr_in server_addr = {
		.sin_family = AF_INET,
		.sin_addr.s_addr = INADDR_ANY,
		.sin_port = htons(8080), // Port
	};
	bind(listen_socket, (struct sockaddr*)&server_addr, sizeof(server_addr));
	make_socket_nonblocking(listen_socket);
	listen(listen_socket, 32);
	
	int epollfd = epoll_create1(0);
	epoll_add_socket(epollfd, listen_socket, EPOLLIN);
	
	#define MAX_EVENTS 64
	struct epoll_event events [MAX_EVENTS];
	while (1) {
		int eventcount = epoll_wait(epollfd, events, MAX_EVENTS, -1); // -1 = no timeout, wait forever
		for (int i=0; i<eventcount; i++) {
			// New connection, listen socket shouldn't have any other events than EPOLLIN.
			if (events[i].data.fd == listen_socket) {
				struct sockaddr_in client_addr;
				int socket_len = sizeof(client_addr);
				accept(listen_socket, (struct sockaddr *)&client_addr, &socket_len);
				make_socket_nonblocking(client_socket);
				
				// Add EPOLLET for "edge-triggered" mode.
				// Without EPOLLET, an event keeps occurring as long as the condition for it is true.
				// With EPOLLET, an event only occurs once when the condition for it changes.
				epoll_add_socket(epollfd, client_socket, EPOLLIN | EPOLLOUT | EPOLLRDHUP | EPOLLHUP);
				
				continue;
			}
			
			// Handle events
			if (events[i].events & (EPOLLRDHUP | EPOLLHUP)) { // Hang-up: socket closed.
				epoll_remove_socket(epollfd, events[i].data.fd);
			}
			else if (events[i].events & EPOLLIN) {
				// Socket has data in it, read(events[i].data.fd)
			}
			else if (events[i].events & EPOLLOUT) {
				// Socket is ready to receive data, write(events[i].data.fd)
			}
		}
	}
	return 0;
}
Replies: >>11370
>>11369
io_uring can be faster than epoll by reducing system calls
Replies: >>11373 >>11377
>>11361
>but TCP's reliability features are antiquated and not always a good fit, and so on.
In what way? I don't think TCP will ever be replaced.
Replies: >>11377
>>11370
I thought io_uring doesn't use file descriptors in a normal way somehow. I haven't looked into it enough to know though.
>>11372
1. checksum is too weak
2. packet ordering isn't necessarily important (e.g. a filesharing protocol only needs to care about where the data goes, not the order it came in, and online games would rather have the data soon than in order)
3. networking has become so fast a 32-bit sequence number is too little
4. flow control has proven to be a mistake, all modern network stacks only use dropped packets to moderate speed, some systems like Linux additionally have a way to intelligently manage queues to avoid bufferbloat, although none have it on by default

>>11370
Epoll is also severely broken and it's best not to use it in general.

If you watch an fd with epoll, fork, close it in the parent, and an event comes in on the child's fd, the parent is the one who receives the notification.
Replies: >>11378
>>11377
>If you watch an fd with epoll, fork, close it in the parent, and an event comes in on the child's fd, the parent is the one who receives the notification
So you're complaining that it's giving events to the fd that you gave it? How about just updating epoll about the fd that you want it to notify you about? Sounds like a (You) problem to me.
Replies: >>11379
>>11378
Classic Linux madness. Should've learned from Windows which does not suffer from this issue.
What's the fastest algorithm that can insert and remove data elements and scales linearly with threads? It doesn't matter what element is removed, it just has to return any.
Replies: >>11425 >>11442
>>11429
sharded datastore, assume uniform access. Not sure if fastest though.
>>11419
For C++, I'd just recommend the std::remove_if() against a basic std::vector. It's linear as-is. You can also specify the par_unseq execution poilicy (but probably shouldn't until you scale to a big enough dataset... as always, test).

https://en.cppreference.com/w/cpp/algorithm/remove
https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t
Replies: >>11426 >>11437
>>11425
Also BTW, there's the syntax helper functions std::erase_if(), though I'm unclear whether you can specify an execution policy with them yet.

https://en.cppreference.com/w/cpp/container/vector/erase2
Replies: >>11437
>>11426
>>11425
No, I don't use C++, thankfully.

I'm running into the issue that a deque that scales doesn't exist, all deque algorithms top out at O(2) scaling. This is because a deque returns elements in order and there is inherent serialization in returning elements in-order, but I don't care about order.
BTW, most people using deques in threaded programs don't care either, just because an element was fetched from the deque by a thread first, it doesn't mean that thread won't get preempted as soon as it does that until any number of later elements were processed by other threads, so threads break the ordering anyway.

I found this paper: https://link.springer.com/chapter/10.1007/978-3-642-39958-9_18
>We introduce fast and scalable algorithms that implement bounded- and unbounded-size lock-free k-FIFO queues on parallel, shared memory hardware. Logically, a k-FIFO queue can be understood as queue where elements may be dequeued out-of-order up to k − 1, or as pool where the oldest element is dequeued within at most k dequeue operations. The presented algorithms enable up to k enqueue and k dequeue operations to be performed in parallel. Unlike previous designs, however, the algorithms also implement linearizable emptiness (and full) checks without impairing scalability.

Unbounded (I actually need this), checking emptiness without destroying performance (forgot to mention I needed this too), loosely ordered, seems perfect. Now I have to figure out how to pirate it or find an implementation I can read.
Replies: >>11439
>>11437
How about this https://arxiv.org/abs/1312.2501 ?
Replies: >>11451
>>11419
Get an array with an index pointing to the last element. You fetch-and-add (https://en.wikipedia.org/wiki/Fetch-and-add) -1 to the index when you access it, and use the copy of the old value as that thread's index into the array. Fetch-and-add is atomic so the threads are guaranteed to have different elements each time. You always fetch from nearby elements in an array so it has good cache coherency. No locks.
No grantee that this is the theoretic fastest, but it should be pretty darned fast.
Replies: >>11445
Another captcha idea: generate nonsense words that, when spoken out, sound like real words. Objective is to type out the real word.
For example: widiohblahtphoom -> video platform

Just had that idea, haven't even begun to try making it at all. I don't know if there's any good way to make that conversion or how easy it would be to break or solve legitimately. It would probably also filter out people who can't speak English well which may be good or bad.
>>11442
It's extremely slow. Atomics have locks, just inside the hardware. Now imagine the lock contention. All the threads compete for the same resource, so scaling is O(1): the operation performs the same no matter how many threads you throw at it.
Replies: >>11449
>>11445
>just inside the hardware.
The point of the exercise is that contention is limited to a single clock cycle (ie, billionths of a second), since Fetch-n-X operations are such.
Replies: >>11450
>>11449
If there is contention, i.e. more than one thread access the same atomic, only one goes through. The others will fail the operation and it takes additional cycles for retries. For a large number of threads, it will lead to a cascade of retries.
How about something like this: https://www.osti.gov/biblio/1531271 ?
Replies: >>11451
>>11439
>>11450
Can't read them yet, working, but thanks anon.
What's a library for making a HTTP request that doesn't suck?
Eh, fuck it, curl may be an abomination, but I don't know of a library that can handle compression, reusing connections, coping with stalled connections, running everywhere, all the http standards, etc. I was writing a program that checks the hash sum of a GOG game but it turns out the GOG API is only for GOG Galaxy installers, not the ones you download through the web interface. Someone wrote a python script that parses the web pages to do something similar but it requires logging in and this was meant for piracy.
Replies: >>12387
>>12385
>I was writing a program that checks the hash sum of a GOG game
A central repository for those would be really useful, hope you can figure something out anon.
Replies: >>12389
>>12387
All that's necessary is a list of hash sums of all the installers and goodies on GOG. Then you can use plain old sha256sum or whatever from the command line.

Because of the lack of such a list and the issue of having to pirate the games to hash then (and then risking having incorrect hashes), I thought I might aswell use the undocumented public API which provides md5 hashes, even if md5 is broken. However, it turns out that's only for GOG Galaxy installers, which means only Windows and macOS games (no Linux), and it's useless for piracy because pirates use the installers from the GOG web interface which are different.
>>12389
>md5 is broken
Only if you deliberately work towards breaking it, like literally any other hash algorithm... For verifying the integrity of files, md5 is more than good enough.
Replies: >>12995
03daxuxcE5t7NHYGJwO1AyQ-2.jpg
[Hide] (426.7KB, 1920x1080)
>>12389
>All that's necessary is a list of hash sums of all the installers and goodies on GOG.
Which they will never do because they just want everyone to get on their not-steam nowadays. Remember when they displayed the web downloads front and center rather than hiding them under a small, misleading "backup downloads" button? 
Making a github with the md5 of all games seems simpler than changing the mentality of a greedy corporation.
>>12390
Yes, for verifying the integrity of your 'own' files.
Since there are people who deliberately work towards breaking it you want to use sha256.
Replies: >>12996
>>12995
Don't misunderstand, I meant to make own bold.
>>12389
The Windows GoG .exe installers come with an embedded certificate. Maybe there is some way to check that on Linux.
I'd be interested too.
10.05.2024_12.50.52_REC.mp4
[Hide] (4.7MB, 632x462, 01:37)
why is my projection so wild...and not centered despite i wrote so
Replies: >>13417
>>13415
What is this? Code?
Replies: >>13856
p.png
[Hide] (12.8KB, 550x378)
I want to go back...
>>8954 (OP) 
All this hindu Indian scientists where really selfie to keep there studies and research to a  certain group  And when someone from West discover out the completely same thing like after 200 or 300 years they started saying "no we discovered it hundreds of years ago " . So why don't you spread that knowledge 
Because of people like this the  your science knowledge and this modern world is 100 years back in time
I am working on Void and I want to make a desktop application with a GUI that can easily be ported to other flavors of Linux and to Windows. QT Framework's IDE works fine and I know of other complex and longstanding programs that use it (the Dolphin emulator, mainly) but is there any other dev environment/tool that I should consider?

The program is basically going to be a "dice roll chatroom" for TTRPGs so it won't require more than setting up one user as the host, letting other people connect via room codes, and broadcasting and synchronizing dice rolls via a chat box or direct messages.
Replies: >>13662
>>13661
You don't need a GUI for that. There were dice rolling bots on IRC in the 90's. A lot of them were made in Tcl or Perl, but it can be any language.
Replies: >>13666
>>13662
I want to extend it to less common systems like the Saga Machine system (used in Shadows Over Sol) where each player has a deck of cards, a hand of cards, and the cards can explode into piles of additional cards. Showing and tracking all that would be a lot more coherent with a GUI and it'd make the whole process more consistent.

I also want the tool to be used by a wider audience someday, and a GUI is sadly a necessity for that.
Replies: >>13670 >>13675
>>13666
Nice trips satan.
Your choices are:
>Qt
GUI toolkit for complex interfaces including things like text boxes, windows and tabs, nested menus, translations...etc. It's bloated and slow to compile but its only dependency is libxcb (part of libX11) which makes it portable to all loonix distros. The only Qt module you need is QtBase, all the other modules are unnecessary bloat. If you're planning on distributing executables of your program, compile Qt yourself as a static library so it's fully contained within the executable, this will save you from Qt's DLL hell.
Fun fact: you can compile your program with static Qt + static libxcb + static musl to result in a fully self-contained executable that runs on literally every single distro in existence.
>SDL2
Not a GUI toolkit, only does rendering and similar multimedia operations. Lightweight, fast to compile, and portable to more platforms than Qt due to its lower level. Depends on raw libX11, no libxcb necessary. If your intended GUI is simple enough you can build it "manually" on top of SDL or use any of the available immediate mode GUI libraries that use SDL.
Like Qt, can be compiled statically and contained within your executable.
>>13670
Linux brain damage spotted.
Replies: >>13675 >>13678
>>13670
What about Electron?
Replies: >>13675 >>13678
>>13666
What language? If you are writing in C, there aren't lots of options.
>>13673
If he isn't already writing in js, adding electron is a massive bloat.
>>13671
Brain damage spotted.
Replies: >>13678 >>13679
>>13671
Not even gonna disagree with you, using a Linux system is a nightmarish experience. But some people are trying to improve the situation any way they can.

>>13673
Electron is basically a mini web browser so it's extremely bloated. I personally haven't used it but I do use a couple of apps based on it and they work fine across system updates, so I'm sure electron has some merit.

>>13675
>If you are writing in C, there aren't lots of options.
As far as I can remember GTK is written in C but I strongly recommend not depending on it or your app will bitrot in days. GTK is insanely unstable which is par for the course with GNU products.
Replies: >>13684
>>13670
>fully self-contained executable that runs on literally every single distro in existence
That sounds very appealing. I assume there's nothing about the file that will prevent it from running on Windows as well, right?

>>13675
>What language?
I don't have any preference since the program shouldn't need anything beyond basic OOP (or something like it with structs), string manipulation, and network connections to send data/state to other people in the chatroom.
Replies: >>13680
>>13679
>I assume there's nothing about the file that will prevent it from running on Windows as well, right?
You mean the same executable will run on both Linux and Windows? That obviously won't be possible, in that case you will need to compile 2 separate executables; one for Linux and one for Windows. Qt supports Windows but I personally haven't tried compiling it there.
>the program shouldn't need anything beyond basic OOP
You probably want C++ then; it's backwards compatible with C and is the language Qt is written in. I'm personally not a fan of C++ and its enormous size but almost every non-trivial library/framework uses it.
Could you maybe draw a rough mockup of your GUI in paint and post it?
Replies: >>13683
>>13670
> you can compile your program with static Qt + static libxcb + static musl to result in a fully self-contained executable that runs on literally every single distro in existence.
QT is C++ and musl is not C++ so there's a bit of a gap in your plan there.
Replies: >>13682
>>13681
>QT is C++ and musl is not C++ so there's a bit of a gap in your plan there.
I suggest you do some reading on what a "libc" is, why programs need it, and what differs between the various libcs (i.e. musl and glibc), before you make such a statement.
For now you may take a look at this executable: https://litter.catbox.moe/9on6k9
VirusTotal scan: https://www.virustotal.com/gui/url/6cb374658470865dca391f6b4211d268454a661e633594f7fb7a1d495e7b3352
This is one of Qt5's sample programs that I have personally compiled and linked against static Qt5, static libxcb, and static musl. This executable depends on zero (0) libraries at runtime, and will run on your current linux distro as well as any distro going back all the way to the 2000s.
Replies: >>13689
1719182538186-tegaki.png
[Hide] (12.4KB, 500x500)
>>13680
>rough mockup
Once the user connects to a room it should look something like this depending on the system. The panel on the left would have cards in hand/discard pile information for the Saga Machine system, or various options for dice rolls in a dice system. The user should be able to declare target numbers, choose how many dice to roll and how many sides they have, which modifiers to apply, if the roll is a dice pool or a standard roll, and whether or not the dice can explode (and the rules for handling explosions).

I want to design it to be open-ended and then include templates that would allow you to do everything within a given system like D&D or Pathfinder. The panel at the bottom would show a live preview of what the user is creating as it will appear in the chat to other users, and there would be a way to make hidden rolls so that only specific other users can see.

I'm mostly subscribing to the "beige box" school of UI design philosophy but customizable color palettes and themes would be neat too.
Replies: >>13686
>>13678
>Not even gonna disagree with you, using a Linux system is a nightmarish experience. But some people are trying to improve the situation any way they can.
Statically linking everything and distributing binaries doesn't improve the situation, it makes it a lot worse.

It's not hard to write a program that works across all distros and on many other operating systems. Just stop programming by trial and error and read and understand standards and documentation.
Replies: >>13686
>>13683
The left panel seems non trivial so I'm gonna suggest going with Qt. Try prototyping a static interface first to get a feel for Qt and take things from there... I'm not sure exactly what your "templates" consist of and whether they would be feasible in Qt, but I suppose those are not a priority for now.

>>13684
I almost dismissed your post as bait, but then I remembered that's how Linux users actually think.
>distributing binaries doesn't improve the situation
In the real world, human users install software with a mouse click and have it work across machines and OS versions. People like you want users to compile everything from source and have package maintainers provide every single app in existence while all dependencies remain in perfect sync and harmony, but that's a pipe dream that's never coming true. It didn't come true 20 years ago and it won't come true now or ever. Wake up.
>Just stop programming by trial and error and read and understand standards and documentation.
What standards and documentation? You've never written a non trivial program in your life and it shows. Most libraries can't maintain ABI or even API stability to save their life, the worst offender being glibc, Linux's fucking C library. I've had countless executables that I've personally compiled break after a system update thanks to glibc, libX11, GTK...etc. Programs that are cross platform and standards compliant continue to work just fine on Windows and MacOS, and break only on Linux. The problem is Linux and has always been Linux.
>>13686
>I'm not sure exactly what your "templates" consist of
Just premade rolls for different types of systems. Shadorun uses a d6 dice pool roll-over system with a target number, so the things the user could configure for that would be:
- number of dice
- target number (so # of successes can be declared)
- exploding dice rules

Whereas D&D uses a typical target number roll-over check, so the config options would be:
- type of dice rolled
- number of dice
- modifier applied (individually or for entire roll)

Ideally I think both of these things should be able to be built from the same Die object with some modifiers applied. I figured Qt was my most practical option but it was nice to have your input. Thanks.
>>13682
>I suggest you do some reading on what a "libc" is,
Watch out guys we have an expert over here.

>This is one of Qt5's sample programs that I have personally compiled and linked against static Qt5, static libxcb, and static musl.
musl is an implementation of the C standard library not the C++ standard library. You didn't link QT against musl. There was an extra build step happening which you don't understand.
Replies: >>13698
>>13686
Just use niggersoft products then nigger stop whining
>>8954 (OP) 
i frequent 4chan's /g/ and it's weird for me to think that /sdg/ means anything but "Stable Diffusion General" glad to  see real tech discussion has survived on the "outerchans"
c64.jpg
[Hide] (43.6KB, 500x402)
>>13686
> human users
They're just nigger cattle who were bred into a state of learned helplessness by Bill Gates and the illuminati.
An actual normal human doesn't need someone else to write him a dice rolling program.
Replies: >>13698 >>13706
>>13689
>You didn't link QT against musl
All programs are linked against the C library, including C++ ones. Unless you're rolling your own libc to interface with the kernel which you sure as hell aren't.
>There was an extra build step happening which you don't understand.
It's called the C++ compiler linking against libstdc++ / libstdcxx which, too, cannot exist without a libc.
What exactly is your issue?
>you can't link qt to musl statically
<i just did and here's an executable
>no you didn't
<???

>>13696
Where's your dice rolling program anon?
Replies: >>13701 >>13705
ahlBooks.png
[Hide] (339.2KB, 600x395)
>>13698
I don't play tabletop anymore (because it's all full of faggotry now) but in the 90's I made a chargen program for AD&D 2nd edition in AmigaBASIC. Then another guy in my group modified it to add some of the kits from the splatbooks. It's not rocket science, anybody can do this.
Replies: >>13706 >>13709
>>13698
>It's called the C++ compiler linking against libstdc++ / libstdcxx
You don't need musl to build static c++ binaries. That's why adding musl to your post exposed a hole in your understanding.

>What exactly is your issue?
You are the one who appears defensive and adjudicated. I have been nothing but polite and professional in this thread.

>no you didn't
This didn't happen. Now you are just having imaginary conversations with yourself.
Replies: >>13709
>>13696
>>13701
>you should make programs easy to run and install if you want people to use them
<heh... NIGGER CATTLE could never...
>have you ever done it?
<yes, and my two friends who owned amiga computers in the 90s said it was great!
I'm not sure you're proving the point you think you are.
Replies: >>13708
>>13706
Maybe you should learn to form english sentences to express your opinion. This weird nonsense quoting stuff is ridiculous and leaves me wondering wtf you're ranting about.
>>13705
Didn't mean to come off as a dick... Yes you don't need musl and can use any other libc, however the biggest advantage of musl is that it fully supports static linking and has a permissive license, unlike glibc for example.

>>13701
That's nice. Was it a command line tool or did it have a TUI / GUI? Writing a program that takes input from and spits everything out to a terminal is trivial, making a polished user interface that's interactive and discoverable is not.
Replies: >>13710 >>13755
bas.png
[Hide] (2.1KB, 640x480)
>>13709
It had a simple text menu interface. Like it presented you with logical options based on what prior choices you selected. AmigaBASIC can do GUI but there wasn't any good reason to. Also at the time I was still programming like I was on an 8-bit computer. So if I wasn't drawing graphics (like for a computer game) then it was just text.
But the point is that simulating dice rolls is trivial. You don't even need to actually write a program. Calling the RND() function with the right argument is enough. From there it's a simple matter to write a general dice rolling program to account for adders, multipliers, and whatnot. Any kid in the 80's could do this easily. I know this because we all learned BASIC in middle school and/or high school in the classroom, and the assignments were more complicated than this.
But the computer scene has shifted since then into a purely consumerist environment. Every computer used to come with some version of BASIC, and many of them booted directly to it from ROM.
But eventually the industry decided this is no good, and the user shouldn't be writing his own software. Let's instead make the user really fucking dumb to the point where he can only click on the mouse to start programs, and he's otherwise helpless. And let's make the OS really complicated to discourage the user from programming. Let's have all these bloated GUI toolkits and complicated C compilers. Yes that way they'll be really fucked and won't be able to escape the techno slavery.
>>13709
>the biggest advantage of musl is that it fully supports static linking and has a permissive license, unlike glibc for example.
That's true.
Damn, Rust is an excellent language. I shouldn't have listened to a bunch of imageboard wagies and autists.
>>13780
dial8
>>13780
If you're not good enough to get paid then your opinion is worthless.
>>13780
But I don't wagie and I also hate C. I told you to write your own compiler or you're a nigger.
worms.jpg
[Hide] (385.2KB, 1920x1080)
control_flow.png
[Hide] (304.1KB, 1568x4264)
Been working on a PS4 compatibility layer, here's a couple recent meaningful changes:
>Added basic control-flow graph generator for GCN shaders
This is used by the shader recompiler to structurize control-flow in a way allowed by SPIRV.
Embarrassingly this took >4 months on and off to implement.
>Rewrote memory management without VK_EXT_external_memory_host
That extension was used to link CPU/GPU shared memory to an mmap'ed location, which is needed because some resources don't use all bits of an address in their descriptors.
Unfortunately this didn't work well with Lavapipe due to some has some specific alignment requirements.
Now each resource allocates its own memory independent of the host mmap'ed memory.

Thanks to these changes it can now produce a somewhat correct image out of a Worms WMD frame replay.

Here's the repository if you're curious: https://gitgud.io/veiledmerc/egemu
It's still basic though: the code quality ranges from mediocre to bad in places, surface detiling's broken on some images, along with other issues.
Next I'll probably look into fixing a recent issue with the swapchain, improving the Worms replay, and work on some tools for the real hardware to help with development.
>>13794
Are you the same anon from /v/? I have no idea what you're doing to be completely honest but I'm happy that you're making constant progress.
Replies: >>13796
demonic_burger.jpg
[Hide] (178.7KB, 1908x1033)
>>13795
>Are you the same anon from /v/?
Yeah. I'm following the advice of the /agdg/ anons that rightfully pointed out that this wasn't a video game, and this board would be better to post about it.
>I have no idea what you're doing to be completely honest
Me neither, that's why some stuff is taking a lot longer to develop than it should.
>>13796
>developing a video game emulator isn't a video game
I guess there's no harm in posting here but that's a line of reasoning to use and I hope you continue posting on both boards.
>>13796
>the /agdg/ anons that rightfully pointed out that this wasn't a video game
What a bunch of faggots. Your project is not only vidya related, it's also the most activity that /agdg/ has seen in months. I think whatever comments you got were from bitter crab bucket nodevs who wanted to see an active project banished to a dead board, you should ignore them and post wherever you want.
>>13794
>>13796
Impressive work so far anon, I bet Trash/agdg/ would be interested in hearing about it!
>>13794
I follow your posting on /v/, excellent work anon. Too bad graphics and emulation are the kind of stuff I know nothing about or I'd look into it.
>>13794
Nice. I have been thinking about an emulator for my custom architecture. But it's so big of a task to get going.
>>13417
 Its a projection but it scales to 0 and i have hard time trying to keep it from scaling. other than using abs(x)+abs(y), it is pretty unstable.
jumpy.mp4
[Hide] (867KB, 616x446, 00:15)
>oops its been 3 months.
Basically it scales too much to zero and i cant sort of stop it by a radius i wonder why
I've been poking about lately trying to figure out how to replace MongoDB with FerretDB in jschan, given the former is under the asscheeks SSPL. Same with replacing Redis with Valkey. How would I go about doing this?
>>10793
A year later and I just learned that "modern languages" have what I wanted here and they call it async. Async, among other things, makes it quite easy for the program to go work on a different task when I/O blocks. This is something you can do in C if you implement it yourself, just write a work queue, and every time a job blocks, manually write the code to register with a reactor, save the job's state, and end the job and go do another one. However, this is very laborious and difficult to do yourself. It's also something the language's implementation can do to some extent, some Unix systems got something of the sort for a time with many-to-1 threads implementations which have the effect of task switching in userspace when a syscall blocks, but if the language wasn't designed around it it's inefficient and incomplete.

With async, you only specify the dependencies and parallelism of tasks and the language's runtime handles the rest. However, having a runtime for this reduces performance and modern languages are also inefficient and suck for many, many reasons.

But it turns out Rust is the 1st good modern language and has async, and their async implementation is quite innovative because it's all done at compile time and static unlike other languages. This is one huge performance win for some kinds of multithreaded code, specifically the kind I write. Turns out Rust is so good it has some performance advantages over C. It all goes back to what I said in >>13780
[New Reply]
177 replies | 41 files
Connecting...
Show Post Actions

Actions:

Captcha:

Select the solid/filled icons
- news - rules - faq -
jschan 1.4.1