[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: 1726233719133.png (595 KB, 735x489)
595 KB
595 KB PNG
Welcome to the Daily Programming Thread. What are you working on, /g/?
Previous Thread: >>102315763
>>
>>102366455
Working on writing my own finance app because MyExpenses is paywalled. Native android development is quite a curve.
>>
>you can still distribute your qt application when your license expires as long as you have distribution license
>gay homo qt doesn't list the price of distribution license
fuck the (((finns)))
>>
>>102367003
qt seems like overcomplicated nightmare fuel anyway. i dont understand why you'd use it if you're not a boomer.
>>
>>102367029
It has good documentation and pretty stable API.
When you need to include some c++ it's also easy to include them in qt compared to other cross platform GUI libraries.
>>
File: women in tech i dustry.jpg (195 KB, 1024x1024)
195 KB
195 KB JPG
>>102366455
always glad to see women in the tech industry
>>
Can anyone recommend an OS textbook that goes through actually making a simple OS from scratch instead of just looking at an existing one? Ideally something in x86 I'll be able to throw and QEMU and have it print "hello word" and read some keystrokes. Pirate-able PDF is preferred, but I'm willing to pay for a physical copy ifs its a really good one.
>>
>>102367231
github has a repo with a tutorial of step by step OS making.

https://github.com/practical-tutorials/project-based-learning?tab=readme-ov-file#cc
>>
I have this struct

struct NVal
{
vec3 local;
vec2 external;
}


The compiler is generating a constructor for this which I can
instantiate the struct with:

NVal { {1.0f, 1.0f, 1.0f}, {2.0f, 2.0f} }


I'm trying to turn this constructor into a
constexpr
but I am unable to deduce the signature of the generated constructor.

Does anyone know what the signature of this constructor would be?
Is there any way I can find the signature of this constructor.

I suspect it would be something along the line of:
NVal (initializer_list<float> vals, initializer_list<float> morevals){};
>>
File: file.png (201 KB, 1324x1355)
201 KB
201 KB PNG
>>102367392
chatgpt response:
>>
>>102366455
i'm trying to replace raylib and raygui with tk in my c synthesizer, i hope that tcl can handle my waveform visualizer
>>
>>102367231
OSdev was good enough for me. And you better use bochs for developing as it has a builtin debugger.
>>
>>102367392
it's a POD, it's not a constructor, it's an aggregate initializer, and aggregate initialization is implicitly constexpr in the same way unannotated lambdas are and can also use C initializer constructs
there's no parameters you're just directly passing, the values are just passed to local and externals constructors

it's not a constructor it's an aggregate initializer
>>
>>102367744
*there's no parameters you're just directly passing the values to local and externals constructors
>>
>NtCallbackReturn is a function that never returns
>which explains why my secondary stack resetting doesn't trigger after the call
On one hand that's easy to fix (R15 is mandated by the ABI to be preserved upon calls and is already preserved by my code as part of the CPU state capture), but on the other hand Microsoft's incessant need to switch between userspace and kernelspace for the most trivial garbage is getting fucking ridiculous. Does anyone of the Linux heads ever heard of a syscall that calls back into userspace and then has to return via another dedicated syscall, or is that yet another part of Microsoft's truly ugly 16-bit past?
>>
>>102367744
>>102367765
also depending on the way CTAD is and whatever standard brace elision was added in you might be able to remove the second level of braces
to sum it up in theory the following are all equivalent and all implicitly constexpr if vec3 and vec2 are (which they should be)
NVal{ vec3{1.0f, 1.0f, 1.0f}, vec2{2.0f, 2.0f} };
NVal { {1.0f, 1.0f, 1.0f}, {2.0f, 2.0f} };
NVal{ 1.0f, 1.0f, 1.0f, 2.0f, 2.0f};
NVal{ .local = vec3{1.0f, 1.0f, 1.0f}, .external = vec2{2.0f, 2.0f} };
NVal{ .local = {1.0f, 1.0f, 1.0f}, .external = {2.0f, 2.0f} };


marking it explicitly constexpr by creating an actual constructor like the retard using AI suggested is a bad idea, being aggregate initializable has a bunch of requirements but comes with benefits
>>
>>102366455
How do you guys stay motivated? It feels like everything I want to work on has already been done. I would like to write an open source version of a paid app, for instance, but in the back of my mind I just think "someone's already done all the work, is this really worth it?"
>>
>>102368192
Think of some way of solving the problem, regardless if it has been solved before, if you find meaning in the problem itself the motivation wont stop coming
>>
>>102368192
In the book Think and Grow rich, the secret that is not be named, is basically an irrational belief that you will succeed in spite of every internal and external feedback telling you that you will fail. Or in 50 cents words. Get Rich Or Die Tryin.
>>
>>102368383
What if neither option sounds appealing?
>>
>>102368192
>How do you guys stay motivated?

I don't. Everything feels pointless and nothing I do matters.
>>
>>102368468
Then you have to settle for mediocrity. Go get a job.
>>
>>102368192
Passion (fueled by resentment, mostly) and obsessive compulsion. Also adderal.
>>
>>102368192
read more source code
everything hasn't been done and most of everything that has been done is so fucking dogshit it might as well not exist
>>
>>102367101
i think he is a real woman, but just ugly.
>>
>>102368567
Why would I?
>>
File: 1712604103325904.png (668 KB, 700x700)
668 KB
668 KB PNG
>it's all been done before
Not in Rust, it hasn't.
>>
File: 1606279088043.jpg (70 KB, 561x561)
70 KB
70 KB JPG
>>102369729
And it hopefully stays that way.
>>
>>102369729
>will never have clean syntax
>will never be enjoyable to read, write and manage
>will continue to have exorbitant download times for deps, build times, and comp times (And will only get worse with time)
>affine types will become a relic (And with it, rust's central "advantage") when regular linear types become mainstream
the list goes on
>>
>>102369729
you are the thpe of person who swats a kernel maintainer live on stream
>>
>>102369844
You forgot that Rust's whole fundamental claim of memory safety has been debunked.

>GAWK
lmao I do gawk at those seething trannies
>>
I'm sad i was born. I made a worthless garbage home brew programming language and interpreter that nobody cares about. My friends are all distant, barely more than acquaintances, and don't care about my garbage toy projects. I'm thinking of ending it soon but before then, what should i write in this stupid language i just made?
>>
>>102368013
>marking it explicitly constexpr by creating an actual constructor like the retard using AI suggested is a bad idea
explain what problem constexpr makes despite the parameters already being constexpr
>>
>>102369986
game
multimedia application
ui library
port lang and interpreter to bare metal and write an actual attempt at a managed kernel
>>
>>102369986
interpreters are worthless.
make a c compiler
then extend it to include your own language.
>>
>>102367353
>>102367716
Thank you both, I'll have a look
>>
Is it difficult to write an RTP implementation (both sides)? I've tried to read the RFC, it's structured in a way that kind of sucks to read imo.
>>
>>102370022
nothing, it's already constexpr implicitly anyways, it's having a constructor that's the problem
the requirements of aggregate initialization are fairly close to the requirements needed for a variety of optimizations and features, like ABI triviality requirements or non-type template parameters while just having a constructor of any kind can mess things up, iirc even if it's an inline defaulted one
>>
he was swatted for speaking the troth
https://www.youtube.com/watch?v=OdMQwDtumJ8
>>
>>102367928
What's that? There are no actual Linux heads who could answer that question cause they're all a bunch of larping incompetents?

Shucks.
>>
>>102367101
The problem with these photos is that the makeup (ans many other things) are fugly. Jesus fuck, if you live in a big city you can see trans people that screams IM TRANS not because some f lag or color scheme, but for the ugliness of their makeup and outfit.
>source
I had a relationship with a makeup artist, talking to her about her work made me see how some poeple looks uglier on make up because they lack the basics. So I cannot comprehend how these poeple took the decision of change genders but cant seek guidance of a make up expert.
>>
>>102367101
would, would, would, wouldn't (also she's on here twice), wouldn't, would, would, would, would, would, would, would, would, wouldn't, wouldn't, would, would, wouldn't, would, wouldn't, would, wouldn't, wouldn't, wouldn't would, wouldn't, wouldn't, wouldn't, wouldn't, would, would, wouldn't, wouldn't, wouldn't, wouldn't, wouldn't, ehhhhhhhhhh ummmmm wouldn't.
>>
https://github.com/microsoft/STL/pull/4953
>C++23
>circa 2024.75
>>
>>102372276
C++ 14 to 17 is all you need.

Some would even say C+11 or C98 too.
>>
>>102372390
>[Wrong opinion]
>>
>>102372418
All the C++ places I interviewed with said they use C++ 11 to 14. I only heard one 17 and that was from a niche company.
>>
>>102372451
Maybe try asking offices next time rather than nursing homes
>>
>>102372487
wait, wagies are pro-new features now?
All these years before, you lads would always talk about how it would take a decade or more before new features would even begin to be adopted
>>
>>102372487
Uh, these are literally embedded and game development houses. stfu
>>
>>102372506
>/dpt/ is one person
>>
>>102372519
it's rarely more than 3
>>
>>102372554
/dpt/ contains at least 5 characters
>>
>>102372451
It depends on when the project started and what the minimum validated versions of the supported compiler toolchains are.
One of my projects is just about inching into C99 (and I was one of the people that pushed it off of K&R to C89). Another is C11, and yet a third is C++17.
>>
File: file.png (70 KB, 785x460)
70 KB
70 KB PNG
Is this bad code?
Since I'm easily persuaded, a few "aesthethic code" videos have made me off.
I found it weird after the sixth if in a row, but it seems fine and I don't see an "elegant" way to check errors.
the error func is just fprintf(stderr, ...) + return EXIT_FAILURE
>>
>>102373416
>argc < 2 || argc > 2
Why not argc != 2?
>fopen/fread/strncmp
Why not file mappings (CreateFileMapping/mmap)?
>>
Why are programmers okay with calculators doing divide by 0, but not their programming languages?
>>
>>102373489
Because divide by zero generates machine exceptions that have to be caught, same as segfaults/access violations.
>>
>>102373489
Some people don't like poorly defined stuff, especially in a field where defining stuff is the core of the job.
I personally don't care about diving by 0, NaN, string, nothing, your mom, whatever else. The main principle of the programming language that I'm making is to not overthink, just do.
>>
>>102373458
>Why not argc != 2?
to be extended, for min args and max args or something
>Why not file mappings (CreateFileMapping/mmap)?
I don't know how it works, but I'll try them
>>
>>102373512
>Because divide by zero generates machine exceptions that have to be caught
valid reason. thanks
>>
>>102373643
>if(argc != 6)
>if(argc != 69)
>if(argc != 9001)
Doesn't wash.
>>
>>102373489
The calculator itself is programmed to handle divide by 0
>>
>>102373665
what if I have a -d that only needs a single arg
and a -e that needs two args
>>
>>102373489
A calculator has someone looking at the display and they can see if the result is something unexpected and fix the issue. In a program the result is usually immediatly fed into another computation which probably doesn't check if the input makes sense
>>
>want to learn a new language or just code in general
>have a few actually unique projects i've done but those come by very rarely as a need / purpose
>feel extremely bad and like a copycat if i remake something someone else has done (and probably done better)
how to cope? i don't want to be the faggot who makes the 50th <thing> accidentally in an attempt to learn or do something. but i have no cool project ideas lately. i just want to code... and not be a faggot..
>>
>>102373684
Then you'd still have to check for these specifically.
if(set_e)
{
if(argc != 2){/*error*/}
}
else if(set_d)
{
if(argc != 1){/*error*/}
}
>>
>>102373731
You'll never make anything because you are overcome by self consciousness to the point of asking for permission to write software. Start acting like a human and this problem goes away.
>>
>>102373416
In general, don't do:
memset(&x, 0, sizeof(struct Xstruct));

But:
memset(&x, 0, sizeof x);

It's shorter, more readable and more reliable.
>>
>>102373788
I guess. I'm not a complete nocoder faggot, I'm decent at reverse engineering and C++ as well as assembly occasionally, but that's where it stops. Because if I'm reverse engineering something, I'm most likely (often times) the first person to disassemble that specific thing. I can write documentation on it, if I want, I can make whatever hacky shit I want. I'm the first to do it, literally 0 projects on that niche thing on github.
This doesn't work for more general learning, say I want to learn Rust right now, I have to learn with overdone entry projects like a faggot, that don't contribute much.
I just overthink a lot, and have a need for perfection, I don't really know how to change this, it's only gotten worse
>>
File: final_version.png (35 KB, 1530x968)
35 KB
35 KB PNG
>>102373852
You sound like a friend of mine who'd start writing something, then chuck it away a week later and redo it from scratch. Frighteningly similar, down to the C++ and assembly parts ...

I would start a project and then optimize the shit out of it until you can't optimize it any more. Could be anything, but I recommend a registry dumper.
>>
>>102373921
>You sound like a friend of mine
that's funny
>registry dumper
i think i saw your picrel posted here a few months ago, neat.
thanks anon
>>
>>102366455
I’m building a small DSL. I’ve just finished defining the grammar and now I’m about to start implementing the interpreter. I just don’t know if I should do it in C++, Rust or Haskell. Rust seems appealing despite its lousy community.
>>
tfw wanting to dump my registry but am on Linux.
>>
>>102366455
That's a man.
>>
>tfw 20 years later but i can finally dump my registry in 5 seconds instead of 7
s-success
>>
File: file.png (116 KB, 595x695)
116 KB
116 KB PNG
>>102373735
you're right, I changed it
but also, it's very funny for you to point that out while advising for mmap when the example on mmap's page has basically what I wrote on the argc if
https://man7.org/linux/man-pages/man2/mmap.2.html#EXAMPLES
>>
>>102374102
5 seconds is highly improbable, at least until MS gets their shit together and fixes the mess that ntoskrnl.exe is.
>>
>>102374155
so aren't you done then, or atleast reasonably done?
Or are you just out of ideas / afraid of starting something new?
>>
File: for_the_leech.png (33 KB, 780x930)
33 KB
33 KB PNG
>>102374175
>so aren't you done then
Pretty much. Even if the kernel does get fixed the only thing I'd remove are the size heuristics (because those cost syscalls, too) and then wait for someone to beat my new time. I could really do with some competition.
>Or are you just out of ideas
I'm working on something else right now: >>102367928
>>
>>102374155
>complaining about MS
>still using that MS crap
>>
>>102374252
Sure. It's not going away, as much as I'd like it to.
>>
Been stuck on this problem all week. New to linux, but boss wants me to install a package from source code. Nothing on docs explaining how to install it this way. No DNS, no containers, etc. Boss says all it needs is a nginx http server to listen to it. I'm stuck bros.

If you're willing to help before I get pipped, package is called Openreplay.
>>
>>102374365
https://docs.openreplay.com/en/deployment/deploy-source/
?
>>
>>102374405

Look at the other configurations under /etc/nginx/site-avaliable, no domain name is used - this is a test server, and no domain name is bound to this ip

When you install openreplay, don't choose containerized installation. You are now in the stage of learning system management, and you need to learn how to install from source code (other systems are also), and then learn how to make container images, packaging, etc.

Literally what he sent me when I sent him that page of the docs...
>>
>>102374365
Usually there is a script in the directory like ./config after that script executes it will create the makefile that you'd use make or make install to install it into /usr/bin or /usr/local/bin or wherever the default directory is
>>
>>102374446
>this is a test server, and no domain name is bound to this ip
sorry if this sounds super retarded but can't you just use your ip as the domain name?
>>
>>102373731
I know that feel. I'm just bored with no ideas to pursue. Nothing seems worth doing.
>>
>>102374464
I don't see a ./config file. I tried make ./build.sh earlier and it asked for docker.

>>102374518
i tried, it didn't work, and specifically asked for a domain name, not IP.
>>
>>102374566
Hello, James
>>
>>102374566
ask chatgpt
>>
>>102374580
hi

>>102374583
has me going in circles
>>
>>102373731
Write a kernel. That will keep you busy for a while. And you learn a lot about software engineering.
>>
>>102367101
all of these pics are just ai generated
>>
>>102375380
you would be disappointed to find out that those are very real
>>
I don't get how vscode is so bad
like, it's pretty slow, and it genuinely crashes my pc
I only sometimes use it, it's very convenient for when I need to use git or to read a big project
copilot is sometimes cool in the sense that it can infer or find patterns and document some stuff really fast
but, just keeping vscode idle it seems to massively fuck up my pc
I opened it a few hours ago, and my pc started slowly chugging, until it completely froze just now and I had to force reboot
not even alt+fkeys to open the ttys worked
>>
>>102375624
maybe because it's chrome and building desktop applications on top of a web browser is really really stupid
>>
>>102375624
on toastertops, i just use neovim
Ultimately, just take a week and get your neovim sorted
>>
>>102375693
I do use vim to program
I just prefer to use vscode to read other people's code
>>
>>102375730
>I just prefer to use vscode to read other people's code
then your vim isn't ideal
>>
Was there a time that some fundamental programming concept/aspect just "clicked" for you?
For me last year it was the realization on how memory management is actually performed and utilized. Time spent lurking /g/ and going to university functional but confused until one day just blankly staring at code.
>>
>>102367519
>>102367744
>>102368013
>>102370022
>>102370232

Thank you all. This has been giving me problems for a while.

I didn't understand that the struct was being classed as a POD with an aggregate initializer.

I've removed the constructors and will keep it as a POD as I think the benefits outweigh the cons significantly here. It is also intended to be "plain old data".
>>
File: tls_bs.png (7 KB, 784x168)
7 KB
7 KB PNG
>>102375812
TLS on Windows last week.
>>
>>102375683
wait...is vscode a literal web browser like Discord?! hahahaha
>>
>>102376038
No
>>
>>102376038
it bundles electron, yes.
>>
File: file.png (12 KB, 320x160)
12 KB
12 KB PNG
>>102376038
It is
>>
>>102376085
>electron

the death of many of apps
>>
>>102376090
Programmers need to stop giving w*b shitters an excuse for using it and finally sort out the cross-plat UI library situation
>>
>>102376101
Technically, C++ was on that route but then Java came in and kicked its ass. Then C++ stopped trying to be front end ever since. The problem with web developing is that it's just too easy to do things yourself with Javascript and now Typescript. And development is so fast, most businesses love it.
>>
>>102367928
I've decided against my previous approach, but now I've got a problem with MASM. My idea is to provide two handlers - one needs to have:
>setup
>prologue
>call to target
>epilogue
>cleanup and return
>TLS allocation block (jumped to during setup phase, or never if it's already been allocated, jumps back into setup if successful)
, the other only
>setup
>prologue
>cleanup
>jump to target
>TLS allocation block

I don't want to write the same code for setup, prologue, and TLS allocation block because it's redundant and error-prone. My immediate idea was to use macros, but setup and TLS are not contiguous and have to be in their own macros, which means they can no longer jump from setup => TLS and vice versa despite the code being in the same proc.
>global labels
Wouldn't work, each handler needs to have code jump to labels within that proc. They need to stay local within the proc, but not the macro.
>calls
Wouldn't work either, I'm doing some nasty things with the stack.
>>
Hey anons please don't bully me for being a python-let but if I create a venv and do pip install pygobject and create a gtk program in Linux would it run on Windows?

And the same for raylib?
>>
>>102376516
maybe?
GNOME shit might be iffy while something like pyqt has a better
raylib should also be fine
>>
>>102376591
oh and you'd have to create a windows copy of the venv on
>>
>>102376613
So you would have to create the venv on the Windows system and then pip install pygobject?
>>
>>102366455
Oh that's Roger Wilson
RISC-V Must take over ARM
>>
>>102376648
yes, in theory that should work for basic applications
proper full bundling and delivery of python applications gets really stupid and is worse than c++
>>
>>102376805
That's the conclusion I am starting to come to.

What is sold is that you just need a python interpreter installed on the client machine but as soon as you step outside of python's little eco system the facade disappears.
>>
>>102376855
you don't even have to step fully outside it just into the less maintained parts of it
but yes, python becomes more and more of a massive pain in the ass the weirder your requirements
like just having an AMD GPU
>>
File: maxresdefault.jpg (80 KB, 1280x720)
80 KB
80 KB JPG
>>102377856
>>
>>102377856
*having an AMD GPU and using their CUDA equivalent
whoops
using raylib or pyqt isn't going to affect the application binary interface

>>102377939
honestly for actual deployments i think lua bindings to those libraries might be easier to work with
user-facing application deployment is one of the things python just sucks at
>>
I wrote a C debugger.

it's 2 lines of code. Let me guess... you need more?
>>
>>102378633
That's logging, not a debugger. You dumb fucking retard.
>>
File: pepe-cry.gif (64 KB, 220x220)
64 KB
64 KB GIF
>>102378791
>>
>>102367101
missing one
https://www.youtube.com/watch?v=f8QK-X3WZ1g
>>
>>102378791
Way to go asshole, you made him cry >>102378947
>>
>>102376648
I have read that pygobject depends on gtk which will not be shipped with the venv.
>>
>>102378633
you don't need ## before vaargs, it's for situations when you want the parameter to be appended to another word, like something##param
>>
If only I could write a computer program that would clean my house.
>>
I am learning c# and angular as a foundation to make apps in the future, however I also see that .net features purely (?) functional languages like F#.

I was always fascinated by languages like these and wondered how big the transition could be from C# to F#.
>>
I have tried to get code completion to work in C with local models that support fim but it doesn't work...
So I tried with python example but it still sucks.
For this query
<|fim_prefix|>def generate_400hz_sin_wave():
signal = []
<|fim_suffix|>
return signal<|fim_middle|>

the codegemma 2b returns
def generate_400hz_sin_wave():
signal = []
<|fim_suffix|>
return signal<|fim_middle|>

def generate_400hz_sin_wave():
signal = []
<|fim_suffix|>
return signal<|fim_middle|>
...

wtf
>>
I want some juicy horror stories of production code, I have been fascinated with this type of shit ever since I saw code for a pretty public facing company have API that had shoddy verification.
Give code snippets if you can please, I want to revel in bad.
>>
>>102368696
"Wilson underwent gender reassignment surgery and transitioned from male to female in 1994."
>>
>>102371497
pretty redundant. lots of reused symbols. you can optimize it like this:
# would = 1, wouldn't = 0
bitmask = int('1110011111111001101000110001100000', 2)
>>
>>102380827
0L
>>
>>102380694
1/?
>>
>>102380694
2/?
>>
>>102380694
3/?
>>
File: sebi droppin bombs off.png (24 KB, 1552x396)
24 KB
24 KB PNG
>>102380694
5/?
>>
>>102380694
last one for now
>>
incredible how much it has been to convert my compiler type system from having these types
Map
List
to these
Map<K, V>
[T]
>>
>>102381481
Java programmers love these. They heard about "magic numbers" being bad so they create a const for every value.
int TEN = 10;
int ONE_HUNDRED = 100;
etc.
>>
Is this alright for getting a desirable (legal) value for a variable in C++ AD2024?

Some other nice idiom for this?

auto var {generate_var(/*args*/)};
while (illegal(var)) var = generate_var(/*args*/);
>>
>>102382103
>Is this alright
it certainly raises an eyebrow
>>
>>102380358
i haven't used it much but F# isn't pure it just prefers to be
API-wise since it's still .NET the same libraries cover both
i tend to see functional langs as being more dataflow oriented as opposed to state management oriented
in some ways they remind me of shaders
i think i heard them described as state is the edges of a graph and you're creating paths between them or something like that
>>
>>102382743
is it true that F# is fast because it's insanely restrictive? like Go which is also fast in build times but also restrictive?
>>
>>102382103
i mean that's basically an atomic compare and swap loop so very idiomatic but the more hip thing to do would be to use std::optional and std::expected with the monadic extensions, and keep the potentially invalid state isolated although i'm not sure how best you'd do that in this case

>>102382777
F# is fast? i was under the impression people used it because functional languages/constructs are nice for certain classes of problem and F# is a functional lang that didn't go completely full retard and also has the .NET ecosystem
at least that's why i've used it on the few things i have

and restriction doesn't imply speed, although i would say Go's simplicity certainly helps with build times
the immutability by default principle and preferring functional purity is certainly going to help the compiler and the .NET JIT optimize things i guess
also you can be restrictive without being restrictive
like functional languages typically can get away with implicit yet very strict typing due to robust type inference rules
>>
hi
haskell
>>
File: out13.webm (621 KB, 592x544)
621 KB
621 KB WEBM
I made the portal to "dire dire docks" from mario 64, using ansi escape codes
>>
File: 1708354685130863.jpg (9 KB, 235x231)
9 KB
9 KB JPG
i might do some programming today
>>
>>102380694
So at first I thought that I was dereferencing an invalid pointer, but it turns out that it just *does* it - ***repeated conversions*** of the first 128 ASCII characters into UTF-16. As in, this is happening multiple times, and always using RtlUnicodeToUTF8N. I cannot fathom why anyone would do this, but then again I've never accumulated enough braindamage to be working for nVidia.

Oh, and yes, this is nVidia code. nvwgf2umx.dll. Because of course it is.
>>
>>102383021
Kek I think I got confused with FORTRAN, not F#
>>
>>102383490
oh
fortran's got a good builtin parallelism framework and can also target GPUs
i don't think it's actually fast compared to doing the same thing in CUDA or AMD's version of CUDA but because it spits out native code it's probably faster than python for scientific computation

>>102383288
if i wasn't sure it wasn't something stupid based on the other shit you've run into i would guess intentionally nonsensical but easily recognizable code used for runtime binary signature validation
>>
File: DXCACHE.png (56 KB, 1794x966)
56 KB
56 KB PNG
>>102383676
>used for runtime binary signature validation
Even if that was the case - which it's probably not, given that file I/O is traced as well, and there's way too many conversions in between mapping cache and profile files - it's still fucking retarded. Every single one of these calls is wasting thousands of cycles for absolutely nothing.

Also since I've successfully hooked LdrLoadDll and patched the usermode driver (it was constantly resetting thread affinities and wasting a couple thousand cycles more on context switches for no gain whatsoever). I'm certain the verification code doesn't check itself.
>>
>>102381441
>
if (newShape->isSpotlight)
newShape->noShadow = true;
else
newShape->noShadow = false;

The rest of my department legitimately prefer it written this way.
And then their auto format expands all 4-space indents into 8 spaces on every file they touch.
>>
>>102383951
> The rest of my department legitimately prefer it written this way.
I don't know their reasoning, but I can see why would people want a more verbose version.
Should noShadow _be-equal-to_ isSpotlight? Then you'd want to show it with a simple assignment.
Should noShadow _depend_ on isSpotlight? Then you want to show setting the value depending on isSpotlight.

The program text should convey the intention.
>>
>>102382395
In what sense? Would you propose an alternative?
>>102383021
This sounds like terribly overcomplicated solution to a simple problem.
>>
File: movabs.png (3 KB, 720x60)
3 KB
3 KB PNG
>>102384056
>The program text should convey the intention.
If the compiler was good, sure. Very often they're not, and you have to coerce the compiler into generating the code you want it to generate - like filling a register with an ASCII or UTF-16 pattern directly encoded into the instruction so that you can save a memory reference.
>>
>>102366455
go or rust for someone who finds javascript difficult?

which one can do more without learning alogrithms and data structures and other things. I can learn languages well.
>>
>>102384056
That doesn't mean anything. No intention is conveyed by the if shit.
>>
>>102384423
go was literally made so google could have expert devs and the most abysmal of retards work together on the same codebase without it being unmaintainable
you should at least try to understand some of the concepts behind data structures and algos

rust is not for people like you and should not be marketed towards people like you
it really disturbs me that there's a huge "systems programming for the rest of us" accessibility component attached to the way people talk about it and i'm like 99% sure this is also the reason why rust programs tend to be microdependency hell
>>
File: file.png (7 KB, 370x42)
7 KB
7 KB PNG
I'm trying to add LZ4 onto my project but the compilation is erroring out
It seems to be the -fanalyzer flag but I seriously don't get why it's ignoring the asserts
I added the assert right before the offending line and it still errors out with
lz4.c:946:15: error: dereference of NULL ‘0’ [CWE-476] [-Werror=analyzer-null-dereference]
946 | U32 const startIndex = cctx->currentOffset;
| ^~~~~~~~~~
>>
>>102384590
>systems programming for the rest of us
Is that a new excuse so that people don't have to write code that doesn't suck?
>>
>>102384590
>you should at least try to understand some of the concepts behind data structures and algos
Mathematics is a big issue for me.
I never learned it past high school level, but I do well with logic based programming and learning quirks or syntax. JS is the right spot with that.
>>
>>102384630
i'm not sure what you're implying but what I was is that rust is not a panacea for letting incompetent developers touch codebases they shouldn't
if you can't write generally safe C or C++ code you should not be writing rust code, rust doesn't eliminate all classes of bugs, just some of them, and if you struggle with memory safety outside of minor typo-level errors (which can still be very dangerous) in either C or C++ you almost certainly are writing programs which contain tons of logic errors as well
i generally consider rust to have too much overhead on flexibility for normal projects but there's absolutely a space where it's extremely important

rust should only be used by people who know what they're doing, and you have this shit being marketed towards webdevs who aren't even capable of conceptualizing things like why reducing dependencies is good
>>
>>102384743
So unless you're talking about actual genetic defects incompetency is a choice in my book - people chose to not bother, and so what they write sucks. When they then get called out on their stuff sucking they make up excuses like "speed isn't everything" or "that's too deep for me", and I was wondering if "y'all just want us to do systems programming now" was just a new excuse of the month.

>there's absolutely a space where it's extremely important
Which is? Because if I'm not competent enough to write good C code I shouldn't write in C code, but if I am I ... ... ... just write good C code. Like, why would I switch? I'm already fuming mad VS got rid of x64 inline assembly, I don't need any more restrictions in my life.
>>
>>102384056
spotlights are lights, thus they don't have shadows, that was the logic. You shouldn't even need a second variable to convey that information, which is part of the reason the code made me so upset when I figured out what it did.
>>
>>102384911
>Which is?
ultra high security applications which have to be maintained or consumed by people whose intelligence you can't necessarily verify
projects using the benevolent dictator system of leadership and extensive testing infrastructure don't necessarily need to use rust, projects that aren't necessarily open contribution
not strictly high security but sqlite is an example of where this works
pure functional langs which are provable are another alternative

so is the complete eradication of stupid people
>>
File: 1717069241595246.png (187 KB, 1707x1376)
187 KB
187 KB PNG
I'm spending the saturday night on a new small project: an oldschool .MOD (amiga protracker music module) player I'm writing in C11.
>>
>>102366455
> be sophie wilson
> shamelessly taking credit for everything that her fellow employees and other corporations produced for over 30 years
amazing work, sophie.

>>102367101
this pic makes my enormous white balls try to shrink back into my abdomen out of pure horror.

>>102384590
>i'm like 99% sure this is also the reason why rust programs tend to be microdependency hell
it's the exact reason, and also having rust shills (that also can't code) trying to market the language like it's a mcdonald's happy meal that anyone can enjoy and use doesn't help matters. equivalent of loading up a shotgun, giving it to a 4yo and hope/pray that the kid doesn't figure out how to disable the safety. they truly believe the compiler will fix all of their problems so they don't have to learn anything about memory management nor have to care about any other system.
>>
File: intcode complete.jpg (76 KB, 1080x351)
76 KB
76 KB JPG
yaaaas
>>
>>102385444
excellent. mod is a great format. one thing that a lot of people don't get right when making protracker players is this example:
C-3 1 000
--- 2 000
--- 3 000
--- 4 000
...

retarded faggots will not move the sample pointer to sample 2, 3, 4 whatever. they completely ignore the sample change after the first read of any note. they assume if no notes found that means play the same sample despite the sample numbers existing in that track. if this isn't implemented properly a tonne of songs, especially chiptunes, will sound completely fucked and will be incompatible.
>>
>>102385444
here's an example of what i mean. it's better to just post a .mod demonstrating it:
https://files.catbox.moe/ipodyg.mod

compatible mod replayer will make this sound like a looped pulse wave despite being broken up over 6 samples.
>>
File: 1698659419684051.png (192 KB, 1707x1376)
192 KB
192 KB PNG
>>102385635
I really do like the format, it seems to be simple and efficient. It could be better, but it's good for its time (and technically versatile enough for its time).

I've never looked at any existing player implementations, I want to do this by just reading the specs scattered online, "on my own". Sounds strange that such an error would be widely spread, I'm not as far as to actually playing any byte data yet so I haven't thought about it much. If I'd have to improvise quickly just from the top of my head, I'd say I would keep a simple state of the player and channels in memory and apply whatever there is in the current pattern's current row's data available, be it an effect or a sample number or note frequency. So to me that kind of an issue sounds weird, but maybe it's because of the attempt of supporting multiple formats (XM, etc)? And because of such an abstraction, compatibility to .MOD has been broken like that? Idk, just speculation...

I only just got the pattern data parsed correctly, I think my player now reads everything so I can move on to the next steps.
>>
>>102386290
>It could be better, but it's good for its time (and technically versatile enough for its time).
indeed good. some programmers during the 90s tried to improve it a little, especially by using compression and custom players - which saved quite a bit of memory) while maintaining compatibility with the original protracker2.3 spec.

>but maybe it's because of the attempt of supporting multiple formats (XM, etc)? And because of such an abstraction, compatibility to .MOD has been broken like that?
quite possibly. fasttracker 2 doesn't support all of protrackers quirks, i think impulse tracker is the same, many other "players" also just took liberties as to what should be compatible and what shouldn't , due to being overlooked or completely ignored for whatever reason. best way to test if your player is going to be compatible is to use protracker2.3a as a reference to compare playback. (https://16-bits.org/pt2.php)

>I only just got the pattern data parsed correctly, I think my player now reads everything so I can move on to the next steps.
excellent
>>
File: 1703143981207303.jpg (183 KB, 1500x1125)
183 KB
183 KB JPG
Hello sister sirs,

(100% FRee) 2024 Rust Programming for Beginners
https://www.udemy.com/course/rust-programming4u/?couponCode=BBEA4946D57E98BBAE4A

Time for you to ditch cnileism and adopt the future.
>>
>>102387027
too bad for you, cant swat anons, this isnt germany
>>
>>102387027
also free, and fast!
https://github.com/Speykious/cve-rs
>>
File: part_of_the_problem.png (397 KB, 828x683)
397 KB
397 KB PNG
>adopt the future
Haven't we done that for the last thirty years and it's all garbage? It's time to actively hunt down and tortuously murder these people.
>>
>>102387027
fuck off and die, thanks.
>>
>>102386945
This is my first time programming any audio related stuff. I'm trying to figure out how to play samples, on my own ofc.

Does this make sense: Divide audio playback and rendering to separate threads. Playback on main thread. Some timestep is used for playback, eg. 0.2s, each timestep we copy 0.2 worth of sample data to a buffer. Audio rendering just samples this buffer at eg. 48khz.
>>
Insanely baffled to find out that Swift's Regex engine is 8-10x slower than Python's or Perl's for the exact same RE:

time python3 trace.py > /dev/null
python3 trace.py > /dev/null 0.46s user 0.03s system 97% cpu 0.495 total

time perl -ne 'print if /^([0-9a-f]+)\s+\S+\s+([0-9\/]+) ([\d:.]+) (\d+)\s+(.+)/' tpndss.txt > /dev/null
perl -ne 'print if /^([0-9a-f]+)\s+\S+\s+([0-9\/]+) ([\d:.]+) (\d+)\s+(.+)/' 0.23s user 0.02s system 99% cpu 0.244 total

swiftc StreamReader.swift main.swift && time ./main > /dev/null
./main > /dev/null 3.95s user 0.04s system 94% cpu 4.209 total
>>
>>102388090
>Divide audio playback and rendering to separate threads
is fine.
>each timestep we copy 0.2 worth of sample data to a buffer.
depends how you're going to mix the samples or play them. the maximum size is 65535 bytes per sample, it'll take less processing time if the buffer contains the whole sample rather than copying chunks at a time. will avoid any buffering issues if something accidentally uses up more time causing the buffer to play out before being refreshed.
>>
Good morning saars.

Today I will continue writing my trivial gtk3 programs.
>>
>>102388227
swift is a terrible language
>>
>>102388564
nice work, sir! and good morning, sir!
>>
>>102388227
> 4.209 total
fuck. that's ridiculous.
>>102388608
absolutely. out of all my decades of programming i've never met a single person that (would admit to) uses swift. not one.
>>
>>102388727
>out of all my decades of programming i've never met a single person that (would admit to) uses swift. not one.
It's now the primary language of Ladybird :^)
>>
>>102388748
i saw andreas's tweet about it awhile ago. i can't see how this will end well for them. their reasons for changing languages are for "memory safety" and "data race safety", but swift is so trash that you might as well just use rust at this point or learn how to code better c++ and actually bug test your shit before releasing it.
>>
File: 238.png (1.32 MB, 1024x724)
1.32 MB
1.32 MB PNG
>>102388829
There's two ways this is going to end:
1: Either they miraculously put in all the necessary time and effort into making their browser not complete garbage (which begs the question why they couldn't do it in a proper language to begin with - the answer is probably sheer incompetency, which leads us to the second option:)
2: Or it will be a complete crapshoot that will be eventually abandoned and lost to the void of time.

I wouldn't bother paying it any more attention. It's dead, Jim.
>>
>>102367101
Is bottomleft really not just a dude in a rock band or a surfer?
>>
>>102388727
I would've been the first dude to program in Swift because it's a slightly nicer Nim, but now I'm not so sure I'll keep going down this road

>>102388608
It's compiled and has pattern matching (usually the killer feature for me), but the Objective-C baggage it's carrying around is getting really annoying
>>
>>102389126
>because it's a slightly nicer Nim
how?
>>
>>102389007
>the answer is probably sheer incompetency
i would guess it's this.

>I wouldn't bother paying it any more attention. It's dead, Jim.
seems that way. their motivations for moving to swift are immensely stupid and puzzling.
>>
File: alyssa rosenzweig.jpg (586 KB, 1904x2208)
586 KB
586 KB JPG
>>102371497
how about this one?
>>
>>102384605
could be a false positive, static analyzer is far from perfect
>>
>>102389180
that's a man
>>
>>102389144
Syntaxwise, it's got brackets and isn't as flexible as Nim's fuckery with dotting for first function parameter and equivalence between camelCase and underscore
In general, I liked the handling of Optionals with
if let something = returnsOptions() {
and the try

But the standard library and Foundation get more annoying to use by the second. They really need to polish it for general server use if they want the language to escape from being an iOS app-only language
>>
File: th-1411076408.jpg (17 KB, 474x266)
17 KB
17 KB JPG
>>102367101
Born too late to wed a feminine wife
Born too early to wed a feminine boywife
Born just in time to fuck a disgenic troglodyte that may or may not have a penis.
>>
>>102389210
>They really need to polish it for general server use if they want the language to escape from being an iOS app-only language
i can't see it happening. apple can try to change its image but it's still tainted by apple so people aren't going to rush to use it for severs when other (and faster!) well established languages exist.
>>
>>102389210
>, it's got brackets
oh okay, you're just a ducky
>>
>>102389271
The language in general is pretty quick, it's just the Regex engine in particular that seems to suck
All other operations with strings, hashmaps, and arrays I run seem snappy

>>102389301
I prefer brackets because I like Lisp :)
It's a bit clearer to me with brackets and indentation where things start and end rather than indentation alone
>>
Are there any other languages that use automatic reference counting or close-to-automatic memory management like Swift and Nim?
>>
>>102389421
rust
>>
>>102389421
There's pony, but
>it's borderline abandoned
>even harder than rust to learn
>>
>>102389301
giving meaning to the length of groups of the absence of a symbol rather than a clearly demarcated begin/end symbols is really idiotic and is very obviously a bad idea just from a high school level cursory understanding of how human brains and vision works
>>
File: 611812921.png (24 KB, 332x332)
24 KB
24 KB PNG
>>102389421
Crystal
>>
>>102389448
Yeah, it's a real shame SML and haskell failed because they didn't include the sacred brackets
>>
>>102389454
well
they did
>>
>>102389454
maybe the only reason people think haskell is hard is because most of their brain is occupied filtering out whitespace instead of writing code
>>
>>102389484
>haskell is hard is because most of their brain is occupied filtering out whitespace instead of writing code
the opposite
haskell lets you write better code, which filters brainlets
>>
>>102389451
>server = HTTP::Server.new do
Discarded with prejudice, they're fucking liars who deserve public execution.
>>
To all unemployed programmers in here:
How do you avoid paralysis by analysis?

I am not sure "paralysis by analysis" is precisely what happens to me but I also think it is not necessarily tutorial hell.
The thing is that I keep myself in a constant state of uncertainty about what the fuck to do. I completed CS50 and got a pretty good understanding (I think) of C and Python but it still feels like it is not enough to get a job (not to mention the horrible current state of the industry) and indeed I do not believe I want a job involving webdev with Python which is more or less what CS50 prepares you for.
Also, considering the education I received on my third world university, I do not really feel comfortable in other areas or fields of programming.
Even before I heard Jon Blow saying that one should not do webdev, I already, for whatever reason, felt rejection for webdev.

Instead I feel some kind of attraction to stuff I can't even properly name because I am not sure what the concept even is. I think I can refer to it as something like "I have interest in C++, Go and Rust", but those are only languages and not precisely programming or software engineering fields.
I recently got a copy of The Rust Programming Language (the book) and have almost finished it but silly stupid me now feels like going back to C++ because I have no idea what to do or what path am I even trying to follow. It's like I'm just driving a bike on a desert without any roads.

What is it that interests me about those languages? Is it gamedev? C++ then. Is it desktop software? C++ again then. Is it some form of backend webdev? Go then. Not to mention that what I ultimately want the most is getting a good SE job. Then either C++ or Go is good right?

Then why the fuck have I been focusing on Rust?

What is wrong with me?
>>
>>102389454
I coded in SML for a while. Could never quite get it to do the right thing for me; the particular problem I was working on at that time was easier to express in Java. (The essential thing was that I could definite when two values of a type were equal and use that in mappings. That turned out to make the problem much simpler.)
>>
>>102384605
Is it paying any attention at all to the asserts? Is NDEBUG defined?
>>
>>102389721
Would it be fair to say that you've only ever skimmed the surface of any given topic? Because it sounds like you've just been skimming from A to B to C without gaining full understanding of what you're doing and how it translates into actual program code.
>>
>>102389721
Ruminate less, write more code
I can't help you with career decisions, it's up to you to find out what motivates you enough to work in it
To do that, write more code
>>
>>102389721
You just push through that shit man. That's the advice I got when I was there. You literally cannot think your way out of over thinking things. There is a bit of luck anyways. You focus on the topics that interest you and either those subjects are in demand or they aren't. If you only focus on what you think is important today it could be unimportant tomorrow. Some things like general problem solving and organization skills transcend disciplines so even if you are focusing on a subject that ends up being worthless, you are still improving your base stats at least. You just have to give up the illusion of having control over your fate and push through.
>>
>>102381452
Event routing in GUIs gets real ugly when you choose to do it all yourself. Which is why you try to delegate as much as possible to a toolkit library/framework.
It gets a lot more complicated when you implement non-rectangular controls. Unless you cheat.
>>
>>102379258
>you don't need ## before vaargs
It's a gnu-ism to make zero args after the format work.
>>
File: file.png (10 KB, 325x175)
10 KB
10 KB PNG
>>102389804
oh, found the issue because of that tip, many thanks!
but fixing this led to many other issues so I just compiled lz4 without the static analyzer and it works fine
>>
>>102373416
>Is this bad code?
It depends on whether you have something in place to deallocate fileInfo if the fread() afterwards fails. That could happen if the file was truncated after the header.
Also, you're probably baking your system's endianness and alignment/packing rules into the file. You might not care about that, but in general it can be quite annoying/important to get such things right. Alas. I really wish I could portably have structs where I could say "this field is big endian and that field is little endian" as part of the type, but it doesn't seem to be something that compiler makers think programmers want.
>>
File: 1722518436247452.png (229 KB, 1920x1064)
229 KB
229 KB PNG
>>102389326
>I like Lisp :)
basado
>>
>>102389806
Yes this is probably somewhat accurate.
It feels annoying because I did study through uni writing stuff in C and Python but it still feels nowhere near enough to what it is needed in the real world. I did a project involving Python + Flask with sqlite3 and some frontend and while it was fun, it didn't really left me wanting more. I tried C++ and while it felt fun doing (some) Advent of Code problems on it I never really felt like I knew enough to do anything serious. So I believe I know more Python than C++ because of this.
I picked up Go and read through the awesome "Writing Web Applications" article on Go's documentation and finished it but was incredibly lost when trying to write my own shit. I picked up Rust, it feels very difficult compared to everything else but have been able to follow the book understanding most of it. I think I can elaborate more by replying to the other replies:

>>102389828
I think writing more code is what I should have done... except it should have been years ago, not worrying much about different languages or technologies. Instead I was barely writing the minimum amount needed to get through college. I definitely am not what most programmers are. I mean, I didn't start when I was a kid and never developed a big passion to write code just because. Unfortunately, yeah, for whatever reason I picked this as my career. So now I'm trying to develop a habit/passion of writing code when there's an overwhelming amount of fields, industries, languages, methodologies and frameworks.

>>102389879
>You just push through that shit man.
thanks man I am slowly trying.
>so even if you are focusing on a subject that ends up being worthless, you are still improving your base stats at least.
That' s what I hope. At least I've been consooming a lot (even if just theoretically) about programming concepts and shit. I hope one day everything clicks together.
>>
File: it_never_stops.png (16 KB, 872x600)
16 KB
16 KB PNG
>>102390216
>I didn't start when I was a kid
So did I. I was sixteen and started off with books about C++ from the local library, and now I hate C++ and bore this thread to death with registry dumper challenges, tracer updates, and arena allocators. If you don't have a passion for this shit, then you're better off doing webshit or quitting.

Do you like writing code?
>>
>>102390304
>Do you like writing code?
It is complicated. I do think I enjoy programming. But I'm starting to think that the idea I'm elaborating in this thread is that programming nowadays feels different in concept than (what I believe) what it was years ago.

It seems like nowadays you have to be a master of everything and be comfortable with easily understanding and copying boilerplate and adding libraries and shit, especially with webdev.

I believe I like writing code but, so far, every time I write code, I encounter problems like a new concept that I never heard of before, a lack of familiarity with a certain topic/language/framework/library. A constant feeling of "I have no idea how to do this", and constant distractions. It is overwhelming. Like for example, the other day I thought something like "alright, so everyone does the simple todo app as a beginner project (even though I've done other more complicated beginner projects). But I'd prefer to not do webdev, so what if I write a todo application for the CLI or with a GUI? Shit, I have no idea how to do this. There' s a Rust crate called Clap, alright let's take a look. Holy shit I don't understand this thing at all. This code seems miles ahead in complexity compared to my little baby shit exercises". Or... "I definitely have a gamedev itch, I should focus on C++ instead of Rust and start writing games. Holy shit to learn Godot I have to learn a lot of shit like the interface and all that stuff about cameras and stuff, that is so weird and boring. Not to mention math and physics".

I actually think I might just be retarded.
>>
File: output.webm (3.37 MB, 860x640)
3.37 MB
3.37 MB WEBM
I am ready for full stack production.
>>
>>102390216
>I did a project involving Python + Flask with sqlite3 and some frontend and while it was fun, it didn't really left me wanting more.
That's all real world stuff. With Java or Go or whatever the business has their tech debt in. You read stuff from the database, you transform it, and you put it back in.

>>102391135
Yes, every domain has something to learn. You don't go to uni and come out a gamedev, a webdev, an embedded dev. You come out learning to learn.
Do everything with your favorite language so it's easier to learn new things (less study material, more enjoyment), or pick the right tool for the job (if you do Unity for gamedev there are zillions of tutorials) (more study material, less enjoyment).
>>
>>102391487
And AAA work at Ubisoft
>>
>>102367101
women programmers are built different
>>
how do programs dynamically scale their ram usage with what is free? do they always use the same amount but more or less gets paged, or do they start destroying and recreating objects based on how many they can sustain?
>>
>>102392115
It depends on the OS and the program.
>>
File: 1694798491861392.jpg (92 KB, 960x897)
92 KB
92 KB JPG
>>102392338
Forgot picrel.
>>
>>102392115
vulkan's got an extension called memory budget that tells you how much in the way of VRAM you're okay/recommended to use
>>
>>102391503
>With Java or Go or whatever the business has their tech debt in. You read stuff from the database, you transform it, and you put it back in.
Yeah and it was quite, well somewhat, elaborate. Please do check out CS50's finance problem set (if you don't already know about it). It is a project that consists in building a stocks buy/sell simulator, it was somewhat hard but fun. So if you say it is real world stuff it def makes me feel better.

Anyway, thanks for your words. I will try to remain positive.
>>
I have finished my percentage calculator.
https://notabug.org/aussie114/percentage_calculator

I simplified the gtk building process by creating a widget struct with a widget and x,y,w,h variables.
https://notabug.org/aussie114/percentage_calculator/src/master/src/main.c
>>
>>102372519
>>102372554
>>102372563
>>
>>102388324
I see. Well this morning I got some samples to play through my speakers but I'm baffled why the sample lengths seem incorrect even though I think I read them correctly. So I try to play sample #0 and the length encompasses a bunch of the first samples...

Anyways, I'm a retard when it comes to this so this will take some time, but it's fun for sure. And I'm stubborn too, I don't want to cheat by peeking at other people's implementations...
>>
>>102394328
There's nothing wrong to look at how other people do it, as long as you try to understand how and why they do it.
>>
>>102366455
>What are you working on, /g/?
custom themes for my app, i'm making one of the 2 or 3 light themes
>>
File: 1719694399514896.png (73 KB, 1464x265)
73 KB
73 KB PNG
>>102394581
I just don't want to, I want to come up with my own implementation of a mod player.

Look at this spec. You'd think it's simple to read these, right? I just fread 2 bytes into an uint16_t as the length, but for some reason the lengths are fucked up (too big)... Is this an endianness issue, next thing to check...
>>
File: 1696870613524480.png (35 KB, 538x273)
35 KB
35 KB PNG
>>102394618
It fucking was an endianness issue. Fuck me, now it works.
>>
>>102394618
I wouldn't use fread. I'd use mmap/CreateFileMapping. Makes range checks muuuuch easier.
>>
>>102388748
>Ladybird
>truly independent browser
>community is on discord
>code is on github
>example screenshot is on a mac
im gonna fucking shit
>>102394618
clearly sample length is actually a signed int :^)
>>
>>102394582
Blue on blue?
>>
File: 93jkzd.jpg (140 KB, 500x500)
140 KB
140 KB JPG
>>102367101
>always glad to see women in the tech industry
>>
I'm sorta new to c++ and I'm trying to build a thing using fltk. I'm having a problem I can't quite articulate into google.
There's a Fl_Menu_Bar class that internally maintains an array of Fl_Menu_Item structs on the heap. I want to extend the Fl_Menu_Item struct to include one more variable, a char* pointer to an extra name so I don't have to untranslate strings millions of times in a multilingual program. Can I somehow safely override the "menu_" variable (that stores the Fl_Menu_Item heap array) in a subclass of a Fl_Menu_Bar, say "Custom_Menu_Bar" to use a "Custom_Menu_item" subclass of the Fl_Menu_Item struct with the extra char*, without rewriting ALL THAT SHIT that uses Fl_Menu_Item*s? I mean it de/allocates new Fl_Menu_Items in a shitton of internal calls, it won't magically get the memory for that extra char* right?
I'm guessing given my inexperience it's best to just maintain a list of untranslated names and menu indices in my settings singleton, but that's really roundabout.
>>
>>102394659
anon here from yesterday. i'm glad that you worked it out. and yeah, the endiness always catches a few people out.
>>
>>102366455
Can anyone decode this code?
I tried
 base64 -d 
but it didn't show anything.
 94b5bde6de888ddf9cde6748ad2523d1 
>>
>>102395485
That's not base64, but hex. Nonsensical hex too, if one assumes ASCII.
>>
>>102395522
How does one go about decoding this?
>>
>>102395533
You take two characters (94, b5, bd, ...) and look up their value in an encoding table. Which encoding table? Well, as I've already said ASCII doesn't work, and so do UTF-8 and UTF-16.
>>
>>102394963
it's called Lavender, but i'm testing currently i'll probably use white (3fef6ff)
>>
>>102369986
Learn how to actually market your language or, if it's not actually good, maybe take what you learned and make a better language.
>>
>>102373416
I mean, you could abstract away into an error handling function and use enums to drive a switch statement. This way you could reduce the clutter in the active part of your code without knee-capping its clarity.
 if (!some_random_condition) herror(ERROR_ENUM);

where
enum{ERROR_ENUM};
int herror(int code){
switch(code){
case ERROR_ENUM: printf("ERROR: ENUM\n"),exit(1);
}
}
>>
ok gee, which style is better ?
>>
>>102396084
Those buttons make no sense, sorry
The dark is in light mode, the light in dark mode, and I can't understand which is on and which is off
>>
>>102396146
i'm talking about the button style, the text in both was for testing, my point is should the button background be white and its borders be purple or should it be purple background and white border
>>
File: 1726157611389152.png (1.37 MB, 1654x2260)
1.37 MB
1.37 MB PNG
>>
are you using c++ module in your project?
>>
>>102395393
the performance cost of gettext is pretty negligible, but the benchmark made in this post is flawed because if the structure is a binary tree, the more strings you have the more higher the cost is, so the example with one string is unrealistic.
but the only way to know if it matters is by doing a benchmark / profiling.
But if you only care about english performance, the cost of english is zero because it just returns the string you gave.
https://stackoverflow.com/questions/18268608/performance-overhead-of-the-gettext-internationalization-system-in-c-c
also gettext is a pain in the ass, I think it's better to just avoid translations until the very last step of your project, since it's typically more common for projects to die than to be completed.
>>
Boss said that I can't use qt because of the license costs.
What the fuck do I use now for cross platform app?
>>
>>102398200
it's technically free but electron is the only option because I would rather work with JS programmers instead of C++ programmer.
If you can't code in JS, you are a shit C++ programmer.
>>
>>102397954
Hey, I wasn't aware of that library. I skimmed the docs and it's interesting. Thanks! I just hand-rolled my own shitty translation functions so far and ended up just assigning default strings to elements and then storing these strings along with element indices computed at runtime based on every element's position in a given window/menu/box, to determine which thing gets which label if I switch languages at runtime. Long strings are assigned short names like "_1openglwarning" or something that get "translated" to english or whatever language on demand to prevent storing novels in there.
It sort of works so I guess I'm stuck with that for now, but I may switch to that library later. Thanks again!

>>102398200
I'm new to c++, but while I was looking for c++ interface libraries I saw a post recommending gtk. It's supposedly functional despite gimp's reputation for being slow. It's not light though. But I went with fltk because, being a novice, I saw the words "Fast Lightweight" and had a neuron activation. I like it but it's kinda ugly by default so you'll probably need to make custom draw() functions, possibly using images.
>>
Explain the Jitter Buffer to me. Article writers tell me that jitter buffer waits some X amount of time after receiving the first packet, potentially reordering them in that time, then after X amount of time elapses it starts sending those packets to the decoder. The question is: what do they mean by "first packet"? When does it reset, i.e. when is a a packet considered to be the first packet considering that the jitter buffer is receiving packets pretty much non-stop?
>>
File: 1618730424565.jpg (62 KB, 976x850)
62 KB
62 KB JPG
>open big number library file
>ctrl+f "endian"
>specified text was not found
>>
File: sddefault[1].jpg (24 KB, 640x480)
24 KB
24 KB JPG
>>102367101
>>
>>102390216
You can't learn everything. There just isn't enough time in life. This is why people are told to work on projects instead of on specific tools, especially if the projects are relevant to them somehow. Ideally because someone else wants the project done, but you can't always get that.
>>
>>102367101
They all dress like some random woman in a gangbang porno.
>>
How can I implement gamma correction formula without touching floats? its a limited microprocessor and adding a float slows everything down with software implementation
>>
>>102399130
I think you can use a precalculated table?
>>
>>102399130
by using bytes or shorts or whatever is native on it?
>>
File: file.png (108 KB, 1736x743)
108 KB
108 KB PNG
>>102399213
figured a close enough approx. with green being mine
>>102399196
I should probably do this though. it would be faster and more accurate
>>
>>102398884
because they're all porn addicts who want to be the woman that gets gangbanged
>>
>>102399580
How would you know that?
>>
>>102399692
And you know that ... how, exactly?
>>
JVM or CLR?
>>
>>102399735
>jvm or windows locked system
>>
>>102399708
no clue, do you?
>>
>>102399748
He doesn't know about .Net Core?
>>
>>102399784
>every library you want to use is windows only
>>
>>102399859
Are they? I thought this was a big issue for GUI-related work mostly
>>
>>102399859
whats the magter you dont have a coputer?
>>
>>102399859
stop complaining about irrelevant legacy GUI libraries you know nothing about that are also saddled with an incredible amount of baggage
oh no winui doesn't support linux whatever shall i do without shitty flat UIs stuck with forced UWP packaging
>>
>>102400042
It's amazing how unemployed someone can sound in just a single post.
>>
>>102400337
I'm employed but my job has nothing to do with making posts on /g/ all day.
>>
the war in ukraine has been a disaster for humanity
>>
>>102400402
Ah, that's right, menial laborers don't know the concept of "downtime during the job", do you?
>>
>>102400337
give an example of an actually relevant .NET library locked to windows of actual consequence that's not Windows forms, WPF, or WinUI (which have alternatives) with zero open source/cross platform alternatives
also the entirety of .NET framework is deprecated and even if a library hasn't been ported to cross platform .NET it still shouldn't be used because it's slow as fuck
>but muh ancient codebase NEEDs this garbage legacy windows library
your CRUD enterprise application is not that important, throw the baby out with that bathwater

oh and needing to do some supremely retarded windows exclusive shit like maintain a Microsoft office COM-based add-in or make other platform specific calls has absolutely nothing to do with whether or not .NET has linux support
>>
>>102400437
Since when are we counting Russians as humans?
>>
>>102400479
>severe goalpost moving
You got triggered.
>>
>>102400559
what goalpost moving
the goal was always you don't understand anything about the .NET ecosystem or how it's changed and are just repeating FUD you heard from people who literally don't even understand that .NET Core supplanted the proprietary original
>>
>>102369893
>Rust's whole fundamental claim of memory safety has been debunked
link?
>>
>>102400605
Wrong.
>>
>>102374246
where is that code from
>>
>>102400632
buddy you faggots are a dime a dozen, your opinion isn't unique but it is uniquely stupid
maybe stick to legitimate criticisms of .NET like microsoft not actually respecting any of the open source governance shit instead of mindlessly repeating hurr windows locked
>>
>>102400674
Your strawmanning isn't fooling anyone but you.
>>
File: dump.png (89 KB, 1894x989)
89 KB
89 KB PNG
>>102400607
>>102387178

>>102400641
Registry dumper. I have need to print decimal numbers, and sprintf is so slow I'd beat it even if they did get rid of all external memory references.
>>
>>102383676
>faster than python
Fortran is way faster than native python. Fortran is basically C fast for work that it is good for (array based calculations)
>>
>>102400821
You wait until you try writing your own floating pointer number printer. That's ever so easy to fuck up.
>>
>>102401028
if (x > 10.0) printf("big"); else printf("not big");
>>
>>102401028
I rarely do FP numbers. A lot of times you can get away with an integer representing a ratio, like "2456 of 10" for 245.6 or "8764 of 33" for a smooth 265. Lord knows the Factorio devs could've done that for their fluid system, but noooooo ...
>>
>>102401103
2 of sqrt 2
>>
>>102401122
I said "a lot of times". Not "always".
>>
>>102401140
the uncountably infinite minority of the time
>>
>>102389247
>Born too early to wed a feminine boywife
And when is that gonna be possible?
>>
>>102401186
>denial
You'll get through it, don't worry.
>>
File: picard4lights.png (236 KB, 645x844)
236 KB
236 KB PNG
>>102367101
your employer wants you to pretend these are women, or else you'll get fired. In police states like Britain, you can go to prison for using the correct pronouns for their actual sex.
It's psycho terror, a literal daily humiliation ritual designed to break your mind.
>>
File: 1707826096643587.jpg (3 KB, 111x111)
3 KB
3 KB JPG
>>102373852
>reverse engineering something
>disassemble
what sorts of things?
What is the result? C++ Source code?
Do you figure out what the structs/classes are, how they are laid out and the names of things?
>I can make whatever hacky shit I want
What exactly can you get it to do? Could you edit the map used in a game?
Tell me your most impressive 'chieves.
>>
>>102391512
kek
>>
File: evolution.png (1.96 MB, 1920x3260)
1.96 MB
1.96 MB PNG
>>102401424
NTA, but:
>What is the result?
Knowledge about internal data structures, how the program interacts with the OS, and patches/extensions on a machine code level.

>Could you edit the map used in a game?
Once you have the format down you can make your own custom maps with custom everything.

>Tell me your most impressive 'chieves.
Reduced the amount of CPU time Future Cop took on modern systems by inserting a Sleep into the message loop through a code crevasse (a region in the code segment that doesn't contain any actual code and exists for the purpose of alignment only).

Fixed the original PC version of Grandia 2's display problem on modern Windows systems (MS has everything go through their compositor now, and Grandia 2 didn't provide a proper set of flags to CreateWindow to surpress window frame generation).

And then there's the tracer I've already posted about numerous times, which is going to make future REing much easier.
>>
>>102375739
>vim isn't ideal
Correct.
>>
>>102400607
you just know
>>
>>102401408
Why can't you just say what they want to hear? Your life could be so much easier if pretended just a little but instead you choose to suffer, you're doing that to yourself.
>>
>>102401691
Everyone who's watched Malcom in the Middle knows suppressing your opinion ain't healthy.
>>
I just tried Basic and it's totally usable in 2024. I don't understand why we need C++.
>>
>>102402023
>t. karlie kloss
>>
How the fuck does a woman last 30 years in a company. Did he make coffee in the morning and went back home?
>>
File: 086.png (661 KB, 1024x596)
661 KB
661 KB PNG
>>102402367
>>
New: >>102403295
>>
>>102366689
You ever hear of Libre Calc? Excel?
>>
File: file.png (1 KB, 148x29)
1 KB
1 KB PNG
>>102402367
anon.....



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