[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
File: 10 KB, 738x41, WhatIsThis?.png [View same] [iqdb] [saucenao] [google] [report]
69513571 No.69513571 [Reply] [Original] [archived.moe] [rbt]

I took a Matlab course a couple years ago and never attended one lecture so I still don't know anything about programming. What in the fuck is this? Can anyone actually understand this? Who is smart enough to come up with this? And what is the code trying to do?

>> No.69513589


>> No.69513607

Can you just explain what this is? I literally don't know anything about programming, I thought it was just like you give the computer instructions and it goes. So what is this thing?

>> No.69513630
File: 84 KB, 800x800, e0stFTO.png [View same] [iqdb] [saucenao] [google] [report]

its instructions, retard

>> No.69513640

I thought all code was just instructing the computer what to do. What's vec push?

>> No.69513648

It adds a rectangle to the list of rectangles named rect_one in the object named grid. The programmer is for whatever reason is upset with the way he's creating the rectangle. This is not related to matlab. You are a brainlet and are not suited for this.

>> No.69513655

This is a snippet of code, that no one can really tell you what it does without seeing the rest of the code base.

It's calling a function vec_push with 2 arguments. The first argument is a pointer, (probably to a vec), the second argument looks like a set of cooridnates offset from event.text that is likely already rendered.

>> No.69513678

I have a mechanical engineering degree surely programming can't be that far above what I can do

What's a pointer? What does rendered mean? Why are you calling them arguments?

>> No.69513694

Then fucking stick to mechanical engineering. If you want to do programming, start from scratch. Don't do this retarded bullshit where you want to pass a course without knowing anything about the subject.

>> No.69513704


>> No.69513708

I already passed the course. What does starting from scratch look like? And why are you so mad?

>> No.69513748

>you mad you mad
Your behavior deserves those kinds of responses. It's not a matter of being mad. I am slightly upset people like you exist, but I would be abusive in my responses even if I wasn't.

>> No.69513779

Why are computer geeks like yourself so upset all the time? I notice this at work as well, the "IT" guys are always pissed off nonstop. Is it because you don't get much sunlight?

>> No.69513800

When someone is telling you off it doesn't necesserily mean he's pissed off.

>> No.69513848

Yes you're you fuckkng cocksucker, now help me for fucks sake

>> No.69513874

Isn't it because you are nearby and they sense they might have to deal with you?

>> No.69513877

It's part of a virus. It buffer overflows, corrupts the stack, and uses return-oriented programming to set up an encryption backdoor. You can tell by how the numbers map to CPU instructions. Lucky you caught this, good eye.

>> No.69513932

No my CS teacher was the same way. I remember we went and asked him a question for our project and he was moving around like a bobblehead while answering, really fucking weird guy. Same with a lot of the TAs for the class. Are programmers mentally ill by birth or does the programming do it to them?

>> No.69513938
File: 2.11 MB, 240x256, 1406418116054.gif [View same] [iqdb] [saucenao] [google] [report]

You know what? FUCK YOU, all I did is to ask shitty a simple question, I bet you don't even know the answer since you fucks are just weebs playing vidya 24/7. That's it, I'M GOING BACK FAGGOTS.

>> No.69513942

It's clearly only happening when you are present.

>> No.69513958

Thank you.

You received two honest answers that describe the code well, by the way, one of which was mine. You chose to ignore them and focus on people being mean to you for asking retarded questions in retarded way.

>> No.69513973


>> No.69514062
File: 413 KB, 1229x1600, 1A42588B4B4F4CEA9355E299D9B6A2CE.jpg [View same] [iqdb] [saucenao] [google] [report]

Fuck off faggot, none of your answers didn't help.

>> No.69514077

They didn't help because it was a dumb question and nothing will help you with this anyway.

>> No.69514103

Everyone on reddit would've helped me even if it was dumber than mine, unlike you faggots.

>> No.69514113

That's good for us, is it not? You'll leave and go to reddit.

>> No.69514161
File: 39 KB, 415x470, 2l0ahe.jpg [View same] [iqdb] [saucenao] [google] [report]

I really hope you find yourself in a same situation to see how much of a brainlet you're, I'm going back npw

>> No.69514176

>What's a pointer?
>Why are you calling them arguments?
You lack the most basic knowledge about the subject and you want it explained to your for free. I won't find myself in that situation.

>> No.69514205

Looks like it's rendering a rectangle on top of a grid or something and it's using the SDL library.

>> No.69514269

That’s not me, that guy is pretending to be me for some reason. I haven’t responded since the OP.

>> No.69514291

>it was just a joke guys I swear

>> No.69514499

It's instructing the computer to push the vec
No retard we don't know the answer because it's a fucking one line snippet. Ever heard of this concept called "context"? Probably not, I doubt you have the mental capacity to grasp such advanced ideas.

>> No.69514503

No way you're a mechanical engineer without knowing even the basics of programming. Probably a retarded larper, a woman, or a cheating hand holded baby in retard university

>> No.69516159

This is just some call to a function for managing a dynamic array and it's trying to push an element onto the end of this data structure. The data being pushed here is directly represented as a compound literal with too many parentheses and also you cropped out the underscores.
There's nothing wrong with compound literals, it's just whoever wrote this is a mong.

>> No.69518063


>> No.69518586

which part seems hard to you?
SDL or compound literals?
please don't say the & symbol

vec_push is probably a function pushing an instance of SDL_Rect type (2nd arg passed by copy) into vector (1st arg passed by reference)
the parenthesis around (SDL_Rect) { ...} are redundant
Compound literals were added to C in C99 standard, it's a way to put a static literal of array or struct into the code. Alternative is to initialize it on separate line and then pass it as normal variable. It requires the literal to be explicitly typed, thus the (SDL_Rect) type cast before the {...} block.
SDL_Rect is a struct with 4 fields: x, y, w, h
x = 32 + event.text.text[0] * 16
y = 64
w = 8
h = 16

from this one line it's impossible to say what grid and event structs are or what are they do in the program. but it's pushing a rectangle into the vector of rectangles

>> No.69519248

Anyone know what this guy is even saying?

>> No.69519344

post the whole code faggot.

>> No.69519468
File: 74 KB, 500x280, raw.png [View same] [iqdb] [saucenao] [google] [report]

>> No.69519698
File: 419 KB, 600x450, 1518463368068.png [View same] [iqdb] [saucenao] [google] [report]


Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.