This thread?
>>56828701
Why did he put a comment between the curly braces. Why is there nothing after the else.
>>56828727
you fundamentally misunderstand, friend.
>>56828727
To indicate that code for windows 95/98 should go there.
The else is too show where code for other OSs should go
>>56829028
I hope that this is a contrived example...
>>56828787
wew
>>56829028
this is art.
>>56829028
fucking last semicolon!
>>56829028
Obviously you gotta compress
are_equal(x,xx){return (x>xx)?(x<xx)?(x===xx&&xx===x):false:false:false}
>>56829579
This is way too advanced, you must have a Master's
>>56828701
i dont even understand what this code is supposed to do
>>56829548
What's the right way to do this
>>56829579
WE NEED
MORE OBFUSCATION
>>56829028
>He forgot the ; after return 0
What a noob. Is it a Guy from /g/ ?
>>56829652
probably regexes
or at least match to an object
like if ('0123456789'.indexOf(number) > -1)
>>56829652
check type using parseNextInt()
throw exception if it isnt
>>56829579bool are_equal(int x, int xx){return (x>xx)&&(x<xx)&&(x==xx)&&(xx==x);}
>>56829028
I don't get it but it seems funny
>>56829723
>>56829742
>>56829756
fuckin plebs
are_equal = a => {Array.prototype.slice.call(arguments).map(a => {
x>xx&&(return new Boolean(1))
x<xx&&(return new Boolean(1))
(x==xx)?(xx==x)?return new Boolean(1):return new Boolean(0):return new Boolean(0)
})}
>>56829652rinput = raw_input()
lower = map(chr, range(ord('a'), ord('z')+1))
upper = map(chr, range(ord('A'), ord('Z')+1))
digits = map(chr, range(ord('0'), ord('9')+1))
if rinput in lower o rinputr upper:
print('its a word!')
elif rinput in digits:
print('its a number!')
else:
print('that's some other shit')
and im a complete retard
>>56829641
It prevents Windows 9 from being released.
>>56829792(defmethod are-equal ((x integer) (xx integer)) (and (not (> x xx)) (not (< x xx)) (eq x xx) (eq xx x) (eql x xx) (eql xx x) (equal x xx) (equal xx x) (equalp x xx) (equalp xx x) (zerop (- x xx)) (zerop (- xx x))))
>>56829028
>that unconditional return false in the end
top keke
>>56829652
console.log((a => (/[0-9]/.test(a))?'number':(/[a-zA-Z]/).test(a)?'word':'other')('0'))
>>56829875
Oh shit, I had forgotten about =(defmethod are-equal ((x integer) (xx integer)) (and (not (> x xx)) (not (< x xx)) (eq x xx) (eq xx x) (eql x xx) (eql xx x) (equal x xx) (equal xx x) (equalp x xx) (equalp xx x) (zerop (- x xx)) (zerop (- xx x)) (= x xx) (= xx x)))
>>56829792
wait fuck so basically let the map function take 3 arguments, a b and c, replace x with a and xx with (c[b+1])
it should work
https://css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/
>>56829652number = raw_input('> ')
try:
test = float(number)
print "Nice number!"
except ValueError:
if all(c in string.letters for c in number):
print "That's a word"
else:
print "That's a cob of shit"
>>56830003
please don't directly link that ever
>>56830003
>>56830037
http://web.archive.org/web/20160419023021/https://css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/
Sorry.
>>56830037
What the el is going on in this pic
>>56829652import java.lang.*;import java.util.*;public class IsNumberOrWord extends Object {public static void main(String args[]) {try {Integer.getInteger(args[0]); System.out.println("Nice number!\n); catch(Exception ex){System.out.println("Not a number!!");}}}}
>>56830066
ACTUAL abstract algebra
it's cool stuff
>>56829893
wait i missed a bracket but it still works what de fug
>>56830076
You forgot all the dependencies. Where is Spring? Where is the POM file?
>>56829857
sure
>>56829028
To be fair it could make sense in C++...
>>56830090
That's linear algebra...
>>56829894
>using a meme language
>>56830181
technically
but it's linear algebra over GF(28)
that has to count for something, right
>>56830261
shit, that showed up as a superscript when i pasted it in
pretend that said "GF(2^8)" or at least "GF(256)" or something
>>56829548
>>56829028
The extraneous return else, checking that it's equal in BOTH DIRECTIONS, the missing semi-colon. I think we've achieved peak I.T. student with this post.
>>56830437
Kek
>>56829641
Execute some code on Windows 95 and 98 only.
>>56830135
How?
Unless the programmer was retarded enough define int as something else than int, no.
>>56830437
but that isn't a bad idea?
or maybe it is in shit java
>>56829780
the first three things encompass all mathematically possible inputs and the last line covers "everything else"
Underrated thread. Have a bump, free of charge.
>>56828701
kek
>>56830133
>>>/9gag/
>>56829028
>>56829579
>>56829756
>>56829875
>>56829894
(defun AREEQUAL(NL)
(cond ((equal L NIL) 0)
((equal (car L) N) 1)
(T (0))))
>>56828787
This is a result of the time when you actually had to type the whole code yourself. Today we have IDEs, so we can actually have functions named "stringByReplacingOccurrencesOfString" instead of "replaceAll".
Oh what an exciting time we live in
>>56829883
Isn't that standard practice? Would you throw an exception?
>>56829680
semicolons are used to separate statements. if you use one after the last statement you're creating an implicit empty statement at the end of your functions.
>>56834375
That's just impressively dumb as opposed to just plain fucking retarded like most example itt.
>>56828787
op of that thread here ask me anything
>>56834447
they are meant to be funny. Bad ways of doing stuff.
>>56834506
Last one I have. I know it's not strictly on topic, but it's not like the thread is overflowing with content.
>>56830003
>Occasionally write front-end code in PHP (WordPress) or Ruby (on Rails)
Do I miss something as him or are companies stupid?
>>56834362
>>56834368
>>56834375
>>56834402
>>56834498
Link kinda related https://github.com/philipl/pifs
>>56834506
>>56834520
I'm certain one hippie has this on his phone.
>>56834530
Has someone made a git repo of the most ridiculous imaginable ways of inputting your phone number or what?
>>56834251
>stringByReplacingOccurrencesOfString
Pajeet KYS
>>56834362
>>56834368
>>56834375
>>56834402
>>56834498
>>56834506
>>56834520
Post the binary search one
>>56828787
>tfw the botnet wants you to be a webdev
>>56834628
irony detectors broken today?
Swift is one of the worst languages I've ever had to use
>>56829548
STOP
>>56834402
this is my favourite
>>56834506
what's the easiest way to achieve that ? i dont get the translation from checkboxes to int.
Does he check the whole group and see if it fit a pattern?
>>56830437
I just started learning java this week.
Why wouldn't this work?
>>56828787
it should be #include <stdio.h> and not studio.h you fucking retard kill yourself nowwww DELETEEEEEEEEEEEEEEEEEEEEEEEEE THISSSSSSS!!!!!
>>56829641
it's a joke
Microsoft never made Windows 9 because some of their code counted "Windows 9" as 95 or 98, which is retarded.
>>56832647
>>56835591
Not him
>>56830437
not good and programming either
but I think what he meant was lenght of the number. Try parsing number that is out of range of int.
>>56832647
>>56835591
there's instanceOf for typechecking in java
>>56835765
wew
>>56835683
Please tell me more...
>>56829652
try{
Integer.valueOf(number);
print "number"
}catch(){
print "word"
}
>>56828701
I forced this meme
I didn't know it was true
Windows version numbers are the lead cause of software and especially drivers breaking in new windows versions.
>>56828701
Is this why MS skipped Windows 9 and went straight to 10?
>>56836233
Exactly.
>>56835701
it was vendors code that had that
>>56836962
This.
Although, I've heard it was partially because the official way of querying for version was broken, so it may have been partly Microsoft's fault.
>>56834468
>dope
>Python fag here
>I use Python 2.7 because Python 3.X is not supported
>dope
>C is too complicated so Python is better
>Pliz subscroob to my dope blog
>dope
>>56829530
>we had to program like this for nearly a month in my first Java course because the instructor wouldn't let us use and code that hadn't been tought yet
>>56828787
I've never even written in C past hello world and I want to jump off a bridge now
>>56834322
The only reason to write that function in the first place is if you needed to use it as a callback. But even then, the whole function could just be one line:return x == xx;
>>56828701Install Gentoo.
>>56837786
insanely underrated
>>56834251
Yeah, he has no idea what "stdio" means, he should definitely be writing code.
>>56835545
Looks like he has a listener for the checks that runs a loop that does exactly what you thought, searches for a pattern and than associates it with an integer.
>>56837786
>>56839868
Best part is if that isn't WINAPI Sleep() then that will sleep for 1000 days.
>>56834530
>>56834520
>>56834506
>get system time in microseconds
>modulo by 10,000,000,000
>"Is this your number?"
>>56837860
You can't be serious. Memes aside, was he Indian by any chance?
>>56833683function AreEqual(x: Integer; xx: Integer): Boolean; begin AreEqual := false; if x > xx then AreEqual := false; if xx > x then AreEqual := false; if (x = xx) and (xx = x) then AreEqual := true; end;
Pleb.
>>56835305
To pleb to handle Perl?
>>56843182
Baiting this weak
>>56828701// new averaging system
float pp;
float x;
float xx;
float xxx;
float xxxx;
float xxxxx;
float xxxxxx;
float xxxxxxx;
float xxxxxxxx;
float xxxxxxxxx;
float xxxxxxxxxx;
float xxxxxxxxxxx;
float xxxxxxxxxxxx;
float xxxxxxxxxxxxx;
float xxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxxx;
float xxxxxxxxxxxxxxxxxxxx;
cout<<endl;
cout<<"======="<<endl;
cout<<"Average"<<endl;
cout<<"======="<<endl;
cout<<endl;
cout<<"how many values are you averaging? (max 20)"<<endl;
>>56830090
That's more like "concrete" algebra. Abstract algebra doesn't really deal with elements of the group/ring like this.
>>56841411
what I meant is that back then, you actually had to type out everything, so stuff was frequently abbreviated, which isn't great for understanding
>>56830090
>>56845224
best example of practical abstract algebra is the floyd-warshall algorithm for shortest paths in graphs
it's directly and clearly the same as abstract matrix multiplication over the tropical algebra <+,*> = <min,+>
template<class lhs, class rhs>
bool are_equal(lhs left, rhs right)
{
return left.operator==(right);
}
Am I doing this right, guys?
>>56846041
>call by value
no
>>56846556
>brown is darker than black
>>56846590
he clearly understands how && works, why is he not using it
>>56846556
>>56846590
>>56846594
does that affect performance at runtime at all?
>>56830181
Galois fields are abstract algebra.
>>56846605
He's utilizing short circuit if statements. It's still terribly done, but theoretically it's fail faster because of it.
>>56845748
I was gonna rail you for the near unreadable fuzzy screenshot but then
>Bluebook
It's a still from Ex Machina isn't it?
>>56839868
It's one of the most famous ones.
>>56846590
>>56846594
Kek
Did the guy open source his code?
>>56830066
GALOIS FIELDS!!!!!!
Fun fact, Galois died in his early 30s in a pistol duel.
>>56845730
Hey I work in tropical algebras, first time I've ever heard somebody outside of my office know what these are.
>>56828787
>studio.h
>>56829857
underrated
>>56830019
Never fucking use Try Catch behavior, it's not a solution, even if it helps in your logic.
If there is a way without using Try then it's better because of performance.
I've been through hell and back rewriting an entire application some code monkey wrote for the company before I joined, the fucker used Try Catch in EVERYTHING, whenever there was an exception he couldn't solve and whenever there was any kind of logic to do either A or B depending if A is null or gives wrong input.
That shit was slow as fuck because of this, and hogged RAM like a motherfucker.
Only use Try for critical accesses, like connections and files, but even for that using is superior.
>>56829028
These are made up, right? No one can unironically submit something like that.
>>56852705
C/C++ tutor here, it was probably coded by an autist. But at least it works.
>>56844579
I like this one.
>>56829028
Don't you only need the last two statements?
>>56845730
>>56849996
Is that like regular algebra with umbrella drinks?
>>56846847
Yes.
>>56849557
He probably read some online tutorial on how to do decisions, and stopped short of switch.
Of course, every Unity dev I know does the same shit. Didn't even bother learning the language, just copy-pasted a bunch of tutorials and changed objects. That's why Unity games are infamous for memory leaks and shit like caching 2 GB of assets all at once.
>>56830469
NO
We can still go dumber
>>56846590
>>56846594
Not bad, it could have been worse, if you have to program 2^x number of binary outcomes this makes it easy to make sure you don't miss any.
>>56837860
I know this fucking feel, man.
>>56844579
>Jew++
>>56837860
>modulo operator
>"code"
???
>>56841371
ilyen nekem is van.legalább van mivel kitörölni amikor nincs kulapergamen itthon.
>>56846556
>>56846590
>>56846594
Reminds me of the terrifying spaghetti code undertale apparently is