I HER U LYKE XNOR
1
Name:
Anonymous
2009-01-09 3:20
hai guys, because I love you so much I made you a present:
def OR(a,b):
""" Returns A + B
"""
x = bool(a) or bool(b)
return x
def AND(a,b):
""" Returns A.B
"""
x = bool(a) and bool(b)
return x
def XOR(a,b):
""" Returns A(XOR)B
"""
if bool(a) and bool(b):
x = False
else:
x = bool(a) or bool(b)
return x
def INV(a):
""" Returns -A
"""
return XOR(a, True)
def NAND(a,b):
""" Returns -(A.B)
"""
return INV(AND(a,b))
def NOR(a,b):
""" Returns -(A + B)
"""
return INV(OR(a,b))
def XNOR(a,b):
""" Returns -(A(XOR)B)
"""
return INV(XOR(a,b))
2
Name:
Anonymous
2009-01-09 4:06
Can I have the receipt? I'm going to return this and get something I actually need.
3
Name:
Anonymous
2009-01-09 4:10
sorry, I 'made' it, no reciept, but feel free to turn it into something you actually need
4
Name:
Anonymous
2009-01-09 4:24
10: assign value to x
20: return x
see anything redundant here?
5
Name:
2
2009-01-09 4:25
>>3
Thanks!
import operator as op
OR = op.__or__
AND = op.__and__
XOR = op.__xor__
INV = op.__not__
NAND = lambda a, b: INV(AND(a, b))
NOR = lambda a, b: INV(OR(a, b))
XNOR = lambda a, b: INV(XOR(a, b))
6
Name:
Anonymous
2009-01-09 4:29
#define XOR(A, B) ((A && !B) || (!A && B))
That's the only one Sepples doesn't have.
7
Name:
Anonymous
2009-01-09 4:30
>>4
You fail to grasp the awesome power of
FAIL-SAFE ENTERPRISE REDUNDANT SYSTEMS
8
Name:
Anonymous
2009-01-09 4:31
>>6
Now do it without reevaluating A and B.
9
Name:
Anonymous
2009-01-09 4:32
the awesome thing about /prog/ is you can have your code optimized for free, you just have to look like a troll (obviously actual requests go unanswered)
10
Name:
Anonymous
2009-01-09 4:40
>>6
#define XOR(A, B) (!(A) != !(B))
11
Name:
Anonymous
2009-01-09 4:42
>>5
now write a bitwise version of each
12
Name:
Anonymous
2009-01-09 4:48
13
Name:
Anonymous
2009-01-09 4:58
>>9
I lol'd and then was very disturbed when I realized how true it is.
14
Name:
Anonymous
2009-01-09 4:59
>>9
I lol'd and then was very disturbed when I realized how true it is.
15
Name:
Anonymous
2009-01-09 5:04
>>9
Why you need these functions when you can write the operators inline like A^B and B&C?
16
Name:
Anonymous
2009-01-09 5:15
17
Name:
Anonymous
2009-01-09 5:17
>>16
Functional programmers.
18
Name:
Anonymous
2009-01-09 5:23
>>16
I do. Because
>>1 described superfluous functions.
19
Name:
Anonymous
2009-01-09 5:40
>>15,17,18
DON'T LOOK A GIFT HORSE IN THE MOUTH
20
Name:
Anonymous
2009-01-09 5:44
>>19
the post of
>>1 isn't a gift or present.
More apt comparison would be a
Trojan horse since use of
superfluous functions is harmful to performance. they could be easily replaced by inline one-character bitwise operators.
21
Name:
Anonymous
2009-01-09 5:46
Don't look a Trojan horse in the stomach.
22
Name:
Anonymous
2009-01-09 6:44
>>21
I don't look at
it . I defined it as "Trojan horse".
23
Name:
Anonymous
2009-01-09 7:48
I care because you do
24
Name:
Anonymous
2009-01-09 9:27
25
Name:
Anonymous
2009-01-09 9:40
>>24
I'm not homosexual. If you have some fixation with the term, i'm afraid my sexual preference will disappoint you. I prefer women.
26
Name:
Anonymous
2009-01-09 9:48
27
Name:
Anonymous
2009-01-09 9:53
>>26
Wrong. A homosexual would prefer man.
in
>>25 i posted the opposite.
Do you believe i'm "faggot" for preferring women?
28
Name:
Anonymous
2009-01-09 9:54
>>27
No, you're a faggot for
BEING A FAGGOT!
29
Name:
Anonymous
2009-01-09 9:54
>>27
Only men are homosexual now?
30
Name:
Anonymous
2009-01-09 9:56
31
Name:
Anonymous
2009-01-09 9:57
>>28 This is Circular logic: you are X because you are X.
>>29 homosexual women are properly called lesbians
32
Name:
Anonymous
2009-01-09 10:01
>>31
ACCORDING TO YOUR PRECIOUS FUCKING WIKIPEDIA, YOU'RE WRONG
FAGGOT!
http://en.wikipedia.org/wiki/Homosexuality
33
Name:
Anonymous
2009-01-09 10:11
>>32
You didn't read the article at all.
http://en.wikipedia.org/wiki/Homosexuality
"The word gay generally refers to male homosexuality, but is sometimes used in a broader sense to refer to homosexuality in general. In the context of sexuality, the word lesbian denotes female homosexuality."
34
Name:
Anonymous
2009-01-09 13:32
and this, my fellow Anonymous is why you have not yet learned the way of the program .
You need to firstly understand that there is a general case, and then a stop case for any iterative or recursive thought.
35
Name:
Anonymous
2009-01-09 13:36
>>33
but is sometimes used in a broader sense to refer to homosexuality in general.
36
Name:
Anonymous
2009-01-09 14:05
>>35
It indeed does. However to be specific you need to mention the gender-dependent version, which is
lesbian .
37
Name:
Anonymous
2009-01-09 14:07
>>36
You have to learn to
understand .
38
Name:
Anonymous
2009-01-09 14:26
>>37
I understand what homosexuality refers to(same gender relationships), but i can't understand how can I be a
lesbian (homosexual women as
>>29 describes ) when i'm Male.
39
Name:
Anonymous
2009-01-09 14:36
>>38
i'm Male
[citation needed]
40
Name:
Anonymous
2009-01-09 14:36
>>38
Its perfectly obvious how you can be a male lesbian; if you don't
understand , then that shows your lack of
comprehension .
Newer Posts