/DPT/ - Daily Programming Thread

prev

Other urls found in this thread:

en.wikibooks.org/wiki/C_Programming
github.com/GNOME/gtk/search?utf8=✓&q=void
man7.org/linux/man-pages/man3/pthread_create.3.html
khronos.org/registry/sles/specs/OpenSL_ES_Specification_1.0.1.pdf
twitter.com/SFWRedditImages

First for Python + Django

First for Go!

normtable = list(table)
print(table[80][3]) #debugging print
print(id(table)) #objects have different ids; not a pointer issue
print(id(normtable))

for i in range(len(normtable)):
normtable[i][3] -= normtable[i][8] * 10000
if normtable[i][3] > 100000:
normtable[i][3] = 100000
if normtable[i][3] < 20000: normtable[i][3] = 20000

print(table[80][3]) # prints different value; 'table' is manipulated


yet when i do this

normtable = list(table)

print(table[0]) #debugging print

del normtable[0]

print(table[0]) #prints same tuple; table is not manipulated

what am i missing?

You have been visited by the crossdressing C programmer of Shimoshina Academy!

Good performance, triple indirection, and tail call optimization will come to you, but only if you post "Keep overflowing the stack, Hime!" in this thread.

>know she's meant to be Rose Quartz

I'm beginning to think I've made poor life choices.

you didn't manipulate the table

redpill me on SDL

># prints different value; 'table' is manipulated
no, table[80][3] is manipulated
>#prints same tuple; table is not manipulated
of course not, just like in the first case

Good luck. /dpt/ is the most blue pilled thread on Sup Forums.

it's ok

It's better than SFML, even for C++. I don't even get why people think SFML is more suited just because it's made in C++

Simple and works well.
Doesn't support special features like multiple mice.

Why is there 3DPD dyke degeneracy on my /dpt/?

keep overflowing the trap, mime!

type * pointer

type* pointer

Or

type *pointer

type *pointer because that works in lists.
type *a, *b

However it is my opinion that C and C++ are braindead in that regard. The asterisk should be part of the type declaration:

type* a, b

type* pointer

type *name

or
type * name

Because
type* a, b

Will create a pointer a, and a value b.
Really though, staying consistent is the only thing that actually matters...

oh shit do they have a video together?

char *a, *b, *c; is impossible with the with the first 2 you listed.

>this much arguing on the most basic of tasks

This is why C is shit unless you're forced to use it.

Can someone explain why they decided that OpenGL device coordinates would be in the range (-1.0, -1.0) to (1.0, 1.0), but OpenGL texture coordinates be in the range (0.0, 0.0) to (1.0, 1.0)?

>posting women
Tech illiterate straightfags get off my fucking board, REEEEEEEEEEEEEEEEEEE.

Because texture coordinates are UV coordinates and screen coordinates are not.

You are aware we have a board for degenerates, right? It's called /lgbt/.

But it doesn't make sense to make them inconsistent just because they are for different things.

Give me an actual real reason why.

Keep overflowing the stack, Hime!

>impossible
char* a, *b, *c;
char * a, *b, *c;

nothing is impossible

that's so fucking inconsistent
why did you even reply?

>bluepill
>redpill
Fuck off, Sup Forums. Get back to your containment board.

We need the redpill more than ever because of OPs image.

but that is less than 50 loc to write yourself, so why would you care?

The illusion is that you have to choose one pill or the other.

Get back to your containment board, Sup Forums. Computer science is about gay men's accomplishments.

Is this a good resource to learn C?
>en.wikibooks.org/wiki/C_Programming

what do you mean?
Because OP posted a picture of the tranny version of a missed high five?

>muh Sup Forums boogeyman

I agree that OP's image is autism, but Sup Forumsfaggotry just creates more autism.

quads get

user. Screen coordinates are for rendering geometry and texture coordinates are for chopping shapes out of bitmaps and shit.

It would make no sense for them to be anything else. I just convert all my shit to pixels anyway by doing x=(2.0/width-1.0),y=(2.0/height+1.0) and texX=(1.0/width),texY=(1.0/height). I know it's bad practice but who gives a shit really.

You son of a bitch.

>uses Sup Forums meme
>lol i'm not pole haha
You can call a Sup Forumsfag anything and he won't care, but call him a Sup Forumsfag and he'll be butthurt for years.

>le maste hake

sheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeit

gj getboi

Why not
type* pointer[3]?

oh shit! are you a wizard???

VLAs are forbidden in C89.
Why not type *ptr = (type *) malloc(sizeof(type *) * 3);

>casting from void * in C
>sizeof(type *) instead of sizeof *ptr

Also, the thing he posted is not a VLA.

I see literally no reason for screen coordinates to not be in the range (0.0, 0.0) to (1.0, 1.0).
It would be far more convenient that way.
There is literally no reason for it to be the way it is currently.

What does this have to do with programming or Sup Forums?

Anyone have the picture that has that bigass list of programming projects? I'm trying to figure out what to do next for my portfolio and I'm stumped.

casting to/from void* is by far more common in C than in C++, anyone who isn't a fucking delusional retard knows this

Do you just not understand the concept of an origin? It makes way more sense that the origin be in the centre of the screen for screen coordinates and it makes zero sense when assembling a texture map.

yes

If anyone needs the quads get Sup Forums analizzard let me know.

Wrong

DOUBLE QUADS!

>Knowledge of C enables freedom.

why?

KILL YOURSELF KILL YOURSELF KILL YOURSELF

WE ARE NOT TALKING ABOUT IMPLICIT CONVERSIONS FROM THE VOID POINTER RETURNED MALLOC (YOU DON'T EVEN NEED TO USE MALLOC IN C++, YOU HAVE NEW)

WE'RE TALKING ABOUT ACTIVELY CASTING TO/FROM VOID POINTERS THAT YOU PASS TO FUNCTIONS AND SUCH

FUCKING RETARD KILL YOURSELF PATHETIC SPERG

>WE'RE TALKING ABOUT ACTIVELY CASTING TO/FROM VOID POINTERS THAT YOU PASS TO FUNCTIONS AND SUCH
yes... I know, you do not have to cast from/to void * in C
Is this so difficult to understand you foolish carposter?

KILL YOURSELF PATHETIC CUNT YOU'RE FUCKING DELUSIONAL RETARD

KILL YOURSELF KILL YOURSELF KILL YOURSELF KILL YOURSELF KILL YOURSELF KILL YOURSELF KILL YOURSELF KILL YOURSELF KILL YOURSELF KILL YOURSELF KILL YOURSELF

is c++ really that scary

i know C (pointers)
i know java (OO concepts)

is it really that much more complex

who /haskell/ here

yes (No)

epic

no and dont pay attention to anything Sup Forums has to say when it comes to discussing a langage

The mad is real

Lol rekt

type */&var

and for functions returning pointers or references

type*/& foo

enjoy your shitty pathetic life where you waste vast amounts of time willfully misunderstanding things in order to masturbate your delusional sperg brain

He is like that in almost every thread. Makes me wonder if he is that upset irl or if he is just pretending.

Jesus, C is so fucking horrifying.

(Unlike you) I enjoy my life actually and don't get upset over everything for no reason. Moreover I explain clearly my problems instead of screaming "SPERG SPEEEEEEEEEERG!!"

This code uses bad practices. type *ptr = malloc(sizeof *ptr * 3); is the correct one.

There's nothing wrong with it, user.

i've been away for some time so you might be confusing me with others. i came back and saw people writing kys and things like that. i'm proud of some of you guys.

C++ is shit, but it's shit because of the things it shares in common with C and Java. It isn't really harder than C, and every valid C program is a C++ program.

mods = gods

Because two women making out has anything to do with programming? Try posting the next edition with an image of two guys making out, and watch how quickly your thread gets nuked by the staff.

Most straight guys are going to give lesbians a pass over gay guys because porn. You can thank the jews for being half done for accepting degeneracy.

>every valid C program is a C++ program

That's not true.

not as well documented as SFML, and it needs extensions to be fully functional. Apart from that, it's great.

>This code uses bad practices. type *ptr = malloc(sizeof *ptr * 3); is the correct one.
That's much better, but it's still horrifying. I'm sure the piss-poor variable naming contributes to it though.
When is an asterisk multiplication and when is it a dereferencing operator? That's so damn ambiguous.

github.com/GNOME/gtk/search?utf8=✓&q=void

>man7.org/linux/man-pages/man3/pthread_create.3.html
>void *

khronos.org/registry/sles/specs/OpenSL_ES_Specification_1.0.1.pdf
>void*

>C

fucking kill yourselves retarded ass spergs, you can choose to understand what was meant

I should have said "most" and not "every", sorry. C++ and C have differences in the way they handle type and the way they handle stupid shit like incriminating and decrementing, and sometimes scope, but you usually won't experience these differences very often in the real world.

>When is an asterisk multiplication and when is it a dereferencing operator? That's so damn ambiguous.
This is pretty clear actually, what is not clear is when it is a definition of pointer to something and multiplication.

And why do you think SDL is better?

...
what?

In C++ you have to cast from/to void *, meaning that most C programs won't compile.

>Most C programs use dereferencing
Citation very needed. Most C implementations of fizzbuzz and hello world (the two things C programs ever program) both work in C and C++.

FUCKING RETARD you are talking about the trivial syntax requirement of having to explicitly cast to/from void*, i'm talking about ACTIVELY USING void* as a "design pattern" which is BY FAR more common in C than in C++

>>Most C programs use dereferencing
I did not say that.

in reply to >...
>what?
the fact that you can't even comprehend anything suggests that you're either a summerfag who's just starting to learn syntax, or a stupid sperg

>i'm talking about ACTIVELY USING void*
And this is offtopic.

>FUCKING RETARD
Funny, considering that you were not able to understand what the topic was about even though I was clear from the start and it was explained multiple times. It's like someone says potato and you understand apples.

repill me on Golang

>design pattern

>you're either a summerfag
We talked multiple times before summer, don't you remember me? ;_;

>the fact that you can't even comprehend anything
Because maybe it has nothing to do with the topic and you just linked some programs that use void *? Of course I would not understand what you are rambling about.

So you meant that in C++ you have to cast from/to void multiplication-token? That makes even less sense.

He likes Java and he is autistic about it even though it is one of the shittiest languages.