Thread #108042427 | Image & Video Expansion | Click to Play
HomeIndexCatalogAll ThreadsNew ThreadReply
H
previous >>108012888
+Showing all 202 replies.
>>
>>108042427
stupid Osaka
>>
>>108042427
Funnier than any humour threads.
>>
I'm not procrastinating ha ha
>>
>>108042427
The little typo and fix with incorrect makes it that much better. I expected "incorrect" to be the password though.
>>
Are flowcharts a meme? My teachers say to make a flowchart but I still don't know the criteria they are looking for and I feel I'm wasting time instead of programming.
>>
>>108043073
it seems theyre trying to teach you how to work with paper
apparently they want you to draw flowcharts.
*shrug*

i write my shit from top-down
first a an outline of the general functionality of the program
then i expand on each functionality, separately
first a description, then pseudocode

working with paper is crucial because it allows you to offload information from your brain, onto paper
you odnt forget it, and you dont need to keep everything in your mind at once.
flowcharts are gay shit but working with paper is a very important skill
>>
>>108043073
Like most shit they teach you in school it's something you might need a few times in your life and when you do it, it's gonna be some ad-hoc system you develop yourself and not exactly what they taught you. But because school is school you have to learn the formal system that they can grade you on.
>>
>>108043121
>>108043203
Thank God it seems to be something abstract and not precise with rules set in stone.

Using flowcharts feels to me like decomposition in math, where they take a trick smart kids do and try to bureaucracy it and chug it to the NPCs and it doesn't work because it tries to transform something abstract into rules.
>>
>>108043073
lol dude are you living in india? or are you going to a trades college with an IT course? I'm fucking 32 and haven't used a flow shart in my god damn LIFE
>>
thoughts on this? is this true?
vb script is the most powerful language in the world
>>
>>108043257
Flowcharts are like 80's technical interview on a chalkboard type stuff
>>
>>108043340
making Or bitwise is mega-retarded but besides that it's exactly what you would expect.
>>
>>108043378
>exactly what you would expect
>case 1 OR 2 ' this only returns if the case is 3
this is exactly the opposite of what youd think it is
>>
>>108043392
https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/select-case-statement
scroll down to the Example and you will see that you don't use Or to do the thing
I know I know, reading the documentation? In the age of AI? Wow. Amazing. What a concept.
>>
>>108043446
nah even the AI said that you dont use OR
you do case 1, 2
its pretty cool that in the age of AI I can learn about something new by putting my mistakes into it. this is better than never making the misakes...
>>
>making public projects and adding them to my github
gotta remember not to litter shit with "print("nigger")" and "print("faggot")" now
>>
computer, count this. *pastes*
wasting electricity feels so good
>>
>>108043571
What are you trying to achieve anyway?
>>
if youre asking about my script then im not that nigger faggot printer
>>
Did Epstein use the same software as you do?
>>
File: Untitled.png (352.5 KB)
352.5 KB
352.5 KB PNG
>>108043571
Finally trying my hand at C++ again after 20 years.
There's not enough time in the day. I don't want to go to work tomorrow.

Visual Studio is missing so many features that VSCode have spoiled me with.
Document Outline
Go to end of word
Go to references
Display reference count
>>
>>108044286
You following handmade hero?
>>
>>108044299
Yeah, figured it was a decent way to learn the differences from C#, Lua, JS, TS, etc. and get started with the low level windows API
>>
And I got to learn that Steelseries' shitty Stratus XL controller doesn't even support XInput without installing their bloated SteelSeries GG 'everything' app.
>>
did you know that in vbscript a msgbox("") returns "1" to the script? this is useful is obfuscation because binary (as hex) + &1 (hex "1") can be math... I mean,
&h8 = 1000 in binary, and &h1 = 0001
vbscript fills in hex values at the right and creates trailing "0"s to fill it up
this means that you can:
make your binary, convert to hex. if the binary the hex converts back to starts with "0" then you can change it to "1" and convert it back to hex and go again... (obfuscates)
to get it back, you can do: varThingsinbracketsprocessfirstBTW = &[obfhex+1] ' I mean to say that it is your actual target hex
select case varThingsinbracketsprocessfirstBTW : case [&hex] AND hex(msgbox("returns 1"))
the above line (to the CPU) takes your obfuscated hex number and applies bitwise logic to it and then does a cmp to the select case, essentially making it cmp the hex value of the binary + 1000 (8 in hex) after returning it back to 0
I have done it in a var here because it is to use Mid([&hex], 4, 1) to get the first 4 values the first nibble

what I want to make it do now is I want to intercept the CPU cmp instruction and make it execute code, but there is DAP, but yeah
>>
it is more useful, though, to use
CreateObject("WScript.Shell").popup
with a timeout of 0 or 1 (idk which it can yet)

the popup function returns "-1" to the script. this is useful because you can use a var like:
switchVar = Array("-", "*") ' to add or multiply it
this is useful because using math it can do
[popup result] switchVar [popup result]
you can have setVar conditionally = "-" or "*" to make "1" (using * or multiply) or "0" (using - or subtract) using the negative number
>>
>>108044766
>>108044806
@grok summarize this
>>
popup = CreateObject("WScript.Shell").popup : popup (switchVar (popup))
switchVar = Array("-", "*") ' to add or multiply it

setting switchVar here (as a switch or select case) this can send "1" or "0"
>>
>>108040339
to be fair that's a bug on the javascript engine they're using. it shouldn't have kept the context even with arrow functions since they don't use any reference to this or init or options
>>
>>108042427
Is this how it feels using Rust?
https://www.youtube.com/watch?v=yAbtte_zZvQ
>when we were at war (with the Rust compiler)
>>
>>108044822
you can + &h8 to the (hex converted) binary, which changes the language! China has all those 1xxxx hex binary values of a string in binary (or some other reserved codes)
this obfuscates the code and I saw on an Eric Parker video that some people (in a vbscript) have put in a (string) poem to convert to binary so that if they reverse it themselves, they will read a poem - actually they encoded a poem in base64, but its the same thing. you would just not add a "1" in the 1st position of the binary to the binary-to-hex coded poem string
when they convert the hex to binary, binary to string, they will get a poem and some useless garbage, unless the logic (AND) is followed to un-obfuscate the binary
>>
>>108044909
visualbasic is better than rust
>>
>>108042427
moetroons worship retardation, calling it cute
>>
I'm in the middle of making a GUI app and its getting messy, it has a plugin system that has an event bus injected so users has access this this to react to events.

Question, is it bad practice to inject the Event Bus to most of my classes that needs cross communication to other classes?

Example classA imports an item, classB needs to know so it can run it's logic to do additional processing on the item. With event bus they both get it injected, classA after it imports tells event bus "itemImported" then classB listens, to "itemImported" and reacts to it

One thing I worry is if I do this a lot across my classes it becomes like a cobweb hard to reason where its going
>>
>>108045014
how is it retarded
>>
>>108045014
retardation is cute when it's cute girls being retarded
>>
how am I retarded
>>
you know what is retarded? my computer has 25GB of SSD space, and windows 11 keeps putting out security updates, and the IDE for visualbasic is 20GB and comes with a bunch of shit that I dont want. I only want visualbasic! Visual Basic 6.0 IDE!
>>
I asked AI and it gave me an answer. you know what cant do that? you...
https://github.com/twinbasic
>>
Looking for a fairly simple/barebones IDE to learn C and C++ with, is Qt Creator a good option? Must be linux compatible, and ideally have tools for making applications with at least a rudimentary GUI.
>>
File: file.png (279.6 KB)
279.6 KB
279.6 KB PNG
Not much progress since yesterday. Today I spent most of my time:
>refactoring code to make views reusable
>fixing layout issues
>wasting time trying to get claude to shit out ANYTHING usable (spoiler: it failed)
fucking incredible that the AI which is supposedly replacing me can't even make a UI that doesn't collapse when you try to resize the window
>>
>>108043340
are you learning to program? seems like there are general syntax principles common to most PLs you need to learn
>>
This shit is never hitting 1.0
https://ziglang.org/devlog/2026/#2026-01-31
>>
>>108046671
Zig's got at least 20 more incompatible versions of "hello world" to run through before then
>>
>>108046671
>This shit is never hitting 1.0
because they now try to reimplement libc?

>Furthermore, when this work is combined with the recent std.Io changes, there is potential for users to seamlessly control how libc performs I/O - for example forcing all calls to read and write to participate in an io_uring event loop, even though that code was not written with such use case in mind. Or, resource leak detection could be enabled for third-party C code. For now this is only a vaporware idea which has not been experimented with, but the idea intrigues me.
He is such a fucking retard for figuring this out only now, ffs. This really shows that Zig was designed without giving two fucks about correctness in general.
>>
>>108046671
>Abolish ICE.
welp, the colored hair grew all the way back into his brain. He's such a latecomer that he's wading into BLM-tier displays after everyone else silently dropped it.
>>
i still continue to do nothing
zero improvment
zero anything
>>
>>108042427
Coding is only for trans "people"
>>
>>108046868
cope, brainlet
>>
>>108046868
i am trans and love coding, but most everyone else (so far as i can tell) at my workplace is cis !
>>
Is freeCodeCamp good? Is it worth my time? I don't exactly expect it to land me a job, but I want to learn and be open to the possibility to landing a tech job.
>>
>>108047776
it's for web codemonkeys
>>
I spent the last weekend with Scala.
A very enjoyable thing, it would be wonderful if it werent such a Frankenstein language.

No wonder the industry dropped it for Rust and Python.
>>
>>108048050
what do you think about Scala's match expression's syntax? doesn't "case" feel a bit too redundant?
>>
>>108048050
The thing that looks great about Scala is the ability to intermingle functional and OOP code. It's quite unique, I wish more languages were like that.
>>
sup frauds
which high level languages can use python libraries besides perl?
>>
>>108049464
vbscript?
>>
>>108049824
>VBScript (Microsoft Visual Basic Scripting Edition) is a deprecated programming language for scripting on Microsoft Windows using
mhmm.
>>
>>108049887
but it is vbscript
>>
>>108048652
It stands out as redundant which is weird considering this language feels like it has 3 syntax sugars for each construct.

>>108049110
It's a double-edged sword that killed this language's adoption.
There's too much language, too many idioms and possibilities and its all so high in the abstraction (functional abstractions on top of object abstractions on top of JVM) that it's hard to decide which option to choose.
It's really fun to "play" with this language, but I can't imagine working on a big codebase with multiple devs who all are into slightly different flavours of the language.
>>
erlang is King
>>
wtf why is easy so hard
>>
File: wtf.png (41 KB)
41 KB
41 KB PNG
>>108050282
oops
>>
>>108050282
What's difficult about it? Just scan and set some booleans as you go?
>>
File: 456.webm (1.2 MB)
1.2 MB
1.2 MB WEBM
Been (((vibecoding))) my soil mechanics simulator web app whiel listening to NHH by Kanye. My heatmap textures are jittering and I am running out of tokens, Chinese LLMs please save me
>>
>>108050422
>What's difficult about it? Just scan and set some booleans as you go?
Yeah, thats exactly the solve. I think I have pattern brain or something. I was sure it was BS or some junk to speed it up, but nah.
>>
>>108050308
with Ada.Containers.Indefinite_Vectors;
with Ada.Text_IO;

procedure Trionic is

type Int_Values is array (Positive range <>) of Integer;

function Pedestrian_Is_Trionic (Values : Int_Values) return Boolean is

I : Positive;
Mono_Changed : Boolean;

begin

I := Values'First;
Mono_Changed := False;
loop
exit when Mono_Changed or I = Values'Last;
if Values (I) < Values (I+1) then
I := I + 1;
else
Mono_Changed := True;
end if;
end loop;

if I = Values'Last then
return False;
end if;

Mono_Changed := False;
loop
exit when Mono_Changed or I = Values'Last;
if Values (I) > Values (I+1) then
I := I + 1;
else
Mono_Changed := True;
end if;
end loop;

if I = Values'Last then
return False;
end if;

Mono_Changed := False;
loop
exit when Mono_Changed or I = Values'Last;
if Values (I) < Values (I+1) then
I := I + 1;
else
Mono_Changed := True;
end if;
end loop;

if I = Values'Last then
return True;
else
return False;
end if;

end Pedestrian_Is_Trionic;

package Bool_IO is new Ada.Text_IO.Enumeration_IO (Boolean);

package Case_Vectors is new Ada.Containers.Indefinite_Vectors
(Element_Type => Int_Values,
Index_Type => Positive);
use Case_Vectors;

Cases : Case_Vectors.Vector;

begin

-- positives
Cases.Append ((1,3,5,4,2,6));
Cases.Append ((2,3,4,3,2,3));
-- negatives
Cases.Append ((3,3,5,4,2,6));
Cases.Append ((1,3,5,4,2,2));
Cases.Append ((1,3,5,6,2,1));

for C of Cases loop
Bool_IO.Put (Pedestrian_Is_Trionic (C));
Ada.Text_IO.New_Line;
end loop;

end Trionic;
>>
>>108050308
It's just poorly presented
>>
i making ptr in vbscript
>>
>>108050706
in OCaml this is just ... too large to paste. Ada is a higher level language, of course. OCaml can't compete with its terse syntax and batteries-included stdlib :(
>>
>follow beginner programming tutorial
>0 ideas as to what to do with what ive learned
>stop trying to learn programming
>forget everything ive learned
>rinse and repeat
how do i stop this
>>
>>108050308

isTrionic(nums) {
n = nums.length
p = 0, q = 0

for (i = 0 + 1; i < n; i++)
if (nums[i] < nums[i - 1])
p = i - 1
break

for (i = p + 1; i < n; i++)
if (nums[i] > nums[i - 1])
q = i - 1
break

for (i = q + 1; i < n; i++)
if (nums[i] < nums[i - 1]) {
return false

return (0 < p && p < q && q < n - 1)
}
>>
>>108051203
Beautifully pedestrian.
You're hired.
>>
>>108051303
have a goal before you start.
don't stop.
>>
>>108051303
talk to AI. it will talk to you forever and not get bored
I mean ask it things to get inspiration and then do whatever you want
>>
>>108051303
Which language? Pick a textbook that gives a bunch of mini-projects at the end of each chapter. Or ask chapgpt for mini-projects designed to help you learn idiomatic design patterns and deepen or solidify your knowledge on X concept.
And yeah, >>108051594 this. Have a reason you're learning, will help narrow your focus.

Keep in mind that any time you start working with a new system or library you are still going to have to do some reading and learning. That part doesn't end.
>>
>>108051303
Use raylib and make little games and animations and simulations and such
>>
>>108051303
Go oldschool and make a personal website. Use github pages as a free host and just put every tiny shitty thing you can make under a week on its own static html page.
>>
How is /dpt/ preparing for the end of Moore's Law?
>we don't, we're autistic
>>
>>108052157
these cocksuckers cant even answer my question about python libraries
what do you want from them lmao
>>
>>108052237
Java (Jython or Py4J)
Julia (PyCall.jl)
C++ (Boost.Python or pybind11)
R (rpy2)
Rust (RustPython or PyO3)
MATLAB (I think even natively)
JavaScript (Node.js)
>>
writing my own vidya gaem engine in c++
>>
>>108052157
My deranged parallel architecture will finally be applicable
>>
>>108052277
so all these would allow me to use python libs without touching that trash?

rustpython and matlab seem an interesting suggestion, rpy2 seems to be the opposite of what i want though? unless im missing something
i'd want to call pythom from R not the other way around
>>
>messing around in gimp
>realize there's something off with the gaussian blur filter, the numbers aren't adding up
>dig through the source code
>the basic gaussian implementation you would expect
>doesn't make sense no matter how many times I run the numbers
>trace everything back from when you press the button
>it does some weird gamma shenanigans before and after applying the filter which created the discrepencies
my fault for treating a graphics application like a calculator I guess
>>
>>108052498
It needs to do that or it will look like shit because the mapping is not linear.
>>
>>108052498
Anon, WTF you want to do?
Just write console mode application in C to generate .ppm files, or something.
>>
>new 12gb update for xcode!
>have to redownload the entire ide
>basic shit is still broken and the beginner friendly learning features I want don't work
>but new AI stuff!!!!
>>
>>108052784
this is one of the reasons why i use my autistic ass CLI modal text editor and then just build it plugin by plugin into IDE

it runs perfectly on both of my mobile devices so most of the automation that ive build for myself i wrote while shitting or riding on a public transport

in fact it will run on anything even remotely computer shaped
and i can use it over ssh so that i can imitate that distributed OS dream of mine
how epic chungus 420 would that be to be able to access any function of any device from any other device hm? and never have to copy files from one device to another
cant imitate that shit with you slop ass IDE, it sure as fuck aint text nor will it fit into the ssh connection
>>
File: done.png (90.7 KB)
90.7 KB
90.7 KB PNG
>>108050308
>>
I wasn't sure where to post this >>108052773 pls help
>>
>>108052498
Shaders are the same shit. You have to linearize the image before you do any manipulation.
>>
>>108052370
nice. What does the architecture looks like and what kind of primitives it will have?
>>
File: thumbnail.jpg (175.4 KB)
175.4 KB
175.4 KB JPG
I mainly code in python
>>
>>108053313
based pytoddler
>>
>>108053313
I used to feel sorry for you, but then I ascended.
Now I don't think about you at all.
>>
>>108051303
I wish I knew. It's a kind of learned helplessness. I haven't done any programming for fun in a long time because I have no ideas.
>>
>>108053313
Sadly I mainly code in VHDL.
>>
>>108053313
Stop it.
>>
    struct SomeView: View {
private var somevariable: String
private var somevariable2: String

var body: some View { }

private func prepareBodyData() -> [String] { }
private func mutateVariable2() { }

struct SomeViewCustomTextField: View {
var somevariable2: String (repeated)
var body: some View { }
}

struct SomeViewCustomTextFieldStyle: TextFieldStyle { }

struct SomeViewCustomButton: Button { }
}
>>
>>108054434
>implying the compiler is less confused than you are
>>
>>108054529
man i shouldve finished that one assembly book so i'd know if this is troll or not
>>
>>108054577
Why not both?
>>
>>108054529
>compilers_are_garbage
this little article really shows that C++ is garbage. all the garbage code is there only because of C++ semantics
>>
>>108054632
>he didn't even read the "is this code perfect? Fuck no" section
I mean compilers in general.
>>
>>108054686
>>he didn't even read the "is this code perfect? Fuck no" section
I did, but the C++ code being garbage is the biggest problem here.

>mov rcx, rax
There is no problem at all.
Are you saying the compiler should change the calling conventions just to eliminate one mov? that's retarded.
>>
>>108054890
>There is no problem at all.
Sure is. RCX is considered volatile, rather than not. Failure of the ABI, especially for subsequent calls that use the same first objects (like C++ does via this).

>Are you saying the compiler should change the calling conventions
It can't. Which is why this should've been inlined.
>>
Just got 4chanX working relatively okay on mobile. It' s not perfect, but feels good now that I can filter on iOS.

https://github.com/r3av/4chan-x-dHash/tree/feature/dHash-v1
>>
>>108042427
made me laugh
>>
>>108054686
>writing a book in his compiler
also why cant he just set every byte to 0 with an AND op
>>
I spent some time trying to improve the speed of my text generator's heap allocators since my first implementations were unusably slow. For reference, using the malloc/free on my system, training on text was able to consume ~20 MB/s, my initial implementation was only able to do ~50 kB/s, so ~400x slower. I gave up on best fit allocation entirely, which is tolerable because I can do compactification when needed. I'm only coalescing the list pool when the pool fails to allocate, and only if it's "dirty" (something has been free'd since last coalesce). List pool coalescing is still way too slow because the worst case is O(N^2), I think I need to use a red-black tree to do this efficiently. A red-black tree will have more memory overhead (only an issue under fragmentation) than the SLL I'm using currently but the current performance is unacceptable. Not doing best fit means that I don't need to maintain any kind of ordering in the vector of pools, but it's also made me realize a vector is probably not how I want to be storing these things anyway since I do want to reorder them. I think using a circular DLL might make sense, since I want to check pools unlikely to allocate last and pools likely to allocate first, so I want to move recently free'd from pools up and recently allocated from pools down (roughly speaking). I'm also using a few other heuristics to avoid trying to allocate from pools that are likely to fail: checking the total unused space is sufficient and that the last failed allocation (reset on free) is > the current allocation requested. I still need to implement recording the last allocation position for the bitmap allocator which should help a bit to avoid scanning the same bits over and over. Current performance is ~3.5 MB/s (until the list pool coalescing becomes an issue), which is slower than I would like but at least tolerable, and I think ~10-15 MB/s should be achievable with less fragmentation than the system allocator.
>>
>>108057037
just use arenas with pools
you donkey
>>
>>108057030
>why can't he perform a read-modify-write sequence rather than a simple write
Anon, I ...
>>
>>108051303
>forget everything ive learned
this isn't true, just think how quickly you can get back to it when you start again. just because you don't remember some syntax doesn't mean you didn't learn a bunch
>>
>>108057037
get inspiration from malloc:
https://sourceware.org/glibc/wiki/MallocInternals

I've read previous posts you've made and you the first thing you need to do is round up your allocations to multiples of 8.
You don't need to restrict yourself to a single free list, you can have many segregated free list of different sizes.
When allocating, round up the allocation, look up into the correspond free list if a chunk is available (if so then great because it will be a good fit), otherwise bump allocate into the current big block. If it's full, try to see if a free list of bigger chunks contains a chunk and split it. If not, mmap a new big block and bump allocate from it.
You do coalescing when a big block is full, I think that's what "deferred coalescing" is.
>>
>>108057097
Elaborate. I don't think this will work very well because it will trigger compaction too frequently, which is very expensive.

>>108057234
Thanks for the link, I will look at it more carefully tomorrow, but it's nice seeing a description of the things beyond the individual allocators they're doing to make it fast (caching in particular). Glibc's allocator is much better than whatever Windows defaults to based on past experience. Rounding up to 8 bytes has too much overhead, there are many many entries that are < 8 bytes, so alignment requirements would be wasteful, and paying the unaligned access penalty is acceptable in my case. Size segregated free lists across pools does seem better to reduce fragmentation.
>>
>>108057432
>Rounding up to 8 bytes has too much overhead
>Glibc's allocator is much better than whatever Windows defaults to based on past experience
Yeah, because either allocator totally doesn't have 8 bytes of internal allocation state plus 16-32 byte padding: https://godbolt.org/z/a57MY8zon

I'm having a stroke here.
>>
>>108057155
cmp is fast though (bitwise calculation)
or you could set a pointer to that address and write 1s to an offset... in vbscript you can get a ptr value (with activeX) but you cant write to it or get the value at the mem address
>>
>>108057534
>cmp is fast though (bitwise calculation)
You are *severely* overestimating the costs of in-register operations and *severely* underestimating the costs of memory operations.
>>
>>108057548
bro just use risc-v
>>
>>108057743
Marvelous idea. Let's ignore all the compiler fuckups on the most popular consumer architecture and move everyone to RISC-V.

I'm not sure if you're autistic for suggesting this, or I am for not picking up the sarcasm.
>>
>>108057780
>I'm not sure if you're autistic
I am not sure either, but my psychiatrist thinks so. Sadly no official autism certificate yet.
> or I am for not picking up the sarcasm.
I don't know. I am just obsessed with risc-v and don't even want to dive deep into x86. It just works for me
>>
>>108057944
>I am just obsessed with risc-v
Well, what's the reason? Because I see all these kernels and programs for x64 that, aside from their normal and obvious semantic nonsense, also don't experience good code generation. I see a tremendous amount of waste both in terms of power and human lifetime, and it repulses me on a fundamental level.

So if anything I have too much empathy - exactly what you'd not expect from autism.
>>
>>108043073
fsm (finite state machines)/dfa (discrete finite automata) are also flowcharts
they may indeed help you one day
>>
AI is so fucking retarded. I hate it so much. I don't and I should not use it ever again.
>copy/translate some verilog code into vhdl
>i missed something
>ask AI what the difference between vhdl and verilog code is
>it tells me something about naming conventions
>Can't even see that 1 out of 3 entities has a synchronous reset and I made all 3 of them asynchronous.
Fucking hell man.

Note: Do not ever use AI again. Do. Not. Use. AI. It's stupid. It can't do anything. It only costs time
>>
>>108058375
>next-token predictor energy model can't into logic
no fucking shit
>>
Now that I understand how tower works... what exactly is the use-case of axum? so far it seems I'm only using it for Router and I don't really use the extractors or could make them using Tower.
>>
>>108057432
do you have to have your data chunks next to each other all the time?
if not just keep allocate some chunk on arena
write to that chunk
if chunk runs out of the space get new chunk and write to that
keep a freelist with the chunks
>>
>>108058375
>>108058553
just did 4 pomo meme sessions 50/10 without AI. Feels really good. Was fucking fun.
8 hours done total today. Lets have another 4.
>>
File: HN.png (7.2 KB)
7.2 KB
7.2 KB PNG
Just built an anti-doomscrolling extension that takes you to /g/ or hacker news instead. Should I publish it?
>>
>>108059957
I doomscroll hacker news, because i have no other social media
>>
how do you iterate an array (i.e. with `for each element in myArray Do`) and read the contents of the array (element it is currently on) and no, activeX arrays item() doesnt work
>>
>>108059957
Excuse me, I *LIKE* developing hatred for the opposite gender while getting smashed on Scottish whisky.
>for like two hours
>>
>>108045770
clion is fine if you are OK with the non-commercial license and you need to disable some sort of option to disable something related to AI.
but you will use cmake.
Visual Studio is the best option if you want something that gives you a GUI to manage your build options (windows only)
To use libraries, you should use vcpkg (BUT I believe QT in vcpkg is cursed because Vcpkg likes to build all libraries from source, and you probably don't need any other libraries other than QT since QT is a everything library).
Imgui is good if you want your code to run on the web using emscriptpen, but imgui is mainly for games/tech demos, and it does not have a good unicode / translation system if you know more than 1 language (QT probably has the best translation tools for C++ especially for CJK languages, since QT uses utf-16 for all strings, I think imgui has forks that support unicode better maybe).
If you don't mind being windows only, I think there was some XAML format "win ui 3" whatever that is (works with C++). Apparently some sort of C# UI is cross platform (I didn't read why they need C#):
https://decovar.dev/blog/2025/11/11/cpp-library-in-csharp/
Also turn on address sanitizer, it's pretty much the only way to debug C++.
cmake is a meta build system, which generates a build system, it also relies heavily on caches which might confuse you (delete the cache when changing values). You might get compile / linker errors (or warnings), and you need to understand the compile / link flags (building stuff without cmake helps).
Mingw does work (vcpkg requires msys), and if you use clang (gcc-mingw does not support address sanitizer), you can use undefined behavior sanitizer (has false positives). But mingw requires 2-3 DLL's to be manually copied...(if it's not in PATH which is bad practice), unlike msvc (other than the asan dll...). Vcpkg copies library DLL's when building. You can use vcpkg without cmake or VS studio in classic mode, but it won't copy DLL's for you.
>>
>>108060013
what?

for i in range(0, len(array)):
element = array[i]
// do shit
>>
>>108060013
$ ocaml -e 'Array.iter print_int [|1;2;3;4|]'
1234
>>
>>108045770
learn rust instead then you can use whatever editor supports lsp since rust-analyzer literally just works, unlike clangd.
>>
I usually have a bunch of terminals with various python scripts running, so now I made a central app with python/curses to handle
1) playing ambient tracks
2) run regular scheduled tasks
3) take commands
4) monitor certain apis and give me alerts under certain conditions

Used .desktop shortcut to style it with a custom icon etc. I think it's cool and useful but maybe I'm slightly autistic

My only regret is I'm not on windows so I can't easily make it sit in tray and not take up space on the same task bar as browser, folders, ect
>>
Used to always say
>if I need performance, I use C
>if I need safety, I use Haskell
But Rust seems to do both. Shame about the community.
>>
>>108061794
Rust does not do both nor are you both sexes
>>
>>108061794
Because Rust was magically enhanced to have better optimizations than C compilers have?
>>
>>108061977
If you wanna talk about compiler optimisations you should probably know that on the JVM you can get better performing long-running applications than C because of the JIT compiler. This is after 30 years of optimisations. Rust has been popular for less than 10 years and performance for applications that run on a static binary is almost the same.
>>
>>108062037
>you can get better performing long-running applications than C
I need to see the specific program and the explanation for why. Sure, if it's a matter of
>we simply don't return memory to the kernel that's been freed, but keep it mapped in
, then that's not so much a code optimization fuckup and a it's-shit-code fuckup.
>>
>>108062037
The JVM tends to beat badly written applications in other languages, as it's got a really good memory management system and the base classes on top have had a lot of effort invested. Provided the program is long-running; it's nothing like so optimized for short processes.
A well-written C codebase tends to beat almost everything else, as it does fewer copies of data (and Fortran is very good for some things). C++ and Rust are theoretically capable of getting up to those speeds, but almost nobody manages it as it's very very easy to lose sight of where the copies are happening. Copies of things like data structures and strings (especially in a loop) are where the costs mount up.
>>
>>108061977
given you don't have void* slop and vtable dispatch for your nih-faux-oop-framework everywhere, ya, probably.
in practice, I write something in C++ or Rust, check asm, and it's nearly identical in many cases. I don't care about C because it isn't a real language outside of babby tier problems.
>>
>>108062073
Most code in most programming languages doesn't return memory to the kernel. It's not worth trying to do it for allocations smaller than a page.
>>
>>108062132
I'm a C++fag and dabble in Rust but
Saying "C isn't a real language" is like saying "Doom isn't a real FPS"
>>
>>108062132
>I don't care about C because it isn't a real language outside of babby tier problems.
enjoying the neet life?
>>
>>108042427
>posaka
>>
>>108062152
no, not really. anything you can do in C, you can do better in C++. The only use-case left for C is shitty nonfree compilers for meme platforms no one cares about.

cope if you want, but since C11+, C has just cribbed everything from C++.
>>
>>108062174
weak bait
>>
>>108062187
>no argument
you got your memory model from C++, you got your threads from C++, your compilers are written in C++. what more cope do you c cucks have?
>>
>>108062132
>void* slop
And that's relevant because ...?
>vtable
C++ issue.

>>108062146
>programming languages
Now you're talking about programming languages and standard libraries, but I can easily envision some incompetent C programmer who directly uses kernel interfaces (which the compiler will not optimize away) and thus fucks up his performance.

And on the other hand I can easily envision a competent C programmer who bypasses a lot of userspace crap to get exactly the resources that he needs from the kernel, and mogs every other programming language and library out there in the process.

Which is why, when I talk about compiler performance, I don't talk about wholesale program optimizations that make a program run slower or faster than another language or VM. I talk about the actual machine code.
>>
>>108062128
is the difference significant though? especially today? we have game engines written in c++ that perform well enough. ML is done in c++. these are probably the two most intensive things apart from extremely fringe stuff.

if i had to take a very minor performance hit and get rust's safety it's not even a question
>>
>>108062220
>minor performance hit
it's not even a real hit outside of 10+ year fringe, mostly handwritten ASM, ""C.""
on the C++, it more comes down to million man-hours than anything else. I honestly think with time Rust will get all the same bells-and-whistles because it really is that good.
>>
>>108062198
I mean, how many benchmarks are there in which people """""prove""""" that C is not the fastest language of them all, and then you look at the actual code, and it's a complete fucking mess no one who actually knows what's going on behind the scenes would've actually written like that?
It goes back to something this random anon wrote years ago.
>>
>>108062246
>It goes back to something this random anon wrote years ago.
that anon is a complete fucking retard too. why the fuck did you save this?
>>
File: hero_data.png (17.7 KB)
17.7 KB
17.7 KB PNG
>>108062220
>we have game engines written in c++ that perform well enough
As someone who's *actually* looked at C++ games ... let's just say that learning how directory iterators work has completely disillusioned me about C++, and that's completely ignoring file I/O and memory layout (which the Factorio devs found out about approximately nine years ago, and which they still haven't fixed, thus locking their game in to a single thread).

And that's a well-optimized game. I can bring out some real stinkers, if you insist.
>>
>>108062272
Thanks for exposing yourself. Now I can completely ignore you and your worthless opinions.
>>
>>108062303
exposing myself as somone who isn't retarded?
what happens when your sentinel value is a valid value?
in C, you write tagged unions. This insane garbage you posted sounds like the deranged ramblings of a go cuck because only such a shit language would deny the basic understanding of unions, let alone tagged ones. ML fucks were using tagged unions forever, Rust does, most old languages add support for them in some fashion or another.
how retarded are you anon?
>>
>>108062318
>retard who exposed himself as a retard thinks he isn't retarded
>and doubles down with shit no one's gonna read
>>
>>108062326
>no argument
I accept your concession.
seems like /g/ is still /g/eet central.

learn what a tagged union is, retard. maybe learn why virtually every language also has length prefixed strings too since your shitty screenshot of (You)r post mentioned strings for some insane reason.
>>
>>108062332
>retard prances around like he's won
Everyone, point your fingers and laugh at him.
>>
>>108062220
>these are probably the two most intensive things
you really have no idea what you're talking about
can't tell if neet or working in sf/silly valley
>>
How is pathfinding done in games with large maps and hundreds of units moving simultaenously? I made a simple simulation with A* euclidian heuristic (8 directions) in a 1000x1000 grid with random obstacles and it slows to halt when the number of units reach double digits
>>
>>108062585
i mean you can probably optimise what youve already got but im guessing youre having each do the whole pathfinding thing each step
>>
>>108052157
You can write JS that's faster than a lot of C++ by working out of typed arrays and actually paying attention cache locality.
>>
>>108062585
>How is pathfinding done in games with large maps and hundreds of units moving simultaenously? I made a simple simulation with A* euclidian heuristic (8 directions) in a 1000x1000 grid with random obstacles and it slows to halt when the number of units reach double digits
This is interesting let me know how you solve it. Hypothetically what I assume you're doing is for all 10 unit's you'd be adding 1 mil grid positions and sorting them. But that's way too much. I would personally give them a small radius and then they path find within that radius. So instead of 1 million grid positions its 100 or whatever. The next thing is A* is a heap so maybe what I'd try is to limit my max heap size. So as your units progress they keep adding another 100 grid positions. But if you keep it trimmed such that maybe only the top 500 best positions or whatever and drop the rest that should keep the memory from getting too crazy, but they should still be able to continue path finding. I hope that makes sense. Good luck!
>>
>>108062720
not this anon but you can also have them move as a group, and only do limited pathfinding per step
>>
how do I tell AI to keep it's responses short without sounding like an asshole? every time I tell chatgpt to tell me whats wrong with a single line of code it shits out an essay
>>
>>108062585
Using an euclidean heuristic is usually the worst idea. You can eliminate 99% of the processing needed in A* if you allow slightly less than optimal paths to be selected.
>>
I know people prefer all sorts of different languages, but in my years as a shitty web dev I've come to think that the best languages have a few things in common.
They have a hindley-milner type system, they are immutable, they are functional or able to be functional and are eagerly executed instead of lazily...
What am I missing? I think languages like Haskell have too much overhead to be widespread enough and easily implementable for trivial things, and I'm not convinced that OCaml is able to avoid the pitfalls of not enforcing monads when implementing side effects.
>>
>>108063148
>They have a hindley-milner type system, they are immutable, they are functional or able to be functional and are eagerly executed instead of lazily...
>What am I missing?
That's it? that's not much as far as language wish lists go
>immutable, functional
easy to think that when all you're doing is traverse the DOM, send requests and don't write any library
>>
>>108063290
I was just being self deprecating when mentioning web dev. I want a general purpose programming language.
As for functional, I'm not 100% on wanting a pure functional language or not. I like Elm, but it's obviously limited to front end. I like the looks to Roc, but I could be sold on something like OCaml I guess. PureScript is a pain in the ass. Haskell seems good, but is a bit archaic. I'm not sure if I could dispense with purity and enjoy something like Gleam or OCaml without worrying about the mess they might make down the line... But maybe I can, idk I'm just spitballing on what language to try next I guess.
>>
>>108042427
Why do we need dynamic memory? Couldn't we just glue more pages onto the current stack frame when we are about to stack overflow and force all values that need to be kept alive to be returned from the current stack frame?
>>
>>108063362
>force all values that need to be kept alive to be returned from the current stack frame?
Returning requires the stack pointer to point towards the return address at the moment of the return. Anything beyond the stack pointer is up for grabs by the kernel, signals/APCs, or debuggers, meaning you have to copy your values around. And where do you copy it to in the first place?
>>
is there a way to only grab the latest message from a socket and discard any older ones? or grab all messages at once so that I can seek immediately to the last one?
>>
>>108063362
the caller might not know how big of a buffer to allocate in it's own stack frame for the return value, hence the word dynamic as opposed to static
>>
File: ebussACK.jpg (41.4 KB)
41.4 KB
41.4 KB JPG
>>108062174
>Year of our lord 2026
>C++ STILL does not have array designated initializers
>C++ STILL requires struct designated initializers to be in the order fields were declared
>Reading from the wrong union field is STILL undefined behavior in C++
>C++ is better
ahahahaha
>>
is regger back?
>>
>>108063441
Why would the kernel keep track of which ranges were covered by which packages? Or export that information to you?
>>
>>108063148
no, that's all correct, you should just get over that fixation with monads. There's much more to correctness than fussing about with side effects, and with a real module system you can enforce monadic style if you want.
>>
>>108062294
Where's your C game, then?
>>
>>108063472
use case?
you dont need it
etc
>>
>>108063539
>anything you can do in C, you can do better in C++
>actually not those things
>>
>>108063533
On hiatus ever since I discovered that buffer and image creations and destructions are non-batched in Vulkan. A little bit of a blow to my motivation, learning how non-serious everyone else is.
>>
Dim subKey : subKey = "HKEY_CURRENT_USER\Console\CincoTerminal\"

' 1. Create the "Second" registry key (isolated from global CMD)
' This sets a large font and Lucida Console that works on monitors small as 800x600 for "CincoTerminal"
shell.RegWrite subKey & "FontSize", &H0018000C, "REG_DWORD"
shell.RegWrite subKey & "FaceName", "Consolas", "REG_SZ"
shell.RegWrite subKey & "FontFamily", 54, "REG_DWORD"
shell.RegWrite subKey & "FontWeight", 700, "REG_DWORD"

' CreateObject("WScript.Shell").Run CincoDir


Select Case Cinco_Computer_Greeting
Case True
' Whatever AI did here to make the CMD be colored this way, I suppose. It works. IDK
Dim esc : esc = Chr(27)
' THE PALETTE
Dim blueBG : blueBG = esc & "[40m" ' Sets background to Blue
Dim blackBox : blackBox = esc & "[40m" ' Sets background to Black
Dim whiteText : whiteText = esc & "[37m" ' Sets text to White
' This command sets the whole window blue, then prints "TIMER" with a black highlight

CincoConsole = "cmd.exe /c start " & q & "CincoTerminal" & q & " /max " & _
q & CincoDir & q & " cmd.exe /k " & _
q & "color 90 && cls && echo " & _
whiteText & blackBox & blueBG & " (The only one I care about is Celery Man, sorry.) && " & _
"prompt Cinco $G " & q
CreateObject("WScript.Shell").Run CincoConsole, 3, false
Case Else
' Do Nothing

end Select



anything you can do, you can do in visualbasic script
CMD.exe can also do << >> and other bitwise logic
>>
>>108063317
I guess Roc is probably the best of the best out of all of these... Despite being so new.
>>
>>108063689
why are you putting human comments in next to the AI slop comments? pick a lane.
>>
I forgot to demonstrate the actual message (not caring about others)
>>108063689
change console part:
CincoConsole = "cmd.exe /c start " & q & "CincoTerminal" & q & " /max " & _
q & CincoDir & q & " cmd.exe /k " & _
q & "color 90 && cls && echo " & _
whiteText & blackBox & blueBG & " (The only one I care about is Celery Man, sorry.) && " & _
"echo. Good morning Paul. " & "&& pause &&" & "&& " & _
"echo. What will your first sequence of the day be?" & _
"cls && prompt Cinco $G " & q
CreateObject("WScript.Shell").Run CincoConsole, 3, false

Case Else
' Do Nothing
end Select




later on I pause (with WIndows XP compatibility) with this but the whole thing didnt fit in
dim Cinco : Cinco = " Self=127.0.0.1 "  ' Computer is Cinco. 

Sub Window_onLoad
call celeryMan(1)
CreateObject("WScript.Shell").Run "cmd /V:ON /k echo Cinco Timer Generator && " _
&"set"&Cinco &"&& ping !self! -n 5" _
&" &&EXIT", 7, true
call celeryMan(2)

>>108063749
the only part was the CMD colors and I would never have known it could do that without AI
>>
File: loop.png (109.1 KB)
109.1 KB
109.1 KB PNG
Self taught and very new. I'm making a very simple deck stat tracker in python. This is what I have right now and it works fine but I wanted to add protection in case I'm retarded and put in the wrong number or something. My first thought was just to have it break the loop if I give an invalid option (as seen in pic rel) but then I realized that while it works for the first option it'd be annoying to have to restart later on. My first thought it to make each step a nested loop so I can break and just go up a level if I'm retarded but something tells me there's a better way than just making a bunch of nested loops so I figured I'd ask here before I do that
>>
>>108064006
write a function that handles input, does any looping, and only returns valid values.
>>
I'm asking here because I have no clue what to search and minimal knowledge
Recently interested in a unity game that has a dll mod that injects some changes, it has "plugin support" where you can load your own dlls, however I've never done this and worse it's in rust
reading up examples, it opens the game itself and reads a "vtable", and whatever code you write you hook to an il2cpp function so that it runs whenever the game calls the function
where can I learn more about this?
>>
>The compiler is unable to type-check this expression in reasonable time.
>>
>>108064068
>il2cpp
https://www.ntcore.com/files/dotnetformat.htm
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
>>
>>108064075
AFAIK classical type inference is O(n). Does Swift's type inference algorithm backtracks because of overloading or something?
>>
>>108064210
unfortunately I'm not knowledgeable enough to know what's going on. I usually get that shit when working with ternary expressions or when a statement is dependent on a variable shared amongst multiple structures / classes....
It just lets me know that I need to fix my shit or try something different
>>
>Hmm I see you're working on something and getting an error. Let me fix that for you.
>*deletes all the shit I just spent the last 10 minutes working on instead of fixing it*
chatgpt is retarded
>>
>>108061774
I was able to make a pseudo tray app with just default tkinter. This is gonna save me so much clutter, awesome
>>
>>108061774
>>108064601
>let me spend all of my free time developing useless scripts on an obscure, dated, straight out of 2007 operating system that 10 people across the world use
how do you retards pay bills?
>>
I just tried to code Tetris in Go from scratch and got filtered at shape rotation. I literally cannot progress from here.
chat am I cooked?
>>
>>108064601
>wc3 icons
sovl

Reply to Thread #108042427


Supported: JPG, PNG, GIF, WebP, WebM, MP4, MP3 (max 4MB)