[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: 45 8000 52125788.png (291 KB, 500x500)
291 KB
291 KB PNG
What are you working on /g/?
Old:>>101194591
>>
>>101220992
I made a diffusion model from scratch in javascript and used paintings I made to train it.
>>
>>101221056
very nice
>>
File: 1714443538650131.png (198 KB, 545x530)
198 KB
198 KB PNG
>>101221056
Inputing fruits and getting gems?
>>
>>101220994
Wasn't the main points of ElectronJS it being cross platforms?
I tried the arduino ide on linux, the .deb version was unusable,the .appimage oje was good, you should give it a shot
>>
>>101221381
consider Tauri?
>>
>>101221396
>forced to write the backend in Rust
No
>>
>I NEED a GUI
I can assure you that you do not, GUI's are irrelevant, so if for whatever reason you will make one, just use Python and Tkinter, it's literally a 5 minute job to wrap any actual real usable program in the unusable GUI.
>>
File: m.png (198 KB, 343x309)
198 KB
198 KB PNG
!
>>
>Notified that a breach happened at one of the services I use
>Personal data on "dark web" including email
>Begin getting phishing emails written in a brown language
Like clockwork.
>>
>>101221056
What did papers/books did you use as references?
>>
>>101221489
Sorry anon but I wanna click buttons.
>>
>unnamed classes
you mean anonymous classes? ive been using that shit forever
>>
>>101221865
I watched a youtube video by 3blue1brown, about neural networks, and then I heard this about a week ago and made a new one to try out their method.
https://youtu.be/zc5NTeJbk-k
I don't mostly read because my eyes are bad. By proxy, whatever they referenced I think would be the foundational work to mine.
>>
File: IMG_20240701_020525_460.jpg (120 KB, 1280x700)
120 KB
120 KB JPG
>>101221489
Can you write an app that has a gridview images gallery with fluent ui style i can do that very quickly with WinUI 3
>>
>>101221947
Java was alway late when it come to adopting new features, one of my acquaintance told me that Java implementation of functional programming is horrible
>>
>>101222009
https://files.catbox.moe/uvx5op.webm
>>
File: GIIjY-OaQAAqcFM.png (770 KB, 927x1200)
770 KB
770 KB PNG
>>101222099
BMO my beloved
>>
File: 240630-191535.png (3.01 MB, 1717x1079)
3.01 MB
3.01 MB PNG
>>101222009
i wrote my own booru viewer with 4 different gallery display options
simple grids are inefficient for space usage so i made my own packing mode that always fills up 100% width
>>
>>101220992
I want to understand how computers work starting at the point where hardware meets software, so I thought about learning assembly. How do I approach this topic (what's the roadmap) and what books do I read?
>>
>>101222230
>starting at the point where hardware meets software, so I thought about learning assembly.
https://www.nand2tetris.org/
>>
>>101222230
nothing is real
>>
File: 20210509_071625.jpg (307 KB, 1000x1412)
307 KB
307 KB JPG
>>101222196
That actually nice, i'm planning to implement a gridview gallery as a part of my next webp project, is your viewer written in qt?
Also based touhou enjoyrer i lovr flandre
>>
>>101222339
objectively worse sister.
>>
>>101222151
I've never actually watched adventuer time, I just found that cover and pic comfy
>>
>>101222339
it's written in my own gui toolkit
>>
File: 1674919956882686.gif (502 KB, 758x614)
502 KB
502 KB GIF
>>101222361
Cuteness deserve forgiveness
>>101222373
It's for teenagers but it's a good show
>>101222381
Cool, sadly i'm not smart enough to write my own toolkit
>>
Any recommendations for a book on ML?
>>
>>101222526
WHY? just learn trig and make sure to do it for x11.
>>
>>101222684
machine learning silly :)
>>
>>101222697
>>101222657
kys, ML = meta language
fuck off with your llm shittery, pajeet
>>
>>101220992
How reliable are initial values on datasheets?
I'm pretty new to embedded systems. Idk why (inb4 autism), but I always find myself setting registers, for instance, to 0 even though their initial value is already listed as 0 "just in case". Hasn't really caused any problems yet, although I imagine that as my programs get bigger/more complex, I might want to abandon these sort of practices to save space/processing power. Honestly just curious. Thanks
>>
>>101223157
stupid post.
>>
>>101222230
Learn C, it directly controls the bare metal of the CPU (literally made of metal) with no layers of abstraction above that like so-called high level lenaugages
>>
>>101223663
>with no layers of abstraction above that
>>
>>101223663
Can't tell if shitposting or not.
>>
File: untitled.webm (3.61 MB, 1406x578)
3.61 MB
3.61 MB WEBM
My doujin gui has full basic functionality! It can catalog, and it can search. Happy days and jubilation. I've still got a lot of polishing to do though, and some more features I wanna add, but it's 4:30am so that can wait for another day
>>
>>101222009
this looks like shit and I can't figure out an usecase for this
>>
>>101220992
what's the point of using a java newer than 8? it has javafx and it's still getting updates.
>>
>>101224129
not being a retarded luddite to start
>>
>>101224140
>use the new thing because... humm.... just use it!
>>
>>101224164
yes
>>
>>101218180
After being unable to call any methods from the library I installed and looking into it some more, I've found out that PowerShell actually doesn't support packages that aren't specifically designed for it. So now I have to drop PowerShell and learn... what is that, C#? I have to dabble in C# to make the program I want
>>
File: file.png (59 KB, 793x524)
59 KB
59 KB PNG
really starting to like std::expected
>>
>>101224358
auto parse_number(std::string_view& str) -> std::expected<double, parse_error>

I don't understand why people started using this retarded "auto ->" synthax instead of just specifying the return type.
>>
>>101224394
>I don't understand
because you're retarded
>>
>>101224401
eat my ass
>>
Some thoughts I want to share:

1) Currently I'm working on an application with a very limited scope. It literally just does CRUD operations on 3 fields in the database. Yet I've been working on it heavily for 11 days now. There's simply more and more to tweak and polish, more features to add around the operations, new ideas. So my advice is to do this, decide on a small set of features and make the best interface for it.

2) Whenever I have thoughts about if I should add or change something I usually disregard them, but turns out they always come back again, I'm bound to implement these ideas. And I discovered that allowing these ideas to be implemented purifies the code as it gets more refactored to accommodate the changes. My advice is to implement as much stuff as you can, your code will get better.

3) Don't succumb to the remove-features demon, which I think stems from some combination of laziness and fright. It's easy to say "you know what fuck this feature, and this one too". Don't throw effort way unless it really makes sense.
>>
File: file.png (34 KB, 1014x263)
34 KB
34 KB PNG
>>101224394
i like knowing what the function does before what it returns

>passing string_view by reference
why tho, pic related
>>
>>101224129
Actually usable HTTPClient from the JDK.
Virtual threads.
Multiline string blocks.
Async futures.
Improved garbage collector.
(Eventually) Valhalla.
(Probably never) String interpolation.
>>
>>101224394
trailing return type is easier to see since it's always at the end, it also looks nice in general
>>
>>101224129
the support will end eventually
>>
I literally can't code anymore. I think 'oh I should do x' and I can't even bring myself to open a terminal.
>>
>>101211470
No it isn't. Symbols have a different psychological effect to words. Not only are they generally larger and more complex than symbols, they have far more verbal and semantic implications perceived by reading them.
>>101211828
Arguing over measurements on construction documents is not relevant to what I'm talking about, and less ideology does not mean no principled arguments occur. Nor was I saying that such ideology cannot happen when programming more with symbols.
My point was that the more you program by exploiting human language, the more you are liable to create and fall prey to such ideology. This is why "clean code" was pioneered by enterprise and OOP people that program in languages most closely approximate to human language. You see a direct, inverse relationship between the dynamism of a programmer's ideas and their commitment to arbitrarily structured programming languages, especially those designed to bridge the gap between programming and traditional methods of communication.
Java and OOP langs, lisp and other languages based on Church's work, even APL through the domain specific knowledge cope - these languages all come to mind as such programming brainrot, but "natural language" analogues in particular are the worst.
>>
>>101224993
Well what's your problem?
Is it that you're too busy whining about how you can't code on the internet? Nobody's going to do it for you, get on it.
Telling yourself you can't do it is what reifies it in your mind, so just stop being a faggot and actually think about where to start, then start.
>>
File: file.png (58 KB, 954x262)
58 KB
58 KB PNG
yup, we going all in with C++23. libc++ is being a bitch though for some reason
>>
>>101225211
so this is how rustrannies are trying to sabotage C++
>>
You know what would be cool? A tool that would let you search a codebase for member variables by offset. Frequently idiots will corrupt memory, and I'll be able to identify from the crash dump that e.g. some already freed block or whatever was written to at such and such an offset. If I could paste this offset into a tool and get back a list of all variables that are at that offset from their given "this" pointer, it'd be much easier to find the culprits of these kinds of bugs.
>>
>>101224443
What's with all the strings? Just return the error code itself and get the string only when you actually want/need to display it.
>>
File: file.png (144 KB, 742x713)
144 KB
144 KB PNG
Made a Brownian motion simulator today, but instead of little particles it uses coloured noise the RBG value as a little vector - then averages the internal vectors. It only use two colour channels cos it's 2D, but it would be fun to try and do a 3D one. Also, might try using different types of noise so it doesn't look so fucking ugly.
>>
>>101220992
Go, C, Haskell!
>>
>>101226105
yeah, if only debuggers could do this
>>
>>101223921
>switches to qt
>wins in one day
yep.
>>
>>101220992
figuring how to write to cgram and do my words with that because i think firmware on my thing might be gay (for some reason after writing ascii codes in memory my lines are showing up as full blocks)
>>
>>101223157
It depends on two things: what probability of a botched initialization is acceptable for your use case and where you get your hardware. Some vendors are more responsible and erratalicious, others are chaotic motherfuckers who lie in their docs, change internal revisions when you least expect it, and generally have to be nannied all the time. Even with sane and respectable vendors you always have a chance to encounter a partially broken chip. This chance, by the way, is empirically known to be noticeably higher if you buy from what they sell to DIY amateurs. Big corpos are known to despise DIY people. What are DIY people going to do if you sell them chips that failed some subset of the tests, cry to their mommies?
>>
>>101227176
>if you sell them chips that failed a subset of the tests
>chips failed tests
are they not legally liable for this?
>>
>>101227242
Chinks are scumbags and liars. They simply do not care.
>>
>>101224834
Leading return type is easier to see since it's always at the beginning, it also looks nice in general
>>
>>101227265
>>101224834
A little while ago, I changed my C function declaration style to
static struct thingy *
my_longish_function_name(struct whatever *w)

Honestly best of both worlds, ignoring how it looks a little weird if it's all really short.
int
main()
>>
>>101227259
>selling potentially dangerous faulty hardware to the citizens and then not compensating the citizens for the damages.
the US might just care.
>>
>>101227341
long function names make the code unreadable and untypeable, plus you are wasting lines.
>>
>>101224095
This is a basic and quick implementation, i'll do something bigger with it but i need learn more about winui3, still python sucks for ui development
>>
>>101227490
>long function names make the code unreadable and untypeable
Functions names and their lengths are a fine art worthy of their own discussion, but nobody asked, so I'm not going to get into it.
>wasting lines
Lines are not a limited resource. Sometimes I even use lines that don't have anything on them at all!
>>
File: output.png (666 KB, 1024x768)
666 KB
666 KB PNG
>>101214416
>looks better now
>what about letter spacing?
this is one deep rabbithole
>>
>>101227602
Are you using harfbuzz for that?
>>
>>101227602
must be sad to be so stupid ad to call everything a deep rabbithole and never discuss it
it is almosta s if we have all the time in the world here.
>>
>>101227623
just freetype2, altho ldd shows harfbuzz as a dependency
>>
>>101227490
>unreadable and untypeable
maybe if you're using camel case, but long names are perfectly readable in snake case.
>>
>>101227698
There is a weird circular dependency going on between the two. I think they were originally the same project.
harfbuzz does text shaping, i.e. laying out the characters in a good way, and I think it can do ligatures too (e.g. ff).
It's particularly relevant when doing non-English text.
>>
>>101227341
This doesn't work if you use many prefixes or a template - trailing return type does.
Also, it's very ugly, and I don't like looking at it
>>
>>101227265
With templates or some prefixes, that's not true.
>>
>>101227888
>if you use many prefixes
Why?
>template
I'm not a sepples shitter, but why would that have anything to do with it either? Just put it above
[[std::boost::templateFactory::iteratorCreate_t::disable_if]]
template <typename sepplesslop>
static register
org::java::sun::MyClassFactoryBean::SepplesTotallyIsBetterThanJavaISwear::getFactoryBean()

or whatever.

The style I was talking about is used (but not consistently) in the Linux kernel, at least in the parts I've been reading.
>>
>>101225227
I see they've been adopting Microsoft's old EEE strategy, yup.
>>
>>101227974
>SepplesTotallyIsBetterThanJavaISwear
Javatard detected, opinion rejected
>>
>>101227602
hmm, looks like my text rendering doesn't match any of these methods (also i don't think "single spacing" works for small font sizes)
the most problematic rendering on your old picture was the ":" which looked strange with no spacing, how does it look with your current methods now?
>>
>>101227480
when has the US ever cared about people doing that
>>
>>101227974
Or you could use trailing return types and it would be both easier to read and prettier, lovely.
>>
>>101226655
Yeah it's much nicer to work with. Honestly a lot of it just comes from the fact that I don't feel the need to jerry rig everything to make it work the way I want to.
>>
>>101228410
retard
>>
>>101228410
It wouldn’t be either easier to read nor prettier.
>>
Do any programming languages have elegant solutions for the following usage?

#include <iostream>
#include <string>
#include <vector>

int increment(int v) {
return v + 1;
}

int decrement(int v) {
return v - 1;
}

using func_call = int(*)(int);

void pretty_print(std::string ornament, func_call fn) {
std::cout << ornament << ' ' << fn << '\n';
}

int main()
{
std::vector<int> v {1, 2, 3, 4};

// pseudo-code
v.map(pretty_print("incr", increment(/*pass v elements here*/)));
v.map(pretty_print("decr", decrement(/*pass v elements here*/)));

// or
v.map.increment().pretty_print("incr");
v.map.decrement().pretty_print("decr");
}


https://wandbox.org/permlink/7XHWnjazvQWNDAIs

The idea is to be able to run contents of a container through some mutation and then print the result with some ornamentation.

Esthetically, I prefer this declarative/pipe style over raw loops, but I feel like C-like languages don't have a first-class support for that. Am I mistaken? Any languages that encourage you to write code in this way?
>>
>>101228748
Yes
>>
Lads, should I get a vintage computer to code shit on for shits and giggles?
If so, what?
I have a powermac g4 but I haven't used it in ages and I think I fucked it up (or at least, I wiped its hard drive)
>>
>>101221947
>>101222092
unnamed classes are not the same as anonymous classes. anonymous classes already existed and are not new in object oriented programming. unnamed classes are really just shorthand for an application specific class so that for basic programs you can skip writing an "Application" class, instantiating it in main and calling its main method. It pretty much reduces boiler plate for simple programs, but "enterprise" code is always going to do things the Java way for extensibility, testability and maintainability.
>>
>>101223921
can you please record and share with us when you show this off in a job interview? i'll send you some doggycoins in return
>>
>>101228823
no its a waste of time space and money. if you want to code for different architectures and resource constraints, use a virtual machine or emulator, unless you have a real project you're preparing for
>>
>>101228823
you should because the multiprocessor spec saved programming but then it was deprecated
>>
>>101228746
It is both easier and prettier.
>>
>std::execution, std::linalg, and std::rcu will be in c++26
lmao
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r9.html
>>
>>101228791
Care to elaborate, anon?
>>
>>101229981
linalg/rcu are old news
also linalg will be in c++30 in practical implementation terms
MSVC hasn't even finished 23
>>
>>101230529
>singling out MSVC
How is import std; looking in GCC or Clang?
>>
>>101230930
>it's missing half the functionality but you can use slightly different syntax
>>
>>101230977
>import is just slightly different syntax
Opinion disregarded.
>>
>>101231000
import std.generator;
import std.flatset;
>>
>>101230529
i see they passed plenary unanimously last year or earlier but was news to me

compiler support is looking ultra cringe
https://en.cppreference.com/w/cpp/compiler_support/23
https://en.cppreference.com/w/cpp/compiler_support/26
>>
>>101231054
yikearooni
>>
The amount of mental overhead in OOP is insane and I'm sick of working this way.
>>
>>101231039
>import
what is this, D?
>>
>>101231820
>the amount of mEntal overhead
*the amount of getEntal() != null ? getEntal() : throw new NullEntalException() overhead
>>
>>101231820
Just abstract the mental overhead away?
>>
>>101231820
rust doesn't have this problem
>>
>>101231000
yes, it's fundamentally just a syntax change, and considering that precompiled headers actually improve compile times without requiring a fucking server just to track modules, that will never change.
>>
File: 1642150339901.jpg (95 KB, 1024x681)
95 KB
95 KB JPG
Anyone well versed in relational database modeling can explain to me this meme?
Let's say we have 2 tables, maintable and niggertable.
They have a n-n relationship (off to a good start I know).
Both have a primary key "main_id" and "nigger_id".
Maintable has a "nigger_id" foreign key.
Niggertable has "niggertype" and "niggerlabel" fields.
To query a relation with niggertable you'd use "nigger_id" and FILTER by "niggertype".
Like so :
SELECT m.main_id, n1.niggerlabel, n2.niggerlabel, n3.niggerlabel
FROM maintable m
LEFT JOIN niggertable n1 ON
m.nigger_id = n1.nigger_id
AND n1.niggertype = 1
LEFT JOIN niggertable n2 ON
m.nigger_id = n2.nigger_id
AND n2.niggertype = 2
LEFT JOIN niggertable n3 ON
m.nigger_id = n3.nigger_id
AND n3.niggertype = 3

Why would you not just make tables for each entity? Does it have any benefit I'm missing? Wouldn't that impede queries perf from using a relationship with an obese table every time?
It makes things so painfully complicated to find what you need or understand what you're looking at. I seriously do not understand that concept and dealt with it many times.
>>
>>101232474
do you mean an entire table for every row?
>>
>>101232505
Ha, my explanation wasn't the best. Forgot an important element maybe :
Basically niggertable is a table that acts as multiple tables. You query the different sub tables by filtering niggertable with niggertype.
>>
File: file.png (93 KB, 1584x324)
93 KB
93 KB PNG
am I a retard for not getting eigen3 source code? Looks like gibberish to me. I just want to know how select works...
>>
>>101232558
eigen is overengineered template soup
>>
>>101232680
this, but also
>>101232558
yes, you are
>>
urn_set = set()
for i in range(20):
response = requests.get(url, cookies=cookies, headers=headers,)
if response.status_code == 200:
json = response.json()
for included in json["included"]:
if included.get("trackingUrn"):
tracking_urn = included.get("trackingUrn")
tracking_urn_array = tracking_urn.split(":")
tracking_urn_array[2] = f"fsd_{tracking_urn_array[2]}"
urn_set.add(":".join(tracking_urn_array))

all_jobs = []

for urn in urn_set:
response = requests.get(other_url, cookies=cookies, headers=headers)
if response.status_code == 200:
json = response.json()
if not json["data"].get("errors"):
all_jobs.append(json["included"])

all_urls = set()

for job_data in all_jobs:
for job_data_array in job_data:
if job_data_array.get("companyApplyUrl"):
all_urls.add(job_data_array.get("companyApplyUrl"))

print(all_urls)
print(len(all_urls))


This only gives at most 30 jobs, is there a better way to scrape linkedin of apply urls?
>>
File: 1551449354848.jpg (61 KB, 500x597)
61 KB
61 KB JPG
>>101232505
>>101232551
Also no you wouldn't have an entire table for each row. The catch is if you want to query different "niggerlabels" you call the same table multiple times.
"niggerlabel" is a field that has multiple definitions and is VARCHAR (usually). It can be a rap album, gun name, HIV status, chicken restaurant address or whatever the fuck. The definition depends on how you filter it with "niggertype" (usually an int because why not make things even more aids).
Idk it's so fucking stupid and it triggers the hell out of my autism. But I've seen it in application multiple times and wondering if I'm missing something or people are just retarded in this field.
>>
>>101232474
>>101232551
I'd be more certain if you told us real names of tables and fields, but if I get your ramblings right, it's for when you don't want to change the structure of your db every time new niggertypes appear.
>Wouldn't that impede queries perf
Maybe speed was less important than versatility. Or if you have nothing better to do you can trade space for versatility and keep both the big nigger and small subniggers as materialized views, lmao.
>>
File: 1644163617967.jpg (54 KB, 720x720)
54 KB
54 KB JPG
>>101232826
>I'd be more certain if you told us real names of tables and fields
No way lol. It wouldn't change anything anyway. The query should be enough to understand what's going on.
I think it's called a reference table and is a result of terrible normalization. I need to read more about database architecture.
>>
switch(int)
case 000: return "Cap";
case 00: return "Exp";
case 0: return "Level";
is a fucking duplicate case in java cool language not
>>
File: bloat.png (59 KB, 925x737)
59 KB
59 KB PNG
fucking bloat
>>
>>101233987
you will use the monads and you will like it
>>
>>101232474
Yes, you want:
main: id (PK id)
nigger1: main_id, label1 (PK main_id, label1)
nigger2: main_id, label2 (PK main_id, label2)
nigger3: main_id, label3 (PK main_id, label3)
This allows you to have 0-* labels of each type for each nigger. If you need 0-1 labels per type you drop the label out of the composite PK.

Now, if you could have infinite nigger types.
main: id (PK id)
niggertype: main_id, nigger_type (PK id, nigger_type)
niggerlabels: nigger_type, nigger_label (PK nigger_type, nigger_label)

And the obese table isn't that bad, just put an index on niggertype, it's an int.
>>
>>101234083
>muh type science
kek, retarded niggers man

everything is an integer, deal with it.

>trannybannie page
>>
why does this not work in powershell? It comes up with an error. $user_data is a hashtable
Get-ADUser -Filter {UserPrincipalName -eq $($user_data["email"])} 


but when I do this it works fine, weird behaviour
$email = $user_data["email"]
Get-ADUser -Filter {UserPrincipalName -eq $email}
>>
>>101220992
This but C++

>>101229981
Execution will be one of the best things to happen to C++. The current async features just suck ass, std::jthread is okay, I have never encountered a case where coroutines were a better solution than anything else. They might as well remove async/future/promise at this point. Cancellation is a must for a lot of stuff I work on, so jthread and stop_token is nice, but they don't necessarily work well with cancellation at the OS level, because it's not an OS object, just an atomic flag. I'm glad that they're thinking about cancellation from the start here.
>>
>>101234573
why is it that instead of doing all of this nonsense you faggots dont just write your own wrappers to different OSs system calls?
I highly doubt std::nigthread or whatever the fuck is supported on all compilers.
>>
>>101234573
faggot opinion
good primitives >>>>>>>> half baked frameworks
>>
>>101234615
>wants threading to be baked into the language
write java.
>>
>>101234700
i want shit like semaphores and atomics
>>
>>101234710
those dont work in real life, write better code.
>>
>>101234751
fak u bastard bloody
>>
>>101234751
not him, but do you actually believe that semaphores and atomic operations "don't work" in real life?
>>
STM for concurrency!
Yay Haskell!
>>
>>101234788
hasklel does also have mvars
>>
>>101234603
It's supported by MSVC and GCC. I don't mind writing my own wrappers, I've done it, but it becomes a pain just supporting Windows and Linux. It's hard to find a balance between having the minimal possible interface, while also taking advantage of OS features. You also have to design with zero overhead in mind.

The idea of what a system resource should be is also wildly different between Windows and POSIX. "Everything is a file descriptor" might be the billion dollar mistake. I think Linux realizes how stupid that is because you can treat signals as file descriptors now.
>>
>>101234779
yes, i have not found once a moment in userspace where i could write threaded code without each thread having tls and its own buffers.
I can into pipes, but that is only pipes, atomics are useless because you want at least two operations to do anything of value on an address and the stuff only lasts one cycle which means it is useless for queueing shared memory in the first place so i dont even want to get into how stupid LOCK# is... just atrocious

Maybe from a high level language you dont get it but two processes running the same code that cant interrupt each other INSTANTLY will always conflict.
>>
*processors
>>
>>101231820
you're doing it wrong
OOP unloads complexity by grouping logic into tiny scopes so you can easily work on large codebases with just a few neurons
>>
>>101235061
tsmt
>>
>>101235061
*OOP hides complexity never really addressing it but allowing it to pile up
>>
>>101235061
and yet without fail, every single time you scale POO up, it does not go well
>>
>>101235061
every boundary and every hierarchy has a cost
>>
>>101235061
Unload that complexity onto your type system and compiler instead
>>
>>101235106
skill issue - write better code and it'll scale marvelously every time
>>
>>101235080
maybe you should be thinking before writing code.
You always go top to down, or at least start from as high as you can and then look higher if you can once in a while.
>>
>>101233336
>gives 3 cases
>they are literally the same value
>gets mad at the language
>>
>>101235177
>FAGMAN can't do it
>no AAA game company can do it
>FOSStards can't do it
>webdevs can't do it
Gee, this really reminds me of the mythical C programmer who writes perfect bug-free code.
OOP is amazing, and yet only the 0.1% can actually harness its power, even though it was made for the 99%
>>
>>101235249
oop is really good, honestly you are just babyducking.
>>
>>101235269
>honestly you are just babyducking.
I've tried virtually every paradigm across many mainstream, obscure, eso, and meme langs.
I am the farthest thing from a baby duck.
>>
>>101235284
>i am not that side of the coin! i am the one that knows how to print hello world in 30 languages!!!
>>
>>101235308
If it's not in English it's not Hello World
>>
>>101235328
... reminder this is a programming thread, >>>/g/twg is that (<-) way.
>>
>>101235353
And I'm a pro grammer
>>
>>101235363
you are underage and phonefagging
>>
>>101235397
I've been in /dpt/ longer than you
>>
>>101235177
any examples?
>>
>>101235508
i just deleted 200 lines of methods because i scaled up and they become obsolete, not even joking.
Gonna rewrite them tomorrow, its going to be 200 better lines and some wrappers, no biggie.
Cniles cant into this though.
>>
>>101235604
any examples of real-world undertakings that scaled nicely because of OOP, little brother?
>>
OOP is a bad dude. Haskell has literally won and I don't know why people are in denial.
>>
>>101235641
mem/ and sched/ survived the userspace calls layer.
>>
>>101235604
The definition of OOP has become so vague and twisted that faggots like you go on about how "types and functions related to that type" is classed as "OOP", or it even boils down to language syntax features rather than anything fundamental. Even the most basic of procedural-style of C code can meet the definition.
You can't even argue with you fags because you'll strawman everything or change the definition of OOP to suit you in that very moment.
>>
>>101235769
Cnileposter is the guy who adopts the least defensible position on every topic just to annoy people.
>>
>>101235769
>>101235797
mindbroken.

Oh well, OOP means that small functions that are not accessible by all of the code are accessible through interface (public) functions.
Also that the only global function is main.
>>
>>101235849
static
>>
>>101235849
There they go again, making up definitions. They didn't even include the word "object".

Also, C translation units are OOP by the way.
>>
>>101235895
what i said means the fuctions can only be called through objects retard

honestly, what you just said is so stupid you dont need to reply again.
>>
>>101235849
any examples of real-world undertakings that scaled nicely because of OOP?
>>
>>101235933
There we go with another definition change, bringing it back to basing it purely off of language syntax features.
>>
>Also, C translation units are OOP by the way.
Fuck off, retard

Can we please stop replying to baiting niggers?
>>
>>101236030
It meets the definition presented, fuckface.
>>
so far the only defence of OOP in this thread is by a lolcow who just says whatever is dumbest
>>
>>101236208
boomer oop defeners are the same way
>>
File: learned and Diff.gif (754 KB, 612x448)
754 KB
754 KB GIF
>>101221056
I started over with a larger network capacity, this time I'm recording the network as it goes so I can play back the progress. Here's the first 15 hours. Top is what it puts out for the training inputs, bottom is the difference between each step.
>>
>>101234797
atomicModifyIORef can be enough. I've only used stm a handful of times and I think it was always someone else's decision.
>>
AI is now better than American and Indian programmers.
>>
>>101236471
>AI
>American Indian
AIEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>101236471
Where can I see some indian code?
>>
>>101236484
>>101236488
Americans and Indians are basically the same in terms of skill. So, just look it up on github.
>>
>>101236488
jeets dont write any code, they only steal.
>>
>>101236208
>COME ARGUE WITH ME
>PLEASE WHITE MAN SIR ARGUE WITH ME
lol no
>>
Concurrency with c fork() is inside out compared Control. Concurrent.forkIO. Saving state across reloads with https://hackage.haskell.org/package/rapid-0.1.5.3/docs/Rapid.html has the same confusion. The property that's missing from both cases is that one line of code shouldn't execute in two different contexts.
>>
>>101234788
I thought transactional memory was a dead meme.
>>
File: stm.png (11 KB, 368x248)
11 KB
11 KB PNG
>>101236588
You don't really need it.
>>
>>101220992
>Pajeets pirate all of Western textbooks
>Scam way in to the West
>Only hire their own
>Jews notice
>>
>>101235508
no, because there's no problem complex enough for a cnile to understand at all but simple enough for a cnile not to bitch how "OOP is unneeded" because he will mind-map the whole implementation
and i don't feel like lecturing how to do problem solving in OOP
>>
>>101226508
You're not being ironic right? Because I don't think such a feature exists.
>>
FP is a meme and will always remain a meme because it's a poor model for how computers work compared to procedural programs
>>
>>101236615
I'm just wondering how they do it. Does the IO monad protect them from doing stm when waiting on IO?
>>
>>101236954
inb4 something related to Lisp machines comes up.
>>
>>101236965
The STM monad models sequences of IO actions.
IO (State# RealWorld -> (# State# RealWorld, a #))
STM (State# RealWorld -> (# State# RealWorld, a #))

It's the plumbing so you don't go doing multiple IO by yourself.
>>
>>101237052
Makes sense. Sounds like a dog though. I'll have to investigate Haskell stm sometime because the idea always sounded nice but the practicality of it always seemed memey with any io and then you get into nitpicky shit like isolation of transactions being unsound for general purpose programming, etc.
>>
>>101237052
if anyone wanted to remember all of that nonsense they'd write assembly.
>>
>>101236675
>no
surprise
>>
>>101236954
You're out of touch with the codepoints unless you type them in binary.
>>
File: maxresdefault.jpg (54 KB, 1280x720)
54 KB
54 KB JPG
>>101225211
>>
>>101236939
it do
>>
>>101236965
Is the question backwards? atomically :: STM a -> IO a will undo/retry reads and writes. IO a -> STM a is unsafe because there's no way to unlaunch the missiles.
>>
File: docker ps.png (18 KB, 1920x198)
18 KB
18 KB PNG
im not familiar with docker at all. but these containers running on this machine have python scripts in them. how do i extract the contents of these containers?
i read some stuff about commits, and volumes. i'm probably going to just sit down and try and figure it out but people use docker containers for development, so there's obviously a way to access the code inside.
>>
>c++
>define a function that takes an int as an argument and returns the factorial of the argument

this is just a programming exercises in a book im reading but it's been nearly 2 weeks and i still can't think of a way to properly do this. i'll never be a programmer, fuck why i am so fucking retarded
>>
>>101236939
sarcastic*
>>
>>101237953
Nobody can tell you anything if you don't say what you're actually having problems with.
>>
>>101222230
https://shop.elsevier.com/books/computer-organization-and-design-arm-edition/patterson/978-0-12-801733-3
>>
>>101237334
>>101237959
What debugger/feature are you talking about then? I have not seen that capability before.
>>
>>101235247
not the same value if it's an id
>>
>>101237953
Do you know what a factorial is? Do you know what a loop is? Do you know what a variable is? That's all there is to that problem.
>>
>>101221396
Stop shilling rust. It hasn't happened for your shitty off brand c like in 10 years. It's not going to happen in another 100
>>
File: fruit11xz.gif (1.28 MB, 832x448)
1.28 MB
1.28 MB GIF
>>101236430
I figured out my weights were set too high, got a much faster cleaner result.
>>
writing a little emacs package to generates documentation. it uses the treesit package to parse the source code.
>>
>>101239706
It will suck, like all generated documentation does
>>
>>101239706
can't you just... write the documentation?
This is really important you know.
>>
File: 1707850418642116.jpg (51 KB, 638x739)
51 KB
51 KB JPG
alignas(struct cmsghdr) unsigned char aux_buf[CMSG_SPACE(sizeof(int[255]))];

I always forget how weird the CMSG API is every time I have to use it.
If only flexible array members were a thing back then...
>>
>>101220992
Can we get a goto command?
>>
Ooooh talking about anonymous classes in java can we parse those with a lambda?
>>
Oooh also for java.. Can we have any name for our java file that doesn't align with the name? But also can we have no restriction on the file being required to start without a number?
>>
Anynone know of languages with something like Nim's converters?
>>
Added a result preview and the ability to open doujins directly from it.
>>
why every "rewrite it in rust" project is just a new version of an old cli application instead of rewriting C libraries that most Rust code is dependant on?
>>
File: 03487.jpg (23 KB, 360x143)
23 KB
23 KB JPG
>>101220992
good morning sirs, who wants to be top Java programmer for only 3.5UDS (299rupee)?
>>
>>101241287
>Why do easy thing
>Why not do hard thing
>>
>>101241287
Every project I've seen actually try to do that has failed.
>>
>>101241295
Every publicly traded western company
>>
>>101220992
I'm doing some compiler hacking and am dealing with a really tedious problem, only solution i have is O(n^2) and wondered if theres something better I could do

I'm trying to find loads and stores that access the same stack slot, which in LLVM means you have instruction objects with a frame index attached. Matching loads/stores just mean they have the same frame index. Problem is, some instructions in arm like LDP access two addresses at once, so they have two frame indexes. This opens corner cases where you match a load and store together that only share one frame index but not all of them. So originally I just wanted to map frame indexes to a list of instruction objects but now you end up with the same instruction in multiple lists, and cross-checking is really tedious.

Idea I've settled on is just for each instruction checking every other instruction and comparing all of their frame indexes at once. Can anyone here do better than that?
>>
>>101241296
rewriting a library might actually get people to use your code though and that's what these people are after, e-fame.
>>
>>101241621
Yeah, that's why they all rush for some easy shit and also only do 10-20% of it most of the time as well. Contrary to Rustnigger posters, they are not more competent so they fail to implement the hard stuff that has been done in C
>>
Anyone else starting to use LLM a lot? I've been working with Claude 3.5 for the last few days and I'm blown away and how fast I can iterate on things I've been struggling with for weeks.
It's very good to iterate on shaders for example, I love it.
>>
it all keeps coming back to APL
>>
File: traits.png (2 KB, 320x71)
2 KB
2 KB PNG
does this smell
>>
>>101242577
yes
>>
>>101220992
this.descriptions[this.descriptions[dir]->children[g]]

yep, it is c++ time.
>>
File: offset-strip-fin.jpg (10 KB, 306x165)
10 KB
10 KB JPG
>>101242237
It doesn't lose the train of thought after multiple suggestions as
easily, but I still finished the fullcontrol.xyz function for picrel
myself.
>>
>>101241287
Which C libraries? Any of the ones left are too big to rewrite and actively being worked on.

RIIR is useful and I've done it for some niche applications because C code rots really badly with compiler versions or wasn't able to be easily compiled cross-platform
>>
>>101242717
>RIIR is useful
>>
File: fixed.png (4 KB, 418x92)
4 KB
4 KB PNG
>>101242618
why fix it when you can febreze it?
>>
An extension for lite xl embedding quickjs to provide an emulation layer for vscode extensions.
>>
>>101242971
Got anything working yet?
>>
>>101242971
>vscode extensions
there's nothing of value
>>
Does C++ enforce classes that are doing polimorphism to be the same size in memory?
>>
>>101236488
jeets code just fine, the biggest problem is that they don’t know how to QA their own work. Like, just run it in the fucking browser while you are coding it and look at what changes…they can’t into doing that so instead they just submit PRs that are still broken.
>>
>>101243264
How could they enforce that when dynamic arrays are a thing? Not to mention everything else that could change in size
>>
>>101243351
an array of pointers to the structures?
since it is the same i am just going to ugabuga bigbyte increases
>>
File: file.png (698 KB, 800x600)
698 KB
698 KB PNG
I acquired some rat neurons and I'm trying to make a sensor system using them and arduino as the interface, I want to keep logs containing all the sensing data and I need to very quickly be able to search this data and get the relevant bits, we are talking thousands of thousands of lines of text, do I actually need mongodb if I will be using elasticsearch?
>>
>>101242757
Concession<Accepted>
>>
>>101243433
Just because you are right doesn't mean I'm wrong, retard.
>>
so many low level C++ and Rust chads here.

It's kinda intimidating (oh fuck)

Python slop in my brain for 7 years... bros?
>>
File: firefox_eWgorRNvsW.png (45 KB, 495x432)
45 KB
45 KB PNG
>>101243433
This is not the own you think it is
>>101243440
Why are you impersonating me? I'm not wrong, RIIR is bad.
>>
File: 1715521034550509.jpg (71 KB, 647x594)
71 KB
71 KB JPG
>>101243428
>I acquired some rat neurons
what the FUCK
>>
>>101243473
nta, but im guessing he got the lab bred ones, so no rats were harmed
>>
will rust cultists get mad if I rewrite their apps in C/C++
>>
>>101243473
>>101243498
OP here, yeah I dissected them lol
>>
>>101243498
still, HOW did he get his hand on lab rats and specifically their brain cells
>>
File: 1716407514921324.jpg (10 KB, 240x219)
10 KB
10 KB JPG
>>101243514
What kind of rats did you dissect?
>>
>>101243520
https://www.thermofisher.com/order/catalog/product/A1084001

>Bro is thinking this is some sci-fi shit
>>
>>101243533
He dissected them anon
>>
>>101243546
Well I hope he didn't waste all the good bits.
>>
>>101243500
Rewrite it in java so c, c++, c#, and rust cultists can get mad together
>>
>>101243564
>java
fuck off
>>
>>101243577
you are babyducking on executables
Virtual machines are the future.
>>
>>101243654
>>101243564
t. java cultist
>>
>>101243514
Dissection is a euphemism for vivisection here.
>>
>>101243654
>>101235604
Hello.
>>
File: output.png (126 KB, 1024x768)
126 KB
126 KB PNG
>>101228268
you're right it becomes w i d e at smaller sizes, for now i'll just add a special case for letters like : and cope

your text rendering looks clean and proportionate tho zundanon
>>
>>101224993
>I can't even bring myself to open a terminal.
Pfft. I can't bring myself to sit at my desk.
>>
>>101243887
are you doing this pixel by pixel or stringing together functions?
>>
>>101243887
does : look correct with kerning?
>your text rendering looks clean and proportionate tho zundanon
my text rendering actually doesn't use kerning, it uses single character advance since this lets me cache glyph metrics individually
>>
>>101224993
The terminal's sisyphusian horror is universal. It's not something you can run away from.
>>
>>101241287
>why x is y
this is the most endearing form of ESLism
>>
>>101244274
it's not. always a low iq latinx formulation
>>
>>101244293
Why anon bullies?
>>
>>101220992
In a project that is unironically pic related.
>>
>>101244274
>why is x y
really logical anon
>>
>>101244586
Why you speaks large bad english?
>>
>>101222196
I like your use of Haiku icons.
>>
>>101244442
Kek
>>
>>101241287
>>101244274
>>101244586
Allow me to explain!
Although modern English uses many words that come from French, Latin, Greek, or random other languages from all over the world, its core grammar is still inherited from Old Germanic, which was quite strict about making the verb the second component of the sentence and moving everything else around it. (The first such component could be an arbitrarily large phrase, like "the big red cat that eats goldfish." It didn't have to be a single word.) Modern English is nowhere near as strict with this "V2" rule (mostly because of adverbs) but when asking questions, you still have to move a verb to the second position.
And that's where OOP comes from!
>>
>>101245898
TLDR
>Why OOP Is Such A Bad Idea
good
>Why OOP Is Such A Bad Idea?
bad
>>
File: file.png (22 KB, 140x84)
22 KB
22 KB PNG
Can someone answer this? >>101243428

I'm in a similar situation.
>>
>>101246167
cheesed to grate you
>>
>>101246192
bad bot
>>
So you think you are smart, ugh???

If you sre so smart how would you code and ArrayList in c whixh is both dynamically resizable and saves Its elements as a data struct containing an enum specifying a datatype and a void pointer with the data?

Also fuck LinkedLists, linked lists are gay. And fuck hash functions too because hash functions are useless.
>>
>>101247838
implement it in C++ compile it and link it to C just to piss you off
>>
https://mpusz.github.io/mp-units/latest/blog/2024/07/02/report-from-the-st-louis-2024-iso-c-committee-meeting/
>affine spaces
>it's some gay unit shit and not general haskell math programming autism
aaaaaaaaaaaaaaaaaaah
>>
File: dates.png (3 KB, 101x122)
3 KB
3 KB PNG
>>101220992
I have a text file with 5000 lines, with a unique date on every line. I want to create a new file containing dates not included in the first file.

For example, the first file might have 2012-03-15 and 2012-03-17, so the second file should print the missing date 2012-03-16. Is there any easy method to do this, short of manually reading through a giant list?
>>
>>101248376
get dabbed on
>>
>>101248381
parser from seconds to date and you get the rest ...
>>
>>101248381
cat file1.txt file2.txt | sort > combined.txt
>>
>>101248507
cat f1.txt f2.txt | xargs sort $1 > comb.txt
Wouldn't It?
>>
>>101248654
>xargs
sort works on stdin, not its command line arguments.
>>
>>101248507
Apparently sort can accept multiple files so the cat would be unnecessary.
>>
>>101248507
That won't make a set difference.
>>
>>101248381
Generate a file containing every date from the first date to the last, then diff them. Ez
>>
>>101220992
>want to use vulkan video encoding in my program (on linux)
>oh, my amd gpu supports it now if i set RADV_PERFTEST=video_encode environment variable! I dont have to switch to my old nvidia gpu!
>vulkan video encoding crashes the computer everytime because the amd driver is broken
Too often. I regret buying amd, I should have continued with nvidia. Nvidia unironically works better than amd even on linux.
>>
>>101248796
sort -u
>>
File: file.png (21 KB, 585x345)
21 KB
21 KB PNG
>>101248381
If it's just a one off thing you can use google sheets to convert date to a day (set format to number) since 1899-12-30 and look for a gap. Then you won't have to worry about leap years, exceptions to leap years, exceptions to exceptions to leap years, etc.
>>
File: 907273.png (66 KB, 870x960)
66 KB
66 KB PNG
>tfw made first pull request
>>
>>101249197
congrats anon
>>
>>101247838
Sooooo, a resizable array of individually allocated elements? I mean, yeah, that's a thing.
>>
>>101249197
I fucking hate git but it's the most useful thing ever
>>
>>101249417
it's not great but life without it is 100x worse
>>
>>101249417
it's a shame shit things have to proliferate, but at least we're free of svn and cvs
>>
>>101249302
Yeah, and the elements can be either, floats, integers, pointers to chars, etc. I was thinking about the posibility of an array of pointers containing pointers to a structure containing a union and a datatype. I wonder if I can use a void* funtion pointer to that same struct and asign It on the "constructor" to a different funtion depemding on the datatype It must return, but a function pointer of type void* cannot point to a function returning a void* datatype, can It?

Am I too retarded for C, should I give up and try Go/C++/Rust instead? Which one is the most retard frenly?
>>
>>101249488
>returning a void* datatype
an (int*), (*float), whateverthefuck datatype.
>>
>>101249488
A resizable array of pointers to tagged unions? Why not just a resizable array of tagged unions? It would be pretty simple to make, about the same as any other array type except using the tagged union struct instead.
>>
>>101249417
it sucks but it sucks less than the alternatives
>>
>>101249828
>>101249828
>>101249828
New
>>
>>101249579
Like? How do I atach a tag to a ubion withojt putting the union onto a struct?
>>
>>101249500
That breakes stream isolation.
>>
>>101249871
Tf is that? Pls explain as if I was 5.
>>
>>101249859
You would do exactly that.
>>
>>101249579
Because I want to be able to make elements nullable. In order to avoid abusing realloc I want to increase the array by twice Its original size everytime, but keep some elements as null to make It seem as If It was smaller. Meybe I can save the size aside instead and making a check when attempting to acces a positon, idk.

How do I add some abstraction in order to be able to acces the union members as the type saved in a straigh forward way?
>>
File: 20240625_123613.jpg (313 KB, 1534x2048)
313 KB
313 KB JPG
I started uni 2 years ago with absolutely 0 knowledge of CS.
Now my favorite languages are c/c++ (I've only ever used Java aswell) and I feel okay with using them.
I'm also REALLY invested in computer graphics and I want to specialize on that + game developing (I'm kinda good with Godot and I've made several small projects there)
To recap I mainly want to do something with c/c++ for projects for github.
I was thinking either learning opengl and making some games, do some graphics stuff or make my own image processing library so I can do stuff like ASCII art or image effects ( I'm really intrigued by this so if you think it's a good and feasible project please encourage it). Also a text editor sounds fun
If you were me how would you go about it
I know I should just go ahead and do these things and just talking about them isn't helping but I'm in the middle of exams so I thought why not get my thoughts out
>>
>>101249978
You could include a None type in your tagged union to get nullability. However yes, the union will take up as much space as the largest union member.
To get the members you could just do if statements checking the tag (int or enum)
>>
>>101250170
Great to hear anon, computer graphics is an interesting field though I never really got into it properly myself.
ASCII art is a pretty good one, totally feasible in C or C++. You could make a mock of imagemagick to try and learn how to implement other image processing things, I'd recommend looking at it.
Other than that, best of luck with exams!
>>
File: sicp snake.png (27 KB, 666x768)
27 KB
27 KB PNG
>>
>>101222230
i took a malware analysis class and we disassembled old MS-DOS viruses and had to comment each line.
i found it interesting and a good way to learn assembly. since you're trying to figure out the function of the code. what does an int13h do? what does int21h do? etc.



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