|
Avenging Dentist posted:Guys, the a[i] / i[a] equivalence is just because the standard defines a[i] as being equivalent to *(a+i). Thanks for clearing that up.
|
# ? Sep 18, 2009 17:10 |
|
|
# ? Apr 28, 2024 00:28 |
|
royallthefourth posted:Thanks for clearing that up. Are you trying to be sarcastic or something? Because if you are, this thread is about to get way more interesting.
|
# ? Sep 19, 2009 05:03 |
|
Avenging Dentist posted:Guys, the a[i] / i[a] equivalence is just because the standard defines a[i] as being equivalent to *(a+i). Was this not the case back in the good old days? Were all data types 16 bits on the PDP-11 or something?
|
# ? Sep 19, 2009 05:44 |
|
Dijkstracula posted:The thing is, though, this makes sense until you think about it for a bit and realize that it's not *(a+i), it's *(a + (i * sizeof(thetype))), so it's not commutative in that way unless the size of the type happens to be the size of the architecture's word. You may want to read up on your pointer arithmetic. Also the reason *(a+i) isn't commutative given that one of {a, i} is a pointer and one an integral type is because a+i isn't a binary operator in that case. Binary operators are defined as a function f: S × S → S, and a and i are not members of the same set. Indeed, if we let S be the set of pointer types*, the binary operator + is invalid. * Including arrays, which degrade into pointers. Avenging Dentist fucked around with this message at 06:16 on Sep 19, 2009 |
# ? Sep 19, 2009 06:09 |
|
Avenging Dentist posted:You may want to read up on your pointer arithmetic. sizeof(float) = 4 (a + 0) = 0x7fff5fbff850 (a + 1) = 0x7fff5fbff854 (a + 2) = 0x7fff5fbff858 (a + 3) = 0x7fff5fbff85c (a + 4) = 0x7fff5fbff860 sizeof(void) = 1 (b + 0) = 0x7fff5fbff850 (b + 1) = 0x7fff5fbff851 (b + 2) = 0x7fff5fbff852 (b + 3) = 0x7fff5fbff853 (b + 4) = 0x7fff5fbff854 Dijkstracula fucked around with this message at 08:15 on Sep 19, 2009 |
# ? Sep 19, 2009 07:59 |
|
Avenging Dentist posted:You may want to read up on your pointer arithmetic. Holy poo poo, AD explained his troll post without having to be explicitly asked to do so. Admittedly, he had to edit it in 10 minutes later, but he still did it. Time to start looking for other signs of the apocalypse. It is a joke, please refrain from projecting your personal sexual preferences.
|
# ? Sep 19, 2009 15:01 |
|
ColdPie posted:Holy poo poo, AD explained his troll post without having to be explicitly asked to do so. Admittedly, he had to edit it in 10 minutes later, but he still did it. Time to start looking for other signs of the apocalypse.
|
# ? Sep 20, 2009 18:34 |
|
ColdPie posted:Holy poo poo, AD explained his troll post without having to be explicitly asked to do so. Admittedly, he had to edit it in 10 minutes later, but he still did it. Time to start looking for other signs of the apocalypse. If you thought the second paragraph explained the first paragraph, I have very bad news for you about your brain (it's broken).
|
# ? Sep 20, 2009 20:15 |
|
Avenging Dentist posted:If you thought the second paragraph explained the first paragraph, I have very bad news for you about your brain (it's broken).
|
# ? Sep 20, 2009 20:23 |
|
Zombywuf posted:It is demonstably false, as can be seen from making the set S the union of the set of integers and pointers. Given that in classical logic (which I assume we are operating in) if you can prove a false statement you can prove anything, the latter paragraph clearly does prove, and thereby explain, the former. Huh? If S is the union of Z and P, then for + to be a binary operator, you'd have to be able to add two pointers together. However, we could say that + : (Z x P) U (P x Z) -> P And thus the pointer arithmetic +
|
# ? Sep 20, 2009 20:28 |
|
Zombywuf posted:It is demonstably false, as can be seen from making the set S the union of the set of integers and pointers. But if we take S as the union set, then we have to admit + as a partial function, as (pointer + pointer) is a nonsense operation.
|
# ? Sep 20, 2009 20:29 |
|
shrughes posted:Huh? If S is the union of Z and P, then for + to be a binary operator, you'd have to be able to add two pointers together. Avenging Dentist posted:Binary operators are defined as a function f: S × S → S, and a and i are not members of the same set.
|
# ? Sep 20, 2009 20:37 |
|
ShoulderDaemon posted:But if we take S as the union set, then we have to admit + as a partial function, as (pointer + pointer) is a nonsense operation. With casting, anything is possible. code:
|
# ? Sep 20, 2009 20:41 |
|
Zombywuf posted:Is the false statement. a and i are trivially members of the set S = {a, i}. Still no good; if + were a binary operator on {a, i} then (a + a) would have to make sense.
|
# ? Sep 20, 2009 20:41 |
|
shrughes posted:Still no good; if + were a binary operator on {a, i} then (a + a) would have to make sense.
|
# ? Sep 20, 2009 20:44 |
|
Zombywuf posted:That's fine, just make it a. Even so, a+i would have to be in the set. This only works if i = 0.
|
# ? Sep 20, 2009 20:48 |
|
Zombywuf posted:That's fine, just make it a. I shudder to think of how you program C. EDIT: Oh by the way, your understanding of classical logic w.r.t. proof is adorable. Avenging Dentist fucked around with this message at 21:08 on Sep 20, 2009 |
# ? Sep 20, 2009 21:05 |
|
Avenging Dentist posted:I shudder to think of how you program C.
|
# ? Sep 20, 2009 21:08 |
|
Hey guys let's use the Zombywuf method of proof: Given "false", we find that Zombywuf is a bad logician since "false -> Zombywuf is a bad logician" is a true statement.
|
# ? Sep 20, 2009 21:10 |
|
Avenging Dentist posted:Hey guys let's use the Zombywuf method of proof: Given "false", we find that Zombywuf is a bad logician since "false -> Zombywuf is a bad logician" is a true statement. Sequent I totally didn't just make up posted:false → Zombywuf is a bad logician ⊢ Avenging Dentist is a bad poster
|
# ? Sep 20, 2009 21:31 |
|
cout << 0[your_good_posts]; Segmentation fault
|
# ? Sep 20, 2009 21:39 |
|
Otto Skorzeny posted:cout << 0[your_good_posts]; invalid types ‘int[int]’ for array subscript
|
# ? Sep 20, 2009 21:46 |
|
Otto Skorzeny posted:cout << 0[your_good_posts]; You're saying I have < 0x7fffaf0dd3cc good posts???
|
# ? Sep 20, 2009 21:54 |
|
Avenging Dentist posted:I shudder to think of how you program C. Maybe Zombywuf studied classical logic at the same time he studied probability theory.
|
# ? Sep 20, 2009 22:28 |
|
So I used to administrate this PHP shoutcast script (I didn't do any real coding, just forums/billing and poo poo). The guy who did the coding was alright, I was pretty young at the time and so was he so we didn't have a great idea in what we were doing, and as such this code I'm about to paste was produced. The TL/DR is that the application was basically for starting/managing shoutcast servers. This particular function starts shoutcast servers using the shell_exec() PHP method, which you may know was patched in version 4, since you shouldn't start running programs using this. Behold, this abomination: code:
ton1c fucked around with this message at 19:55 on Sep 21, 2009 |
# ? Sep 21, 2009 19:52 |
|
What's wrong with shell_exec?
|
# ? Sep 22, 2009 00:09 |
|
probably because it is a huge security flaw, unless all variables passed to exec and sql queries are thoroughly sanitized.
|
# ? Sep 22, 2009 03:23 |
|
RussianManiac posted:probably because it is a huge security flaw, unless all variables passed to exec and sql queries are thoroughly sanitized. It's not a flaw. It's a potential vulnerability if not used carefully.
|
# ? Sep 22, 2009 03:26 |
|
That script starts shoutcast servers as anonymous apache users.
|
# ? Sep 22, 2009 05:39 |
|
ton1c posted:That script starts shoutcast servers as anonymous apache users. so what
|
# ? Sep 22, 2009 05:53 |
|
geetee posted:so what yea its kinda confusing looking at that whole buncha code trying to decipher where horror is.
|
# ? Sep 22, 2009 05:54 |
|
Whenever I see PHP in this thread I just accept that there is a horror and nod my head before moving swiftly onward.
|
# ? Sep 22, 2009 06:21 |
|
Does using COM to run a program via WScript.Shell count as a horror? I don't really want to know why both that and exec are used about two lines apart.
|
# ? Sep 22, 2009 06:30 |
|
geetee posted:It's not a flaw. It's a potential vulnerability if not used carefully. Does gtbot shell out like this?
|
# ? Sep 22, 2009 09:11 |
|
yeah like that's a lot of php code and in any 20+ line chunk of php there's bound to be at least one horror but honestly using a shell exec command to start a server probably isn't it
|
# ? Sep 22, 2009 13:38 |
|
floWenoL posted:Does gtbot shell out like this? gtbot is written in the magical C# language.
|
# ? Sep 22, 2009 14:21 |
|
Plorkyeran posted:Does using COM to run a program via WScript.Shell count as a horror? I don't really want to know why both that and exec are used about two lines apart. COM is always a horror.
|
# ? Sep 22, 2009 14:38 |
|
Flobbster posted:Windows is always a horror.
|
# ? Sep 23, 2009 13:30 |
|
0.code:
|
# ? Sep 23, 2009 15:17 |
|
|
# ? Apr 28, 2024 00:28 |
|
Mustach posted:0. heh
|
# ? Sep 23, 2009 15:35 |