Tech-cringe thread

post kringes

Other urls found in this thread:

pastebin.com/raw/J0f6yWqP
youtube.com/watch?v=i5VA0bgYguE
github.com/lattera/glibc/blob/master/string/strlen.c
git.musl-libc.org/cgit/musl/tree/src/string/strlen.c
twitter.com/SFWRedditVideos

[spoiler]do you use a % for this one?[/spoiler]

if (i%2==1 && i

script.Parent.Touched:connect(function(hit)
script.Parent.BrickColor = BrickColor.Green()
script.Parent.CanCollide = false
wait(3)
script.Parent.BrickColor = BrickColor.Red()
script.Parent.CanCollide = true
end)

>knows robox scripting enough to write this 'meme'.....
Gtfo my board

that's just if unrolling, it makes the program go faster

what's wrong?

You don't need to check if the number is less than 16 retard

if (i.isEven())

ez

pastebin.com/raw/J0f6yWqP

That Tsundere anime game's spaghetti code?

this has been posted here numerous times

its not funny anymore

That's a big object, did he write the entire fucking game in it?

>not making a gahnoo linux distro using sandbox lua

IIRC this is how lazy Roblox developers make doors.

// Token: 0x04001162 RID: 4450
public bool Spooky;

Last year I had to review some students' code and found this garbage in almost every submission. All they had to do was to sort a string of letters without using the built-in sort functions.

Also found someone who redefined True as False to break out of an infinite loop. Surprisingly, that's actually valid code in Python 2.7

How would you do that without doing your pic?

Convert them to ints

It's python, you can compare characters directly.

>a=1
...
>n=14
>o=16
...
>z=27

The stupidity of cs majors never ceases to amaze me.

enum {a=1,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z};

>enum {a=1,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z};
python's standard library implements lexicographic sorting on strings, maybe you shouldn't judge those CS majors so harshly when you're this new?

>>> "d" > "c"
True
>>> "z" < "a"
False
>>> "g" < "j" < "q"
True

def quicksort(mystr):
Greater, Lesser = "", ""
pivot = mystr[0]
for c in mystr[1:]:
if (pivot == 'a'):
Greater += c
elif (pivot == 'b'):
if (c == 'a'):
Lesser += c
else:
Greater += c
elif (pivot == 'c'):
if (c == 'a') or (c == 'b'):
Lesser += c
else:
Greater += c
...
elif (pivot == 'y'):
if (c == 'y') or (c == 'z'):
Greater += c
else:
Lesser += c
else:
Lesser += c
return quicksort(Lesser) + pivot + quicksort(Greater)

>pivot = mystr[0]
>not using median of first, middle, and last
pleb
> Greater, Lesser = "", ""
>not doing quicksort in place
mega pleb

y = x - 'a';

Post more guys, I'm almost thinking about doing some game project!!!

Disgusting yid

I just did in this in C. This
(i & 0x01) ? "odd" : "even";
Requires one more instruction than just using a modulus(%).

I won

youtube.com/watch?v=i5VA0bgYguE

What country?

>girlswhokode

...

...

...

...

>uses windows

It is not that bad. Where does Linux Foundation gets money for sjw scholarships btw?

>removing redundant license text counts as a contribution

update() is like 3000 lines long and I'm assuming it's called every frame of every object. Do you need a super computer to run this game?

fell for linux meme

Nigger, please. There's nothing redeemimg about windows. Fucking pointing and clicking to get around like a child. There's no room for effieciency. I've been using linux for a few years. It's been four months since I completely switched over, and I'm never going back. Windows can't offer anything I want. I do, however, miss mspaint; that shit was cash.

stop posting and return to reddit

Lolwut? I've been on Sup Forums for over a decade. Before that reddit meme, it was 9gag. I've outgrown Sup Forums, there just too much porn; it's offputting at this point. You really must be a girl if you can't make valid arguements.

...

I dare you to submit a patch that turns it into a loop. You're a smart kid, right? Smarter than all the devs writing on glibc I bet.

8 nonconditional jumps is not faster than 1 modulo.

*Conditional jumps, I mean.

Not him but that's trivial with two loops.
That is a ugly implementation. Is another implementation worth it? No.

Be more exact. 64 "if" are executed, against 8 modulo operations and 8 "if".

github.com/lattera/glibc/blob/master/string/strlen.c
the exact same algo beside loop instead of manual indexing and less hardcoded magic constants (compiler might statically calc them, idk)

for (i=0; (i

fuck bad link, I meant musl
git.musl-libc.org/cgit/musl/tree/src/string/strlen.c

According to musl version you don't need to check the type size bound because you have already proved that there is a zero byte in it.

Fuck, that's hard to read even for someone like me who is comfortable with C. Imagine if everything was written like this? C would become what COBOL is today.

Yes, you probably won't have to rewrite strlen ever again, and the efficiency maybe is worth it, but c'mon.

given the glibc's bloat and musl's too-reduced I would choose musl
just keep in mind that this is abusing type system, popcount numeric magic and correcting memory alignment

>calls someone a girl as an argument
Not even that guy, but you're just as bad