[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: prog-girl.jpg (52 KB, 384x384)
52 KB
52 KB JPG
What are you working on, g?

previous: >>102040812
>>
I WAS HERE BEFORE THE POLTARD 8ROT TAKEOVER
>>
And?
>>
mad
>>
/thread
>>
Lol
>>
Which GUI toolkit to use for cross platform stuff?
I have been writing tcl/tk but I don't really like tcl.
>>
>>102056802
qt, imgui, put shit in a webview, or write your own ui framework with gpu rendering or through skia (it's not that hard)
imgui is good but looks like a hacky developer debugging tool by default so you'll have to spend some effort to make it look good. also you're on your own for animations, background blur etc.

really when you look at all the things you have to do to get nice-looking polished UI, a webview starts to make a lot of sense unfortunately.
>>
>>102056860
qt is convoluted c++ shit.
imgui is nice at start but when you need to style anything, there's just not much you can do.
I think somebody made a designer for imgui, I might try that...
Problem with the opengl GUI's is that you will never get native look.
>>
>>102056521
once again, everything that was to be added was added, and all that is left is to coordinate the 200 API breaks this expansions created.

sigh

might be the last rework for this project, what a journey.
>>
>>102056882
nothing really looks native anymore so there's no point. you're better off making something usable that looks nice than adhering to windows' buttfuck ugly look&feel for example (even MS don't know what they should so with it, every system program they make looks different)
>>
added mouseevent element to my desktop widget program so now i can control volume and brightness with it
the ui elements are dynamically generated in a messy shell script

>>102056802
i use my own gui toolkit
>>
File: object_attributes.png (45 KB, 1690x950)
45 KB
45 KB PNG
The good news is that subobject splitting seems to work in general. The bad news is that the alignment is all over the place.

Sigh.
>>
File: better.png (9 KB, 1200x210)
9 KB
9 KB PNG
>>102057357
... better.
>>
File: 1718420548938635.png (20 KB, 593x226)
20 KB
20 KB PNG
>>
>>102057756
anon your
using namespace std;

?
>>
>>102057806
I don't know what that is yet
>>
I was recently messing around with sbrk and found that when compiling with -ansiC (c89), sbrk would return a 4-byte pointer, despite malloc returning an 8-byte one. The address was unusable and would segfault. When compiling with gcc, however, it returned an 8-byte pointer and worked.
After reading the manpage I found that _DEFAULT_SOURCE had to be defined before any includes to get the correct behaviour of sbrk because c89 only provides ISO C functionality and sbrk is in unistd.h, which is POSIX, but sbrk was removed from POSIX.1-2001, and conforms to BSD4.3 instead. (It confuses me a bit... shouldn't unistd.h fail to include if only ISO C functionality is available?)
Which sbrk was c89 linking to? Are there still 32-bit behaving functions on my computer that are linkable? By the way, the executables produced by gcc and c89 (without any feature test macros) had different build IDs, but both used ld-linux-x86-64.so.2. The build IDs matched with the feature test macros mentioned earlier defined.
>>
Maybe you should calm down and actually code something for once.

>>102057095
Nice.
>>
>>102057838
>Which sbrk was c89 linking to?
The same GCC is linking to. C assumes that unknown functions return an int (4 byte) and leaves the linker to produce an error message if the symbol couldn't be found. In your case, since sbrk never changed, it still linked to the correct one, but ignored the upper 32 bits.

You can produce the same behavior with _GNU_SOURCE and memmem.
>>
>>102057876
I see now, thanks!
>>
File: 1718983359315658.jpg (60 KB, 848x480)
60 KB
60 KB JPG
>>102057756
#include <iostream>

using namespace std;

int main()
{
auto x = 0.0;
cin >> x;
cout << x << "^2 = " << x * x << "\n";
return 0;
}
>>
>>102058484
Using namespace std (and why to avoid it)
https://www.learncpp.com/cpp-tutorial/naming-collisions-and-an-introduction-to-namespaces/
>>
>>102058484
>using namespace std;
based snechia poster
>>
>>102058484
>#include <iostream>
// >using namespace std;
>int main()
>{
{
using namespace std;
> auto x = 0.0;
> cin >> x;
> cout << x << "^2 = " << x * x << "\n";
}
> // return 0;
>}


xdddd
>>
File: 1707298501950608.png (190 KB, 590x448)
190 KB
190 KB PNG
I for one am glad the incompetent imposters have left this thread. I just hope they're gone for good.
>>
>>102060249
>.t complete retard
whatever, at the end of the day you are a mediocre schizo
>>
Guess this thread wasn't so clean of incompetent imposters with so much as a single useful opinion as I thought. Oh well. Some worthless garbage always falls through the cracks.
>>
>>102060249
>>102060841
Get a job.
>>
I'll take yours then, OK?
>>
>>102060841
you are seething because you got left behind
>>
I mean, how hard can your job be if wildly hallucinating all the time isn't an immediate disqualifier?
>>
So say I have a Golang goroutine running that doesn't have a loop in it, then returns a result using a channel. How does one cancel that goroutine? If it had a loop I would just use a context.Context or another channel, but it doesn't have a loop, so where would I select <-ctx.Done()?
>>
>>102056521
Cool things to build while learning rust? I took the rust pill but it's hard man
>>
>>102061830
Registry dumper.
No, seriously.
>>
File: 1722637123746828.png (1.87 MB, 2048x1614)
1.87 MB
1.87 MB PNG
>>102061830
Linked list.
>>
>>102057756
std::istream_iterator<int> i(std::cin), end;
std::transform(i, end, std::ostream_iterator<int>(std::cout), [](int i){return i * 2;});
>>
>>102061845
Might be cool but windows APIs suck. I'll still try to do it.
>>102062554
It's a meme I know but I kinda want to do all sorts of tree data structures in rust.
I honestly suck at tree data structure. They just don't make sense to me.
>>
>>102062630
thats not 1, you should use *out++ = *in++ * 2
>>
>>102062666
>pointers to pointers dont make sense
it will always be backed up by a memory allocator if that is what trips you
>>
>>102062630
>>102062682
or counted iterator in C++20
>>
>>102062630
why complicate things
>>
>unironically using c++ iterators
>>
File: place_border.png (29 KB, 430x474)
29 KB
29 KB PNG
Try to match this simplicity in Rust or C++.
>>
>>102062739
I was using them ironically
>>
>>102062630
Idiomatic C++ code.
>>
>>102062754
>boilerplate
>simplicity
wooo
>>
>still no code in Rust or C++
I accept your unconditional surrender.
>>
>>102062900
loltype instanve = lollsconstruct(NIGGER_NUMBER);
>>
>>102062693
Trees fundamentally are different than every other data structure though. I just haven't played much with them and I've never had to use them even for toys so it's kind of fear of the unknown, rather than a fear of known
>>
>error: 'loltype' does not name a type
Surrendering multiple times in a row? That's a new one.
>>
>>102062666
>They just don't make sense to me.
Probly bc you don't understand how a processor works. I always say learn C and asm first before moving to higher languages.
>>
>>102063002
struct loltype{
int you;
int are;
int a;
int nigger;
};
>>
>>102063187
has nothing to do with understand trees retard larper
>>
>error: 'NIGGER_NUMBER' was not declared in this scope
>error: 'lollsconstruct' was not declared in this scope
I'm going to count these as two more unconditional surrenders.
>>
>>102063332
Has. People not understanding pointers is the same. You just don't know what you're doing when you code in your HLL.
>>
I finally understood how the fuck rowan works
    pub fn parse_expr(&mut self, precedence: u8) -> Result<(), LanguloErr> {
self.skip_trivia()?;
let checkpoint = self.builder.checkpoint();
self.parse_prefix()?;
loop {
self.skip_trivia()?;
let tok_precedence = match self.lexer.peek()? {
Some((tok, _)) => tok.precedence(),
None => break,
};
if tok_precedence <= precedence { break; }
let (_, content) = next!(self);
// starting at that checkpoint makes parse_prefix() the rhs of this binary expr
self.builder.start_node_at(checkpoint, Expr::Binary.into());
self.builder.token(Expr::Binary.into(), content);
self.parse_expr(tok_precedence)?;
self.builder.finish_node();
}
Ok(())
}
>>
>>102063591
now do one with no allocations
>>
>>102063406
dunning kruger larper
>>
>>102063638
retard
>>
>>102063591
>Expr::Binary
Uh oh, someone's getting cancelled by the Rust troon squad.
>>
>>102062754
>not a single coherent attempt
>in either language
So, which is it? Gargantuan shame or gargantuan failure?
>>
>>102064030
>Rust troon squad
I thought this was just a meme until I looked at their contributors. It's not a meme, it's a fact. See: Ashley Williams' history.

>pic rel, 1300 commits
>>
File: 1716522689891026.png (91 KB, 1038x617)
91 KB
91 KB PNG
>>102056521
api-based 4chan scrape suite for ml
https://gitgud.io/saltorester/rubicon

it's all dockerized and well documented
>>
File: 1703755573688068.png (137 KB, 1400x524)
137 KB
137 KB PNG
>>102066579
also reworking a berzerker module for hacking wifi via wifipineapple mark vii

https://shop.hak5.org/products/wifi-pineapple
>>
>>102066579
>php
I think I would rather stick my face into a running fan.
>>
>>102066630
yah, sorry. not as elite as whatever javascript framework you use.
>>
>>102066641
>javascript
Now we're talking about sticking my genitals in there.
>>
Daily reminder CMake does not have a built-in project initialisation command.
>>
>>102067540
cmake .
>>
>>102062630
The God of Clean Code.
I kneel.
>>
File: almost_32_bytes.png (24 KB, 840x302)
24 KB
24 KB PNG
>>102062754
Well, that fucking sucks. If I managed to gnaw off two more bytes I'd get to a round 0x20 bytes function size. Fucking REX prefixes ...
>>
>>102061845
What's the linux version of this commonly suggested exercise?
>>
>>102067540
Yeah, I remember an anon shilling cmake-init a while ago. it tried it and it was very good so fair enough
>>
>>102068029
I'm already making money writing cloudshit that runs under Linux though. Just trying to challenge myself to learn a new language but I suppose if there isn't anything like that exercise then I'll write a registry doomper in a windows vm
>>
>>102067940
The same, but on Wine. And the more I read about how Wine operates the more curious I am about the performance: https://blog.hiler.eu/wine-pe-to-unix/
>>
File: preview.png (35 KB, 827x761)
35 KB
35 KB PNG
>>102056521
I rewrote my file hosting website.

All file hosting sites I have seen give you a hard to remember token for the URL like js7Pa and its hard to type.

I really just wanted a convenient way to get files to others. Or between a phone and computer.

With this, you type in whatever username and whatever password. There is no "registration" boloney. One page, but its NOT a SPA.
>>
>>102066626
here's the alpha version
https://gitgud.io/saltorester/wifi-pineapple-berserker
>>
>>102068521
how do you ensure cp doesn't get uploaded? or other illegal stuff?
>>
>>102067540
>Using CMake instead of zig in 2024
isygddt
>>
Despite constant death and rape threats I continue to progress.
>>
>>102069603
nice. a whole 30 seconds of asking chatgpt to do it for you will have you done by tomorrow.
>>
>>102069603
kill yourself
>>102069639
the same, but harder
>>
>>102069639
ChatGPT can barely write code that compiles.
>>102069659
Thanks.
>>
is malloc good for you?
>>
I see so many people especially on X using code produced by AIs and making some stuff and I keep wondering if it's so good why don't they just use C++ or Rust for everything? If the AI is going to generate your shit might as well make it fast, right?
I just saw someone brag about finishing his project in 45 minutes "in a new fun language" I wonder what does it matter how "fun" the language is if you're not the one writing the code?
>>
>>102062666
Win32 has a somewhat steep learning curve (in C), but once you get the hang of it, it's not hard.
>>
>>102069710
pls don't summon him
>>
>>102070211
>summon him
you mean page him in?
>>
>>102070226
Allocating memory for each triangle in each letter of his post.
>>
>>102070211
I've always been here.
>>
File: hugepages.png (82 KB, 1000x570)
82 KB
82 KB PNG
>>102069857
I've once asked ChatGPT to go generate the code for a registry dumper once. The code was complete garbage even after fixing some of the more egregious problems - everything was going to be allocated in a huuuge static array because it knew how to do neither memory management nor alphanumerical sorting, it relegated itself towards ANSI functions, the algorithm was aggressively single-threaded, and when I suggested the NT namespace it didn't even bother filling in the arguments - but at least it got the recursiveness down.

And then there was the time when I wanted to use file mappings with large pages, and GPT went completely off the deep end and suggested things that didn't work.
>>
based jon
https://www.youtube.com/watch?v=mNOLaw-_Buc
>>
File: 1718847168687355.png (298 KB, 640x360)
298 KB
298 KB PNG
hi anons, I'm learning C++ and I wrote a terminal clone of htop, right now it's simple and prints total and core usage in terminal. It only compiles on Linux right now.

Could anyone take a look and verify it is correct? I checked it against htop and the values I read are within margin of error but not exact. I attached code in rentry paste rentry dot co/7w3vywf9

thank you!
>>
int main()
{
int previousNumber1 = 0;
int previousNumber2 = 1;
int currentNumber;
int evenNumberSum;

while (1){
currentNumber = previousNumber1+previousNumber2;

if (currentNumber > (4 * MILLION)){
currentNumber = previousNumber2;
break;
}

previousNumber1 = previousNumber2;
previousNumber2 = currentNumber;

printf("%d\n",currentNumber);

}
}


Bros is there a way to prevent currentNumber from ever becoming higher than 4mil?
>>
>>102073040
you could make it a do while loop
do {
currentNumber = currentNumber = previousNumber1+previousNumber2;

previousNumber1 = previousNumber2;
previousNumber2 = currentNumber;

printf("%d\n",currentNumber);
} while (currentNumber < 4 * MILLION);
>>
>>102056521
I miss the text boards like you wouldn't believe.
>>
I want to learn multiplatform development, so I can make apps for both Android and iOS (and web if needed). I am currently learning React (with Next.js), but can I just go straight to React Native and Expo?
>>
>>102073212
kill yourself if you can't google or ChatGPT
>>
Am I expected to be able to write an LLM if I went to college and got a degree in CompSci?
>>
>>102073176
I mena Haskal too, buddy
>>
>>102073320
>Am I expected to be able to write an LLM if I went to college and got a degree in CompSci?
No, just fizzbuzz
>>
>>102073320
Yeah, just read the papers.
>>
>>102071978
>checked it against htop and the values I read are within margin of error but not exact
Check it against /proc/stat. Maybe top does some magic like using the average between last read/current read.
>>
>>102057095
post the remi
>>
File: 1690586089986291.png (219 KB, 793x1400)
219 KB
219 KB PNG
>>102066131
I'll assume gargantuan shame then. You regret having made the decisions that lead you to them, but you're too old and lazy to change anything about it.

Grim.
>>
I am reading a file, character by character, while keeping track of the current line and column number for error reporting purposes. But I can't decide on the following:
>should the column number at the start of a new line be 0 or 1?
>when a newline is read, should it still be added to the current column count, or not?
For example, Emacs does 0 for the column at the start of new line, and adds the newline to the total of the current column. Do you think that approach is the most sensible?
>>
File: hero_data.png (18 KB, 1100x610)
18 KB
18 KB PNG
>>102074524
>I am reading a file, character by character
The jokes write themselves.
>>
>>102074067
JavaScript's object model is based on prototypes, not class inheritance, retard-kun.
>>
>the onions got triggered
>>
>>102074524
if you're writing a lexer, the best approach is to keep the span of your lexeme in the token, that way you can highlight errors without even caring about the line number, by directly indexing the file contents
>>
>>102074630
I don't like JS and I don't usually write stuff in it, ignoramus.
>>102074568
What program is this diassembly from?
>>
For 6 months all I do at my job is merge develop branch into my feature branch and on a daily standup I just say that I'm resolving technical debt and then close my corpo macbook pro and play elden ring for 9 hours.
>>
>>102074639
So position? I guess that's another way to do it, and it would simplify a lot. I will think about it, thanks.
>>
>>102074745
>position
yeah, to be precise by span I meant a pair of start index and end index. makes highlighting very easy, for example if down the line you want to highlight an entire expression you can simply go from the start of the first token to the end of the last one. good luck with your project
>>
>>102056521
Is thecsharpacademy worth investment?

Basically list bunch of ideas for simple apps using c# and Azure, that can be used for portfolio.
I guess the real question do employers give a fuck about these small projects.
In theory it can't hurt, I doubt anyone even looks at them.
>>
I'm trying to learn Go and this seems to be the new syntax to route stuff and I'm pretty much copying what I've seen online, but for some reason it just keeps routing to the root in postman, any clues why I can't get my code to route me to the right function?

 
package main

import (
"fmt"
"net/http"
)


func main() {
mux := http.NewServeMux()

mux.HandleFunc("/", handleRoot)
mux.HandleFunc("POST /users", createUser)
mux.HandleFunc("GET /users/{id}", getUser)
mux.HandleFunc("DELETE /users/{id}", deleteUser)

fmt.Println("Starting server on port 8080")
http.ListenAndServe(":8080", mux)
}

func handleRoot(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome to the root route")
}

func createUser(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "User created")
}

func getUser(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "User details")
}

func deleteUser(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "User deleted")
}

>>
>>102069185
there is max lifetime setting. If no delete duration is specified, content people get 15 minutes. There is also a upper limit of N days. So basically I don't worry because its ephemeral
>>
>>102075100
nvm it seems you need to specify your go version on the mod file for some stupid fucking reason.
>>
>>102074524
does reading one byte in linux even work?
>>
>>102057828
hello, i have never touched cpp before and dont know a single thing about it
but from context clues, i assume it would allow you to drop the explicit naming of std for function calls and just
cin >> somevariable;
cout << "The number is" << somevariable;
>>
>>102073346
Let the dead dogs lie.
>>
>>102076430
Yes and fgetc() is very fast bc it just gets it from a buffer that was read() earlier.
>>
>>102076515
You can do
using std::cin, std::cout;
without causing the sky to fall in.
>>
File: what.png (32 KB, 902x306)
32 KB
32 KB PNG
Is this dotnet tutorial retarded or am I?

"Method parameters are variables used inside the method"

The first sentence is saying that any variable inside a class function is a parameter? So if I have a function foo(A, B), and within that function I have a temp variable C, then C is a parameter.
>>
>>102078336
OOP is literal brainrot stay FAR away
>>
>>102078336
stay away from OOP unless you want to get a job and move out from your parents house
>>
>>102078729
I wish I had taken this advice instead of going to university and learning O*P
>>
>>102078336
C# has some dubious "copy java but change it a bit so it's different" decisions
>>
>>102078336
I don't know why the other anons are talking about c#, this terminology is general. when you pass a value as an argument to the function, you're binding that value to the corresponding function parameter. in simple terms, in
>def add_three_to(n):
n is a parameter, and in
>five = add_three_to(2)
2 is an argument.
>>
>>102078336
>Is this dotnet tutorial retarded or am I?
Both. The tutorial for asking such nonsensical questions, and you for going through said tutorial.
>>
File: sudo.png (215 KB, 1600x2000)
215 KB
215 KB PNG
>>102056521
ok, dpt
you reverted back from your wicked moeposting ways

i have one more test for you:
collectively, all of you

what is the fastest way to turn a graph into a collection of datapoints you know, or can think of

i have mine and i want to benchmark it
and if you can provide something appreciably better than gauss+sobel, i might be inclined to share the fundamentals of how you can get there
>>
>>102078744
Based. OOP fucking sucks and so does wageslavery.
>>
>>102078901
This is supremely retarded and not at all universal. Python is a shit language
>>
>>102079404
t. filtered by OOP and unemployed
>>
>>102079683
t. filtered by debt
>>
>>102079574
>not at all universal
True. There's Perl, because someone has to LARP as the marines and chew crayons.
>>
>>102075262
i see. it's just like "oh, let me upload that for you", user 2 downloads it, then the system purges it after X time
>>
>>102079574
Incidently, the correct and only useful distinction can be found in mathematics.

In mathematics a parameter is some variable that is not an argument but still used in computation. It is constant for any given arguments. It takes you from a general problem space of say parametric equations to a particular one when the parameters are assigned fixed values. In statistics we often solve for parameters, such as in ordinary least squares regression. For example
f(x) = 5x
generalized
f(x) = ax
Here a is a parameter.
You MAY use notation such as
f(x; a) = ax <-- used in statistics
f(x| a) = ax <--- used in statistics
f_a(x) = ax <--- used everywhere
>>
>>102079833
ANY other answer from.some coping seething failed computer scientist filtered by newton and gauss is HARMFUL.
>>
Wtf I did not know C# can overload operators. What is even the point of learning C++ now?
>>
>>102079891
It's been fascinating to see C# aggressively cram in all these language features and somehow not collapse the entire house of cards
I still don't like it, though
>>
>>102080022
>>102079891
C sharp because when you eat curry chana palek paneer at desi station in india you will hit the streets with a sharp pain in your shitter
>>
>>102079368
dfs
>>
>>102079713
t. autistic neet that will suicide when his parents die
>>
File: remi.png (133 KB, 372x372)
133 KB
133 KB PNG
>>102073901
here
>>
trying to force my way through the react learning curve
built the todo, built some other components, and I can feel myself improving
just feel like the learning curve shouldn't be this steep for a senior dev with GUI experience (albeit in WPF)
>>
File: 1724616120849006.gif (1.75 MB, 500x284)
1.75 MB
1.75 MB GIF
>>102080283
>react
this is me reacting
>>
>>102073859
I read the /proc/stat to get the usage for, I guess I could make interval larger and then manually cat the data at the same time and do some quick math.
>>
>>102080184
Bold of you to think I will outlive them
>>
>>102080926
I hope you do and live a good life you fucking retarded loser
>>
>>102081366
Maybe I will without getting a job just to spite you
>>
>>102081403
that's not happening but if you want to experience that yourself and live with regret go ahead
>>
File: leetcode.jpg (10 KB, 530x128)
10 KB
10 KB JPG
If I continue my leetcode grind, what are the odds that I can get a job lined up for me by the time I graduate in december?
>>
File: 1694487683736569.png (199 KB, 500x660)
199 KB
199 KB PNG
Is there an equivalent to this for Windows? Where do I start learning the dreaded Windows API?
>>
>>102081494
>"Grinding" leetcode to get a job
I'm sorry, but you fell for a literal marketing meme and you wasted a lot of time.
>>
>>102081571
Then what should I do instead? I just want to make more than $16/hour with my skills. I'm sick of being poor
>>
>>102079832
yes!
>>
>>102081779
For one, stop asking /g/ jeets for advice kek
>>
File: aggsss.png (38 KB, 390x309)
38 KB
38 KB PNG
>>102082422
>g/ jeets
/g/eets, kindly please sirji.
>>
>>102082422
>>102082503
saaaaaaaars pls help me kindly bloody
>>
>>102056521
bros is oscillation in waves fake?
i think this is all a cia psyop
>>
>>102080093
depth first search?
>>
>>102081527
msdn docs or GTFO
>>
File: Si guasta qua.png (10 KB, 1043x154)
10 KB
10 KB PNG
Guys, a little help with troubleshooting the reason why my programs in C crashes at "free(attuale)->nome" (don't mind the language, I'm italian).
This dynamic string gets initialised correctly and as you can see, right before freeing at "attuale->nome", I can even read it.
>>
>>102083397
stop writing C
>>
>>102083502
Alright it's the wrong thread, I'll move myself over the C
>>
>>102083397
Not enough information. The crash probably happens because you wrote into the chunk block next to the payload of attuale->nome (learn English, spaghetti feeder), but you didn't post that code.
>reminder that malloc is the cancer and you should use kernel allocators instead
>>
>>102069603
My tk/tcl wrapper is now just 10 convenience functions.

>why?
GTK is actively being destroyed by Ga-nome, Qt is jew maxing.
Tkinter has noticeable latency.
tcl is ok but I want this work flow.
>>
>>102083608
What?
I mean, I know english, but I did not understand what you just said. What i can extrapolate is that I wrote inside the string memory slot? But I allocated (string_lenght+1)*char memory for it, there is no more space left.
By the way I write in italian because it's my mother tongue.
>>
>>102083608
>use kernel allocators instead
Nta. How does this make any sense?
>>
>>102083736
ignore him, it's the schizo
>>
>>102083724
>But I allocated (string_lenght+1)*char memory for it, there is no more space left.
How, do you think, does free know that you passed a valid pointer for it, and how big the reserved chunk is, knowing that global lookups are slow?

Where, do you think, would that information be stored?

And how would you end up writing into that information?

>By the way I write in italian because it's my mother tongue.
Utterly irrelevant.
>>
>>102083736
Think about how malloc/free have to work: >>102083799
Think about where malloc stores individual allocation information, and where kernel interfaces would store similar information, and how likely it is to accidentally write into that information.
>>
>>102083609
based
>>
>he is screeching at malloc again
maybe you should worry more about not naming your functions "NtTotalNiggerDeath" chuddie
>>
>>102083799
>How, do you think, does free know that you passed a valid pointer for it, and how big the reserved chunk is, knowing that global lookups are slow?

>Where, do you think, would that information be stored?
How the fuck would I know? I can't find any documentation of the inner code of free(), apart from the magic memory freeer they advertise.

My guess is that it remembers the pointer values of dynamically allocated spaces and deletes them when asked to.

>And how would you end up writing into that information?
What information are you talking about?
>>
Maybe the nocodeshitter should learn how to code in the first place so that his opinions are no longer completely worthless, but only mostly worthless.
>>
>>102083854
I only do real OSes like unix and it doesn't work like that on unix so stfu.
>>
>>102083854
>and how likely it is to accidentally write into that information
ACCIDENTALLY, HOW THE FUCK DO YOU ACCIDENTALLY WRITE INTO A MEMORY YOU ALLOCATED AND WHAT DO YOU MEAN BY INFORMATION?! The pointer?! The values stored?!
Everything is managed by the kernel by the way, moreover it's such a mess that it would be a waste of time not trying to use malloc().
>>
>>102083894
>How the fuck would I know?
By reading the source code? Or at least by reading the source code of a similar implementation? https://codebrowser.dev/glibc/glibc/malloc/malloc.c.html#1167

I think the nocodeshitter might be right. You shouldn't be using C.

>My guess is that it remembers the pointer values of dynamically allocated spaces
What confused you about "global lookups are slow"?
>>
>>102083980
Listen, it's for an university project, I don't wanna spend more time than the last 5 days I had to work on it, I have others exams coming soon and I'm stuck for just this one poopy bug.
>>
Thanks for providing the documentation by the way.
>>
>>102083939
>it doesn't work like that on unix
What C library are you using on your "unix"? Because this is what glibc works like: >>102083980

>>102083955
>HOW THE FUCK DO YOU ACCIDENTALLY WRITE INTO A MEMORY YOU ALLOCATED
To quote yourself:
>How the fuck would I know?
, since you only posted your cleanup?

>WHAT DO YOU MEAN BY INFORMATION?!
The fucking allocation information that free requires in order to know how big the chunk is in the first place, what type of allocation the chunk is, and how to free it in the first place.

>Everything is managed by the kernel by the way
Obviously not, considering you managed to write into your allocator state, and it blew up right into your face: >>102083397
malloc manages its own state to save on syscalls, after all.
>>
>>102083955
the linux kernel's api is really fucking simple
>>
>>102084021
>I don't wanna spend more time than the last 5 days I had to work on it
You better get fucking used to it.
>>
>>102084050
>What C library are you using
Doesn't matter. There's only brk() and mmap() and both allocate at least a page.
>>
>Doesn't matter.
I accept your surrender.
>>
stfu larper
>>
n
>>
Is malloc in the room with us right now?
>>
>>102083397
Post the rest of your project
>>
#include <iostream>
using namespace std

int main() {
int week = 7, heart = 3, phone = 4, laptop = 2020;
double android = 10.0;

cout << "Hello, new guy to C++. Been learning for about " << week << " or so on a free app." << "\n"';
cout << "I have a calypso " << phone << " that runs off of android " << android << " I believe, and a lenovo laptop." << "\n";
cout << "so far I've just passed the %=, *=, += parts." << "\n";
cout << "I'm doing this purely off memory right now, and any replies I make here in the future will be in the same format so I can practice." << "\n"
cout << "any and all advice would be apricated. <" << heart;
return 0;
}
>>
>>102084164
this and esp. how you declare and allocate that string.
>>
>larper
There's a difference between pretending to be retarded and being actually retarded, and you don't understand that difference.
>>
>>102084177
implement rc4 encryption and reply with am encrypted blob and code which decrypts it to your reply
>>
>>102084177
#include <iostream>
using namespace std

int main() {
int phone = 4, laptop = 2020;
double android = 10.0;

cout << "Darn, forgot to put in the interger laptop into that. here's what I should have said." << "\n";
cout << "I have a calypso " << phone << " that runs off of android " << android << " I believe, and a lenovo laptop.";
return 0;
}
>>
>>102083397
I hope you didn't do something like
attuale->nome = "muomo nuomo es alocatomo en la datomo storagiono";
>>
File: markup_editor.png (37 KB, 800x863)
37 KB
37 KB PNG
>>102056521
Working on a prototype markup editor (markdown-like) for a social media app I'm making.
Picrel is an example of most the features.
The parser is in WASM (made in Rust), so I can use it server-side.
>>
>>102084233
>implement rc4 encryption

#include <iostream>
using namespace std

int main() {
cout << "thanks. I'll research that right now to be able to do that.";
return 0
}
>>
>using namespace std<without semicolon>
Now THAT's a larper.
>>
>>102083854
if you accidentally write into that information you would get an address sanitizer error.
>>
>>102084109
It really doesn't matter what library you use on unix bc every library sits on top of the only two memory allocation syscalls brk and mmap. So it's irrelevant which malloc you use. But you didn't know that bc you're a windows fag.
>>
>>102084335
Which sanitizer would that be?
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fsanitize_003daddress
>>
>>102084294

#include <iostream>
using namespace std;

int main() {
cout << "I'm new to this." <<
"\n";
return 0;
}

>>102084233
>rc4 encryption

#include <iostream>
using namespace std;

int main() {
cout << "any resources you can share on where to find this encryption decipherer? I found out what it means, but don't know what exact code blob would work on /g/ 's reply interface.";
return 0;
}
>>
>>102084369
>bc every library sits on top of the only two memory allocation syscalls brk and mmap.
What exactly confuses you about
>malloc manages its own state to save on syscalls, after all
? brk and mmap are merely the functions by which memory is being allocated from the kernel, but then malloc adds its own layer of garbage to the mix so that it can reuse allocations and not constantly have to trap into the kernel for munmaps and such.

But then again I'm not surprised that a Linux fag doesn't even know how his own system works.
>>
>>102084385
 
#include <iostream>
using namespace std;

int main() {
cout << "test, test. 1, 2, 1, 2.";
return 0;
}
>>
>>102084374
there is only one address sanitizer.
>>
>>102084416
Then don't talk shit like: you have to use the kernel go get memory for your string. Because then you would get a whole page. Fcking Windowsfag.
>>
File: Comandario.png (189 KB, 1514x2000)
189 KB
189 KB PNG
So this is the code, a small part of the whole programm which is reserved (by the admonitions of my professor).
On top of the snippet is the data structure I created to store data as lists and that is meant for an hash table, which makes it easy to find the lists I want via its name.
"Aggiungi_comandario" is where i fill a new member to the list granted I have the hash("indice", index), key("chiave"), and string_lenght("lunghezza_stringa").
"Rimuovi_comandario" is the whole function you saw only a part before, it removes a member from the list.
"Copia_stringa", I added it to the screenshot for clarification, is a personalised function where I allocate memory for the dynamic string I'm going to assing inside the list, granted I have the string to copy and I know its lenght.
>>
#include <iostream>
using namespace std;

int main() {
int week = 7, heart = 3, phone = 4, laptop = 2020;
double android = 10.0;

cout << "Hello, new guy to C++. Been learning for about " << week << " or so on a free app." << "\n"';
cout << "I have a calypso " << phone << " that runs off of android " << android << " I believe, and a lenovo " << laptop << " laptop." << "\n";
cout << "so far I've just passed the %=, *=, += parts." << "\n";
cout << "I'm doing this purely off memory right now, and any replies I make here in the future will be in the same format so I can practice. Also anyone know what rc4 encryption blurb works for /g/?" << "\n"
cout << "any and all advice would be apricated. <" << heart;
return 0;
}
[\code]
>>
>>102084441
>AddressSanitizer
>Hardware-assisted AddressSanitizer
>ThreadSanitizer
>LeakSanitizer
>UndefinedBehaviorSanitizer
And which one of these would generate an error at compile time?
>>
>>102084164
>>102084205
>>102084485
>>
>>102084492
wtf are you talking about?
>>
>>102084492
rustc
>>
>>102084465
You STILL get a whole fucking page, you completely braindamaged retard monkey with no survival instincts whatsoever. It's not possible to get anything less from the kernel; the byte granularity comes from malloc, and for no fucking reason other than that the original malloc interface was a piece of garbage that wasn't supposed to export its allocated arenas, because then you'd be able to partition the memory yourself and wouldn't have to use such awful interfaces.

You should just give up on C. You're clearly too smoothbrained for it.
>>
>>102084441
address sanitizer is training hweels
>>
>>102084508
I accept your concession.
>>
>>102084485
I've spent ten minutes on your shit, and literally everything looks like omomondo to me, the comments are useless, and I can't even CTRL + F through the code. Fuck your shit.
>>
>>102084577
Don't ever reply to me again faggot. You're insulting my intelligence.

>You should just give up on C
BHAHAHA i wrote my own memory protected unix kernel in C, so that includes writing those brk and mmap syscalls. Now go to bed anon.
>>
>esl homework help
schoolyear is back
>>
>You're insulting my intelligence.
How can I insult something that objectively doesn't exist?
>>
>>102084709
>omomondo
lol, it's 4:23 in the morning everything gets funny to me.
Isn't the important part the allocation? It's the bottom function.
Also I'll format it better for you now.
>>
>>102084815
#define LUNG_TABELLA 256
typedef struct Claustro_Comande{
char* nome;
int tempo_ordine;
struct Claustro_Comande* omonimo;
struct Claustro_Comande* omocodificato;
} Claustro_Comande_t;
Claustro_Comande_t* comandario[LUNG_TABELLA];

void Aggiungi_comandario(int indice, char* chiave, int lunghezza_stringa){
if(comandario[indice] == NULL){ //se non avvengono collisioni
comandario[indice] = malloc( sizeof(Claustro_Comande_t) );
comandario[indice]->nome = Copia_stringa(chiave, lunghezza_stringa);
comandario[indice]->tempo_ordine = tempo;
comandario[indice]->omonimo = NULL;
comandario[indice]->omocodificato = NULL;

}else{ //se avviene una COLLISIONE!
Claustro_Comande_t* attuale = comandario[indice];
Claustro_Comande_t* precedente = attuale;
while( attuale!=NULL && strcmp(attuale->nome, chiave) ){ //finche non si tratta di una comanda omonima
precedente = attuale;
attuale = attuale->omocodificato;
}
if( attuale == NULL ){ //se non esistono comande omonime
attuale = malloc( sizeof(Claustro_Comande_t) );
attuale->nome = Copia_stringa(chiave, lunghezza_stringa);
attuale->tempo_ordine = tempo;
attuale->omonimo = NULL;
attuale->omocodificato = NULL;
precedente->omocodificato = attuale;
}else{
while( attuale->omonimo!=NULL ){ //finche non raggiunge l'ultimo elementi in lista omonima
attuale = attuale->omonimo;
}
Claustro_Comande_t* nuova_comanda = malloc( sizeof(Claustro_Comande_t) );
nuova_comanda->nome = Copia_stringa(chiave, lunghezza_stringa);
nuova_comanda->tempo_ordine = tempo;
nuova_comanda->omonimo = NULL;
nuova_comanda->omocodificato = NULL;
attuale->omonimo = nuova_comanda;
}
}
}



part 1/2
>>
File: cpp_is_garbage.png (44 KB, 1532x932)
44 KB
44 KB PNG
>file path addresses constantly change
>but not the paths themselves
Eff this, I'm going to sleep.
>>
>>102084868

void Rimuovi_comandario(char* chiave, int lunghezza_stringa, int tempo_ordine){
//calcolo l'indice corrispondente nel claustro
int indice = Codifica_stringa(chiave, lunghezza_stringa);

if(comandario[indice] == NULL){ //se non la trovo è un problema
printf("ERRORE!\n");
}else{
Claustro_Comande_t* attuale = comandario[indice];
Claustro_Comande_t* precedente_omocodificato = attuale;
Claustro_Comande_t* precedente_omonimo = attuale;
Claustro_Comande_t* cima_omonima = attuale;
while( attuale->omocodificato != NULL && strcmp(attuale->nome, chiave) ){ //finche i nomi delle comande sono diverse scorro le sottocelle possibili per trovare la comanda omonima
precedente_omocodificato = attuale;
attuale = attuale->omocodificato;
}
if( strcmp(attuale->nome, chiave) ){ //non ho trovato nessuna comanda omonima
printf("ERRORE!\n");
}else{ //ho raggiunto la lista di comande omonime
cima_omonima = attuale;
while( attuale->tempo_ordine < tempo_ordine ){
precedente_omonimo = attuale;
attuale = attuale->omonimo;
}
if( attuale == NULL || attuale->tempo_ordine > tempo_ordine ){ //non esiste la comanda con cotale tempo_ordine
printf("ERRORE\n");
}else{ //esiste la comanda ed andiamo ad eliminarla
TO CONTINUE...
}
}
}
}

char* Copia_stringa(char* stringa_copiata, int lunghezza_stringa){
char* nuova_stringa = malloc( sizeof(char) * (lunghezza_stringa+1) );
for(int i = 0; i<lunghezza_stringa; i++){
nuova_stringa[i] = stringa_copiata[i];
}
nuova_stringa[lunghezza_stringa] = '\0';

return nuova_stringa;
}

part 1.5/2

at this point it's just interesting to see what you can gather between my writings.
>>
>>102084894
HERE'S THE CONTINUE
if( attuale == comandario[indice] ){
if( attuale->omonimo != NULL ){
printf("C'E DOPO\n");
comandario[indice] = attuale->omonimo;
printf("NON\n");
comandario[indice]->omocodificato = attuale->omocodificato;
printf("CAPISCO\n");
}else{
comandario[indice] = attuale->omocodificato;
}
}else{
if( cima_omonima == attuale ){
printf("CIMA OMONIMA\n");
precedente_omocodificato->omocodificato = attuale->omonimo;
if( attuale->omonimo != NULL ){
attuale->omonimo->omocodificato = attuale->omocodificato;
}
}else{
printf("SCIMA\n");
precedente_omonimo->omonimo = attuale->omonimo;
}
}

printf("?\n");
printf("%d, %s, %d, %d, %d\n", attuale->nome, attuale->nome, attuale->omocodificato, attuale->omonimo, attuale->tempo_ordine);
free(attuale->nome);
printf("...\n");
free(attuale);
printf("O_O\n");


2/2
>>
>>102084485
To me, I see that in Rimuovi_comandario, if you can reach free(attuale->nome) and if you go through the previous else, you don't touch comandario[indice] which means it points to garbage now.
>>
>>102084906
fuck, i'm exhaustion drunk

I'll repost
//HERE'S THE CONTINUE
if( attuale == comandario[indice] ){
if( attuale->omonimo != NULL ){
printf("C'E DOPO\n");
comandario[indice] = attuale->omonimo;
printf("NON\n");
comandario[indice]->omocodificato = attuale->omocodificato;
printf("CAPISCO\n");
}else{
comandario[indice] = attuale->omocodificato;
}
}else{
if( cima_omonima == attuale ){
printf("CIMA OMONIMA\n");
precedente_omocodificato->omocodificato = attuale->omonimo;
if( attuale->omonimo != NULL ){
attuale->omonimo->omocodificato = attuale->omocodificato;
}
}else{
printf("SCIMA\n");
precedente_omonimo->omonimo = attuale->omonimo;
}
}

printf("?\n");
printf("%d, %s, %d, %d, %d\n", attuale->nome, attuale->nome, attuale->omocodificato, attuale->omonimo, attuale->tempo_ordine);
free(attuale->nome);
printf("...\n");
free(attuale);
printf("O_O\n");
>>
File: 7.png (35 KB, 541x188)
35 KB
35 KB PNG
>>102084940
No, you see, before the erasure I check if it's comandario[indice] and comandario[indice] changes to the next member, either with in the same list, or, if it couldn't, in the another list in the with the same index (otherwise it's just NULL).
>>
I discovered the power of rust macros and now I feel like a fucking god. Anyone else feeling like that when something finally clicks.
>>
>>102085030
proc or declarative?
>>
Well thanks for the support guys, I'm going to sleep. Amen
>>
check if lunghezza_stringa is the correct length for the given string.
>>
>>102084737
post repo
post what you did on top of that kernel.
>>
>>102084894
>rimovi_pasta_maccaroni_salsicce
ALBERTO!
>>
>>102085048
Proc. I haven't gotten to declarative yet.
>>
File: 272.jpg (25 KB, 680x813)
25 KB
25 KB JPG
>lunghezza_stringa
>>
void omniom(int om, int no) {
if (onnom)
onimnom(no);
else
nimnomo(nomnom);
return omnomnom;
}
>>
File: 1535304078912.jpg (66 KB, 550x412)
66 KB
66 KB JPG
Spent 6 hours today trying to get shared precompiled headers working in my projects. Fuck me in the ass, why can't it just work
>>
>>102085543
proc kinda breaks my head still, i've done the tutorial repo course and just forgot it all. declarative/macro_rules! is pretty straightforward and makes things like tests/trait impl boilerplate easier

what are you generating with them?
>>
>>102085891
Auto implementation for traits. Basically derive macro.
>>
>Practicing leetcode again to prepare for interviews
>Still having shit luck finding jobs
>Parents are starting to bitch that I’m just a lazy bastard (I graduated last May. It hasn’t even been 6 months yet)
Should I kill myself and give them something to really talk about since they seem to be so bored and having nothing to do but nitpick my life?
>>
>>102085501
It's an old (ongoing) project of me for fun and is not online and not going to be. But it can/could handle interrupts and exceptions, map pages to memory after a pagefault, load elf from disk, do mmap, brk, and most other system calls, had a vga console, keyboard, mouse and even some primitive graphics and windowing support. And multitasking/memory protection/multiuser. For amd64. Boots in realmode and switches to long mode in just one 512b bootsector. Also started a libc for it, (with my own malloc implementation).
>>
>>102086004
If you kill yourself you will have at least cost them a fortune in your upbringing. If they cared about you you will have hurt them additionally. I'd say there's literally no way you can lose with suicide.
>>
C as a high level scripting language.
>>
File: 1709435698717.png (149 KB, 360x327)
149 KB
149 KB PNG
I want to learn Haskell because its logo looks like the half life logo. Does anyone know any good YouTube videos for learning haskell?
>>
>>102086396
I wanted to do computer science because then I maybe could get a job at Black Mesa like Gordon Freeman.
>>
>>102086185
Cute
>>102086396
Any functional language is related to/uses the "half life logo", so you might as well pick a cuter language like clojure or something.
>>
>>102056521
My animation maker is now available online! Use simplerecorder, or your OSes default screen recorder to capture animation you create in real time. Also, when you select files, they are not uploaded to the server. *Everything* is done client side. This is entirely one HTML file - no backend.
https://shoegaze.party

Additionally, I have made my file hosting site available online.
https://files.shoegaze.party

Please let me know if you encounter any issues, or have any fun ideas for these projects. I am not logging errors.
>>
File: whyyyyyy.jpg (228 KB, 1600x900)
228 KB
228 KB JPG
>>102056521
Why does unreal look like this?
Everything looked right until my hand slipped and moved some settings and even if I delete the file it looks like this, on my linux pc works fine but it looks like this on my windows lap
>>
What's the most arguments you have passed to a single function call?
>>
File: 1707051003498.png (617 KB, 1080x1028)
617 KB
617 KB PNG
how high are you on the mountain?
>>
>>102087116
use a struct you tool
>>
>>102087218
I'm afraid I can't do that, Dave.
>>
sooo what do I need to do to get a job now that I've got a computer science degree and have done 250~ leetcode problems?
>>
>>102087264
Forget everything you ever learned, and learn React.js
>>
>>102087264
Get your forklift license and forget computers exist.

unironically.
>>
>>102086090
>I'd say there's literally no way you can lose with suicide.
you technically lose your life, so that's that
>>102087207
depends on where you put rust and odin. And C being low is retarded. Writing good C code is harder than shit like Java or Rust.
>>
>>102087273
I'm unironically doing this. Do I apply to frontend positions even tho my skills in graphic design are "ok"?
>>
>>102087264
find a time machine
>>
>>102087277
I would be wasting my brain if I were to get a forklift license and push shit around all day like a nigger
>>
>>102087282
>Do I apply to frontend positions even tho my skills in graphic design are "ok"?
yeah. Usually they'll have a designer to design things, at least know how to copy designs from figma to your code.
>>
>>102087282
Yeah, it's someone else's job to draw a picture of what it's supposed to look like in Photoshop. You just translate that to React.
>>
>>102087273
Not joking about the forget part. If you rattle off too much CS knowledge they'll say you're overqualified.
>>
>>102087297
>>102087305
What if I pigeonhole myself into a frontend career? At the end of the day, I really just want to not be making poor people wagies, but I'd also like to do anything but frontend desu
>>
>>102087292
ok be a jobless nigger instead.
>>
>>102087346
I'd unironically would rather be unemployed, have my parent's bitch at me, my gf leave me, and have zero money if that meant I got to stay in my room all day and do what I love
>>
>>102087341
R&D jobs are gone till at least 2026. Tax legislation sent them overseas in 2022. They'll be back eventually.
>>
>>102087218
So now your code takes at least three bytes per argument (mov) instead of one (push) on x64. Way to go, dumbass.
>>
>>102087207
>C at the foot of the mountain
For such a supposedly easy task /dpt/ sure takes its sweet time beating registry dumper anon's challenge. Could it be that he's actually right?
>>
File: 1709833769569265.webm (945 KB, 720x1280)
945 KB
945 KB WEBM
WRITE COMMENTS
>>
>>102087207
>>102087207
This graphic is retarded because it's not the language that's hard, it's the algorithms. Time spent learning languages is time wasted
t. scientific programmer

(You should just learn Python and run it through a JIT (pypy) on a Threadripper like a chad. Let the GCC/LLVM boys shift the bits, you focus on matching your datastructures with reality, and your algorithms to those datastructures. Everything else is faggotry. They deliberately mis-educate any technical area of utility.
>>
>>102087595
Ever since I learnt that academia rewards compliance and not competency it's become much easier for me to ignore its members.
>>
File: file.png (126 KB, 1678x682)
126 KB
126 KB PNG
>>102083397
>>102084485
Have you tried doing what the compiler is telling you?
>>
>>102087619
So true
>>
I'm reimplementing my toylang while librarymaxxing because I was getting worried about exactness and speed, plus I usually never use libraries because I don't want to learn APIs I'm only going to use once (especially when I have to interop two or more of them), so this time I wanted to force myself to familiarize myself with them.
I'm liking it so far because the codebase as a whole feels more serious so to speak, each section is its own microcosm of very expressive code + plumbing, but, maybe precisely because of that, the times where I have to shoehorn some customization feel especially shitty
>>
File: no-drevil.gif (2.21 MB, 498x280)
2.21 MB
2.21 MB GIF
>>102087525
>>
i genuinely don’t understand the point of
structs
>>
>>102088026
That sucks.
For you.
>>
>>102088026
the absolute state of rust troons
>>
>>102088026
A struct is a custom datastructure for your data. If you always want to store name, age, height, then store a string and two numbers. The end. There's nothing else to learn.
>>
>>102088099
yeah but why not use regular variables for that?
>>
>>102088185
1: Locality. Names, ages, and heights stored in separate arrays instead easily fucks with CPU caches.
2: Encapsulation. It's easier to pass one address of one person around than three addresses for a person's name, age, and height.
>>
>>102088185
One of the benefits of "structured" data is that it usually means "fixed width". I.e. always X bytes long. A string however is usually nul-terminated meaning bytes just keep getting read until you hit a NULL byte. The latter, variable-width data, is problematic. It means you cant have a table of 1000 items and jump to row 573 because rows are always the same length.

A struct usually fixes this entirely with fixed-length string arrays, or mitigates it by putting variable-length things at the end in such a way that at least the within a row of data you can jump around the beginning bits if they're fixed length.

But blobbing all the data that is used together, together, in this way, makes it possible to multiple byte 45 of row 43782 with byte 8 of row 48, instantly, because you can convert them to struct indexes, because you know where everything is.
>>
>>102088208
>one address instead of many
you’re the only person i’ve seen online explain it that clearly
thanks, anon
>>
>>102088226
> It means you cant have a table of 1000 items and jump to row 573 because rows are always the same length.
with a trivial amount of engineering effort you literally can do this
>>
>>102088291
>what's the point of arrays. with a trivial amount of effort you can literally just use void pointers
you are a dishonest retard
>>
>>102088026
by the specification they enable polymorphism, yes even in C you can implement a vtable or type-tag system yourself, you can control padding and alignment if that's what you need, they also provide a uniform interface for libraries to pass in multiple arguments with a single pointer, there is probably more but ill stop at 3 obvious ones
>>
Do you really need locks when using freertos with single core MCU?
Doesn't the scheduler always execute a function until it calls suspend or delay?
So there is really never a situation where function is stopped and some other task touches some shared variable.
Of course interrupts will stop the function but that's special case.
>>
>>102088352
>Doesn't the scheduler always execute a function until it calls suspend or delay?
No. The documentation says fixed priority preemptive round-robin time sliced. So your thread can be interrupted at any time by an equal or higher priority task. Only a single highest priority task will not get interrupted.
>>
>>102087525
i = 5; // set i to 5
foo(); // call foo()

here anon
>>
how do make terminal write hello
already know print, but is fake
need real solveution
>>
File: what_the_actual_fuck.png (42 KB, 1076x952)
42 KB
42 KB PNG
>a single GetModuleFileNameEx call triggers one NtQueryInformationProcess call to obtain the PEB and 10 NtReadVirtualMemory calls
>which ALWAYS trigger a syscall
>there's no check if the handle is -1 and the same stuff can be done using memcpy
>which is the case in all 10 calls

It's a fucking miracle the entire thing only takes 25K cycles, but still - WHAT IN THE ACTUAL FUCK, MICROSOFT?! This is literally pajeet-tier!
>>
>>102089347
echo "hello"
>>
>>102087525
i will just tell you what the function does at the top, should be enough.
If there is anything silly that CANT be removed but someone clueless might think it safe to remove i will write a comment
>>
>>102088026
ok, if you need an array of information structures (say... about an ip connecting to your server) it is much simpler to use a struct than to write movl 32(%rax,,),%rcx
>>
ecx*
>>
>>102089369
how do you trace api calls?
>>
>>102089369
report it here https://github.com/microsoft/Windows-Dev-Performance/issues they actually read those issues
>>
>>102089923
>help it takes a long time to move 500,000 files from node_modules to the recycle bin
LMAO webshitters are so crazy
>>
>>102090074
it is a windows problem though, doing anything with a bunch of small files has terrible performance on the os because it does a bunch of dumb system calls
>>
>>102088312
yeah, this is the point that i kinda glossed over. You don't need pointers to traverse a structured table, you know where everything is mathematically.

Another reason that just popped into my head is say you want to store some data that only has 8 permutations. Male, Female, and 6 other random genders, but NEVER a 9th....! well you can store that in 3 bits.

But working with just 3 bits isn't very efficient. The computer is designed to process some multiple of 8 bits, so every time you want to read or update this number, additional operations for bit shifting will be required, padding will need to be constantly removed and added.

But in a struct, you can store 2x 3bit numbers and 1x 2bit number right next to each other, taking up a byte, and this ends up both making everything faster usually (there's less total IO to do). And if you are really clever with a struct you can do operations natively, i.e. without needing to decode/encode anything, just shifting bits. Difficult to give an example off the top of my head. You can think of real/floating point numbers as being a kind of struct, as they have a sign, a mantissa, and an exponent. 3 bits of data in a single 32/64bit chunk. And there are operations that can be done on floating point numbers, like DOOM's famous magic number fast factoring thing or whatever it did. Computing normals of a surface? Something like that. Anyway it's a quirk of floating point structs that make it possible to do calculations without using math.
>>
>>102090094
Just take a hammer to the hard drive, 0 sys calls
>>
File: delay_execution.png (51 KB, 1070x948)
51 KB
51 KB PNG
>>102089923
Do they accept issues for W10 as well? Do they check if the issue is still present in W11? Because I *really* don't wanna switch.

>>102089911
IAT overloading.
>>
>>102090162
>slower because you are not software
nothing personal, kid
>>
>>102056521
do you really need a SYS_READ?
>>
>>102090143
>Structs are useful because you can pack bits
Stop smoking so much god damn weed retard
>>
https://crates.io/crates/healslut
Why did you release this?
>>
>>102090777
>playfulkittykat
>>
>>102090143
retarded larper
>makes everything faster
no, you are still accessing memory the same way
>b-but it is the same speed
no, you are doing 2 memory accesses through multiple instructions whereas with a simple ADDB (%rax),$3 you did it in one instruction.
Also you remove register renaming from the equation
>b-but i am saving space
and nobody cares, they all hate you for making simple things complicated
>>
>>102090360
It's not that you can pack bits, its that you get bit-packing for free by virtue of defining your struct cleanly, and packing all the data together. It's inherently entropy-minimising.

The point about Locality is not a blessing or a curse - it has upsides and downsides and you should only seek more locality if the reality that is being modelled is modelled better. You cant have height but no age, weight but no gender, etc. so it makes sense to use a struct that essentially enforces that. This truism of life is reflected in the datastructure such that it forces the programmer to accept it or face having a lot of people in his database age 0. negative heights, etc. People getting hung up on gender but the StructChad confidently responds "there are only 8 genders".
>>
nah nvm you can shift your silly addition operand i guess, still cancerous.
eg
0b011000 + 2<<3
>>
>>102090896
you cant manipulate bits with C structs,
>entropy
are you AI or something?
>>
Lesson learned: never interact with complete fucking retards because they are going to find a way to temporarily lower your intellective quotient, which is a result of you having basic respect for their supposed intelligence
>>
>temporarily
Nah, it's always been like that.
>>
>>102090878
People have always made this argument, but real code shows the opposite - the smaller/denser the data file is, the faster everything done on it happens. The struct brings the row and many rows above/below it into cache, and without all your retarded padding it does a much better job. Bit shifts are so cheap/quick that its not the limiting factor, IO is.

Look bro i know its hard to accept but you've been infected with the machine word mindvirus. You call storing values in their minimum entropy, next to each other, "packing" when you are the one packing 0s on to the end of everything. You love breaking determinism so much with pointers, I bet you, fucking, gay. bloody bastard.
>>
>>102090962
jimmies
1
>>
>intellective quotient
you don't have to worry about that getting any lower lil bro
>>
>>102090927
No no, you cant use the C built-ins for bitshifts on the whole struct, because its behaviour would be ambiguous/undefined and what is right depends on use-case. But you (the programmer) knows where all the data you want is, so if you know the transformation / algorithm you are using doesn't require decoding, you can just start moving and comparing bits. Uhh. OK lets say there was a datatype that encoded every organism on the planet in 32 bits.

Say the LSB defines whether you're multicellular or single-celled. Then animal or plant. Or whatever. Theres an encoding where "1111111010001" is Mammal. "11111110100011" is ape. "111111101000111" is Homo sapiens, and "1111111010001111" is whatever Mark Zuckerberg is.

Well there could be a count-legs( ) algorithm, that worked on such a structure, that didn't need to decode the whole 32bits and match it to a table of legs. It could just how many rows had 7 of the 32 bits positive, those are all the things with 2 legs. Then another count of rows positive for these other bits would give the 4 leg count.

>>102090927
Nah >>102090360 called it in one i'm high as balls.
>>
>>102091304
i speak english because that is the only language you can speak.
>>
what's the simplest garbage collection algorithm?
>>
>>102091953
arena->bytes_used = 0;
>>
move over
>>102092039
>>102092039
>>102092039
>>102092039



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