Monday, April 1, 2013

Broken

So I was reading this. And I can see where she's coming from, but I have to disagree. In particular, I have to disagree with the position that "a statement that you [as a physically disabled person] are different in a way that needs to be fixed" is hurtful.

I think it's great to be positive about our various different abilities. I think that the indomitable human spirit is the one thing that stands between any seriously disabled person and despair. More than that, I feel that this spirit allows people who've been dealt a really unfair hand to not only play, but win, every day. All of us have this human spirit; all of us are capable of amazing feats of perseverance when we have no other option. What truly sets disabled people apart is that they are pushed to it. They're forced to carry on in the face of their disability.

The usual stance these days is that if you can't do something that a healthy, fully functional human can do, then that's A-OK and it's awful to even suggest that you suffer or feel any kind of inconvenience because of this. This shits me deeply, on a basic, fundamental level, because it is trivialising the struggle that every single disabled person faces on a daily basis. It is telling them that there's nothing wrong with them, that they should be happy with what they have instead of wanting a fully functional body.

Like many others, I have myopia. I am unable to focus my eyes beyond about 25cm from my face without artificial assistance. My eyes are built wrong, whether due to genetics or me reading too much during my early teens, I don't know, but my lenses and/or corneas do not focus light properly. I don't get all outraged if someone acknowledges the fact that I can't see for shit without my glasses. It's a fact. I couldn't read inch-high text from more than a meter away to save my life. I couldn't drive a motor vehicle without optical correction. I'm very lucky that, thanks to science, I can buy glasses and while I'm wearing them this problem is completely fixed.

I am this lucky because, over the course of human history, smart and hardworking people have decided that being myopic is a difference that needs to be fixed. And now, thanks to their hard work, I have several options to repair or work around my disability.

Back to the article I linked at the start. The author wants others to see disabled people as people who "don’t see their physical or mental limitations as things to be fixed by outsiders, but rather something that is part and parcel of who they are." This is just cognitive dissonance at play. She has accepted that she's unable to fix her disability, and so she's convinced herself that it is a good and proper part of who she is and who she should be. She states that "because of a brilliant surgeon and supportive hospital, I have a body that works." At one stage surgery improved her condition, but at some point between then and now (and despite the fact that she still describes her condition as a 'hindrance'), any suggestion of further improvement became hurtful.

I guess my message here is that we need to see the person, not the disability, even when that person is us. We need to be strong enough to accept that there is a beautiful, vibrant, caring, loving person who, unfairly, through no fault of that person, is trapped in a faulty vehicle. We need to see the difference between the person, and the vessel in which they currently reside. And we need to agree that if that vessel is faulty, it is up to us to repair it, not as some indictment of the person residing in it, but as a service to enable that person to live their life as they should always have been able. If fixing it is impossible with current science, then it is up to us to advance science to a point where a fix is possible, so that eventually no person will have to live with that disability. If something is hurting you, something is impairing you and stopping you from reaching your full potential, then this is not OK. You deserve to be able to have this problem fixed (if you so choose), to allow you to continue unhindered on your journey through life.

Any less is not enough.

Wednesday, March 6, 2013

The Little Death

Philosophy time. This is something that's been worrying me for a few weeks now... and I don't know if I should even be worried about it or happy about it.

It all started through a bunch of discussions we had at work, talking about whether if you magically created an atomically identical clone of yourself, and destroyed your original body at the same time (as happens in most realistic ideas of teleportation), would that clone really be you? Sure, the clone would feel that it was you, but would you (whatever that means) still experience living on as the clone? The usual response was that no, because that clone had no continuity of experience with you. It wasn't the same person because at some point, it had not had the experience of being you. But you had that experience, and so you were the same person.

The thing is, every single discussion I've ever heard on this topic hinges on the fact that I am me because I've always been me, and I have a continuous unbroken chain of continuity between the first me that I remember and me now.

I don't think that's the case. I think we're taking for granted something that we have assumed but never really shown; that just because usually, moment to moment, our experience of this world is continuous, that we have some magical property of continuity of experience. And that we, being people, are somehow special because of it.

When you go under general anaesthetic, it's not dark or fuzzy. It's not black. It's nothing. You don't exist and then as you come out from under it, *bam*. Suddenly you are awake and sensing and perceiving and it feels like it never left off... but it did. There's a gap in there, hours long, where you were a not-person. "You" didn't exist.

Every time you are truly, properly unconscious, you die. When your body recovers and starts processing information again, you are reborn. Is it really you? It's the same types of atoms in the same configuration, but then again so is the teleported clone in the first example. You can never cross the same river twice. In the same way, maybe we die and are reborn every once in a while... or every day, or every instant.

Something to think about.

Friday, July 27, 2012

3D Vision Is Broken With Multiple Monitors

More accurately, "My Asus VG278H won't enable the IR emitter and synch with the 3D Vision 2 glasses that came with it, unless it's the only monitor attached to my computer, or the 3D application in question is running in a windowed mode." Diablo 3 works fine in 3D (but I run in Fullscreen Windowed), but none of the other games I have (all via Steam) work. They appear to be rendering both views but my monitor refuses to activate the IR emitter and synch up with the shutter glasses. Disconnecting my second monitor, for some reason, makes the IR emitter work. Hurrah.

Monday, August 1, 2011

Constructing a Diminutive Velocipede

This is something I've wanted to do for a while, and a week ago I bit the bullet and did it.

Required bits:
  • A 26" mountain bike

  • A 10" - 12" scooter or child's bike

Required utensils:
  • Hacksaw

  • Angle grinder

  • Some form of welder

Begin by cutting the front off the bike with the hacksaw, at the red lines shown below. Also, cut the handle bars shorter (I cut just inside the stock handgrips) and remove the stem that holds the handle bars in place. We'll weld the handle bars on directly for a more scale appearance.

Once you've done this, use the angle grinder to shape the stub of the stem so that it fits neatly with the shortened handle bars. Clamp the bars in the right position, tack weld them in place, and when you're happy with the alignment, weld them on. Remember to always clean any paint, rust etc. off the metal surfaces before welding.

Cut the seat post to length (I made mine around 100mm long), once again shape it with the angle grinder so that it fits neatly on the top of the down tube, and weld it in place. This geometry isn't very strong, so cut a short length of pipe (I got mine from one of the seat stays) and use it as a brace to support the seat post. You can see the seat post support propped in place ready to weld.

In order to get a better shape to the frame, I simply cut a wedge out of the down-tube (leaving it attached by a strip across the top) and re-welded it in place. In this picture you can also seat the seat post support properly welded in place.

Next, I needed a rear wheel. At the recycling station near work, I found a kids' 10" scooter which fit the bill.

It was a simple job to neaten up the cut end of the frame, cut off the scooter's front fork, and weld it in place at the rear. I'm still very new to welding, and the wall of the tube on the right is maybe 2mm thick, so I had a hard time making them stick without blowing a hole in the tubing.

You should now have something ridable, but the colour scheme leaves somewhat to be desired.

As this was to be prop for The Great Steampunk Affaire, bare brushed metal was fully appropriate. However, I plan to paint the frame black to prevent corrosion.


I'd initially planned for electric propulsion, but it ended up being quite practical to merely kick it along until I got up to speed, and then coast for a while. It was certainly a lot of fun on the night. :D

Friday, March 25, 2011

Pascal's Wager

I'm sure we've all heard of Pascal's Wager in some form. The general logic runs that "if there is no God, then what I believe holds no consequence, but if there IS a God, then believing in Him is a significant net benefit." This makes a lot of sense... in fact Blaise Pascal himself trusted it to get him out of any awkward situations in which, after he died, he discovered that there in fact WAS a God.

What's kind of scary is when you reverse the logic. "If there is, in fact, a God, despite the utter lack of any rational evidence of Him - then I'm screwed, because I chose to take the path which I was created to take. If there is no God, then religion, that structure which we humans have created around the presumed existance of an irrational, pathological creator, has caused more harm than we know how to repair."

Monday, November 15, 2010

Creating a std::iostream socket class (Part 3)

So far we've covered implementation of a custom stream buffer that can be used with standard library functions. Now all that's left to go is the actual socket code itself! For more information on modern socket programming, I highly recommend Beej's Guide to Network Programming. It's simple, easy to read, and covers what you need to know as you need to know it. It's also the reference I used while implementing my socket code. :)

Connecting to a server is done in three steps: Resolve the address, create a socket, and connect the socket to the address. Resolving the address looks like this:
  addrinfo hints, *info, *cur;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  int ret = getaddrinfo(host.c_str(), port.c_str(), &hints, &info);
  if (ret != 0) handle_error();


Once we've resolved the address, we create a socket. Since getaddrinfo() returns a linked list of address results, we need to find one that has an address type we can connect to. This way, it will automatically use IPv6 if that's all that's available. Once we have a connected socket we can free the returned address info.
  for (cur = info; cur != NULL && m_data->socket == -1; cur = cur->ai_next) {
    m_data->socket = socket(cur->ai_family,
      cur->ai_socktype, cur->ai_protocol);
    if (m_data->socket != -1) {
      // we can bind via this protocol, can we connect?
      if (::connect(m_data->socket, cur->ai_addr, cur->ai_addrlen) == -1) {
        ::close(m_data->socket);
        m_data->socket = -1;
      } else {
        m_data->remotehost = host + ":" + port;
      }
    }
  }
  freeaddrinfo(info);


To read from the socket, use either read() (which works with all file descriptors) or recv() which also takes socket-specific flags. Note that by default, either will block if there's nothing to be read yet.
  int num = recv(m_data->socket, m_data->buffer, BUFSIZE, 0);
  if (num <= 0) handle_socket_closed();


To check whether there's anything to read on a socket, use the select() function:
  timeval waittime = { 0, 0 };
  fd_set readset;
  FD_ZERO(&readset);
  FD_SET(m_data->socket, &readset);
  select(m_data->socket+1, &readset, NULL, NULL, &waittime);
  if (FD_ISSET(m_data->socket, &readset)) read_socket_data();


If you want to listen for incoming network connections the setup is slightly different. We use a 'listener socket' which listens on a given port, and then when a connection attempt is made, a call to accept() will return another socket which is connected to the remote client.

To listen:
  // bind to the requested port
  addrinfo hints, *info, *cur;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_flags = AI_PASSIVE;
  int r;
  if ((r = getaddrinfo(NULL, port.c_str(), &hints, &info)) != 0) return false;

  // try to get a socket to bind to the port
  for (cur = info; cur != NULL && m_data->socket == -1; cur = cur->ai_next) {
    m_data->socket = socket(cur->ai_family,
      cur->ai_socktype, cur->ai_protocol);
    if (m_data->socket != -1) {
      // insert lame joke about rings here
      if (bind(m_data->socket, cur->ai_addr, cur->ai_addrlen) == -1)
        close();
    }
    }
  freeaddrinfo(info);

  // if we have a socket, listen on it
  listen(m_data->socket, m_data->backlog);

  // accept the incoming connection
  sockaddr_storage addr;
  socklen_t addrlen = sizeof(addr);
  sock.m_data->socket = ::accept(m_data->socket, (sockaddr *)&addr, &addrlen);
  if (sock.m_data->socket == -1) return false; // fail :(


So there you go; almost everything you need to know to write socket code. And if you just want something that works, here's the full source of tcpstream.cpp and tcpstream.h. I've released it under attribution license, so feel free to use it in whatever projects you want, commercial or otherwise.

Saturday, November 13, 2010

You can't reuse ports within 60 seconds

As the title says, just a little gotchya I ran into. After having an open socket on a port, you can't bind another socket to that port for some specified timeout time afterwards. My test program for my tcpstream class worked fine, but if I tried to re-run it, I couldn't re-bind to the port I was using until a short while had passed. After an hour or so of trying to figure out why my socket wasn't closing, I finally found that it was actually Working As Intended(TM). It's fully explained in this post:

The short answer is:
"No, you may not re-use the port for the first 60 seconds
after a bound socket is closed (explicitly or because
the program exited)".