Hacker Newsnew | past | comments | ask | show | jobs | submit | patcdr's commentslogin

I've built a system that kinda does that: https://patcdr.net/carl/listing

tl;dr: People can build ASM modules on that site and load them into my game (when enabled) using chat commands. And it does work on my original SNES by using some SD2SNES trickery.


My first day at Microsoft, I was worried about this. This worry dissipated once I saw my boss's boss pull one out in a meeting.


I'd wager much higher than that. At the very least, I'm using Win7. Statistics on browser/OS usage from pg would be interesting though.


Seconding the request for Browser/OS Stats.


It actually runs better in IE8 than it did in Chrome on my work machine...


It still works fine if a and b are the same value.

Here's the general proof:

a ^= b (a = a ^ b, b = b)

b ^= a (a = a ^ b, b = b ^ (a ^ b) = a)

a ^= b (a = b ^ (a ^ b) = b ,b = a)

Now, let's replace all references initial values with constant c:

a ^= b (a = c ^ c = 0, b = c)

b ^= a (a = 0, b = c ^ 0 = c)

a ^= b (a = c ^ 0 = c, b = c)

Notice that at the end, you still end up with a = b = c. There are plenty of reasons not to use this approach, but that ain't one of them.


He meant if they are the same variable, not the same value. (E.g., you pass pointers to your function.)

  int swap(int * a, int * b)
    {
    (*a)^=(*b);
    (*b)^=(*a);
    (*a)^=(*b);
    }
  int x = 15;
  int *y = &x;
  int *z = &x;

  swap(y,z);  //Now *y == 0


The case in which it breaks is when a and b are the same variable, not when they have the same value.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: