Sup Forums humor

Don't post shitty cringy ones please.

Other urls found in this thread:

youtu.be/_peUxE_BKcU
blog.apastyle.org/apastyle/2013/06/forming-possessives-with-singular-names.html
youtube.com/watch?v=rX0ItVEVjHc
graphics.stanford.edu/~seander/bithacks.html#IntegerAbs
twitter.com/SFWRedditGifs

>"Don't post shitty cringy ones please."
>Posts shitty cringy one

...

kek

...

...

>building coreutils/libc is hard
>building functioning kernel is easy
yeah right

Have you tried emacs? It's a complete pain to use, I am sure Stallman had a harder time

>Davis's

Kill yourself, you fucking retard.

...

youtu.be/_peUxE_BKcU

inb4 that one autist that always puts a watermark on every pic

That one was actually funny.

What the actual..

OK, which of you guys did this?

its official actually

UNICEF is the fucking GOAT charity

...

fake and gay

#Kodingwithkarlie

i hope he kills himself

>On the left you have a sophisticated method of calculating inverse square-root.
>On right you have a poorly written max function
>Those comments
10/10 post.
Thanks for triggering me.

...

...

this is actually one of the few waaaah women things ive seen that actually contains a functional attempt at humor

Wat.

Why am I liking the bgm

I don't know pointers, but I have a feeling that it's the number 2 for some reasons

>using if statements in your math functions

REEEEEEEEEEEEEE

>a liberal with a gun

Now I've seen everything

>i dont know pointers
the fuck?

Wait, if they are assigning a value to the pointer wouldn't it return the address?

literally worse than third world pajeet here, don't mind me

Liberals are buying a record amount of guns if you believe the news.

That girl looks familiar.

What are you talking about? First they assign the pointer to the address of the first element of the array, then they assign the value of an array element to the value at the address the pointer is pointing to.

This is like baby's first pointer stuff, m8.

In other words, they all return 2, right?

Sorry, for some reason I was assuming *var did what &var did because I forget the syntax for dereferencing pointers.

2
gg ez

[spoiler]Is this meant to be funny?[/spoiler]

int max(int a, int b) {
return (a>b)? a : b;
}

sorry I just had to get that off my chest

I mean 2 3 2, please don't bully

This is still a bad max function and doesn't fix the fundamental problem with hers.

How so? The sheer existence of a Max function or the return 5 XD thing? Because the only actual problem with hers is the return 5

>fundamental problem
Explain
Why his is no good also, not why hers is obviously garbage

There should be no branching in your solution. It should just be pure math.

yes

contestants[0] = 2, you got that
c[1] = c[2], you got that
c[2] = *c, this is harder. Saying c[x] is the equivalent of saying *(c+x*sizeof(int)), and the other way around. *c can be translated to *(c+0*sizeof(int)), which is also c[0].

I can understand the reasoning behind that, but I can't think of a concise way to do that without internal branching either.

I can't visualize how to do it without branches. Can you show me in code what your solution'd be?

you are correct about it being the black guy but it actually says it right after the /n so even people who dont see the image or know a thing about code should be able the decipher it.

learn about pointers btw, theyre one of the most important things in code

...

...

Chuckled.

max(a,b) = 1/2( a+ b+ |a-b| ) as the first thing that springs to mind. In general when writing functions like this it's best to look to solve if somebody has solved it mathematically because taking a cache miss for something akin to this is bad.

...

I'm bored so I'll do a quick lesson on pointers:

To show someone where you live, it's a lot easier and more efficient to send them your address than sending them the bricks and wood and furniture in your house.

The address is a "pointer", it points to the house.

In c++:

int house = 5; //whatever
int* address = &house

& means "address of"

by saying *address, you're saying "the int at address"

"Davis's" is a completely proper and grammatically valid way of indicating possession. Hanging apostrophes are generally reserved for plural words, and Davis is not plural, it is a proper singular noun. If you're going to sperg out about grammar, at least know what you're talking about faggot.

Citation: blog.apastyle.org/apastyle/2013/06/forming-possessives-with-singular-names.html

How would you do it in C without branching though?

Get raped and kill yourself, you retarded fucking faggot sack of shit with down syndrome.

max(a,b) = (ab-b)/(a-1)

get on my level.

I don't know, if speed is priority, this looks like it'd take a helluva lot more cpu cycles than branching.

Multiplication, division, several additions, abs vs. 1 compare and a branch.

Maybe you should stick with functional languages.

can't tell if troll or idiot

Cache misses are generally the most expensive thing that can happen when you are concerned with going fast. They are very slow.

youtube.com/watch?v=rX0ItVEVjHc

More like b(a,b) amirite

He posted that Reddit toad, so a troll.

and how does one calculate absolute value without conditionals?

lol, so this does say that gurls are stoopid, amirite? xD

is that a sig????

you can do it with bitwise operators

How could you do it without if statements? Le newb here

It demonstrates that democracy is doomed to failure and eugenics should be promptly instituted.
The technology is available with CRISPR.

...

...

People who shut on pics like this are stupid imo.
Society is fuckin changing atm and women just don't have any role models when it comes to tech job. Most get barely interested because of that. That's a fact.
So we just gotta push women a little bit, maybe a few really smart ones will pop up and this will then get more women to have _serious_ interest in the field to gain deep knowledge

...

This. Who is she ?

...

kek

...

the number 2 is at contestants[0] and contestants[1], I just can't make sense of what's in contestants[2]

...

...

...

LOL THIS FIZZBUZZ IS TOTALY WRONG XD

...

>anime on a meme website
>in 2017

graphics.stanford.edu/~seander/bithacks.html#IntegerAbs

...

Something like the following:

int maximum(int a, int b) {
int c = a - b;
int k = (c >> 31) & 0x1;
int max = a - k * c;
return max;
}


You basically take the contents of c, right shift it by 31 bits (swapping the sign bit and the least significant bit), AND it by 1, clearing the higher bits and just returning the sign bit. If the sign bit is 1, then c was negative, meaning a < b, else a > b.

see

choice contains the memory address of the contestants array, which is the address of the first element (contestants[0]), which has been overwritten with 2.

...

The compiler obviously optimized the branching condition. It's not meant to be efficient, rather an illustrative example of how one would go about finding max without using branches.

And this is why we don't optimize early. Well played user.

...

cmove is conditional and a branch mispredict could be costly, and require loading the icache from L3 at the most which is like 60 cycles.

less instructions != faster code

The problem is that
claimed having branching conditions in the implementation was a fundamental problem, when it is both less simple and less efficient.

if the woman we push in are unimpressive from the start, then how will they interest other women into becoming programmers, especially if they are "really smart"

Oh, now it makes sense

thanks

its a digital copy of a document thats usually printed, why is this funny?

Here's an experiment I'd do if I was at a computer:
make 2 programs that calculate the max of 1000 sets of numbers, using either method.

then run "time ./expertmax" and "time ./trivmax" and see which does better.

Is that...inline assembly...in an INTERPRETED language?

dear god

I don't understand how that instruction can have a cache miss if it's atomic and both params are registers.