Programming with RSI

9 months ago during an average day of programming I was surprised to notice my wrists were feeling sore.  Having spent the last decade writing software without any RSI problims, I quickly dismissed the pain and marched back into eclipse.  Less than a week later I was losing a battle to unmanageable pain and unable to type, convinced that I was done with the career I loved and headed for surgery.  Since this time I’ve seen specialists, started therapy, tired (almots) every mythical cure I heard and adjusted my life to find a manageable lifestyle that lets me live my life.  I’m no Doctor, but here are some adjustment that worked for me.

377350_706121315068_700028_34936289_1874563516_n

Trying out some new keyboard combinations


Time Sensitive
When you notice RSI symptoms don’t just see a doctor right away, start active treatment right away.  
After my pain started I knew to take RSI seriously and went right to my Doctor.  We did the standard carpal tunnel tests and I left the doctor with confidently diagnosed with bi-lateral Carpal Tunnel with instructions to return in 4-6 months if problems continued.  Big mistake.  By the time I returned and was sent to therapy, Carpal Tunnel was the least of my problems.  When you’re dealing with RSI, start active therapy immediately.


Not just Carpal Tunnel
RSI is not just Carpal Tunnel.
When I finally started therapy I had been doing 4 months of Carpal Tunnel stretches on my own.  I was very lucky to have a therapist that took the time to independently assess my arms and helped my understand that that I was really dealing with a combination of Carpal Tunnel, Cubital Tunnel, Thumb Tendinitis and Forearm Tendinitis.  Not fun, but looking at how your arms function it’s not surprising to see these tied together.  After months of solo treatment for the only injury I had heard of, we started treating what I had.  Don’t shortchange new or aggravated symptoms and don’t accept a diagnosis that doesn’t fit all of your pain!  We’re all different and so too can be our injuries.

Loosen Up
Painful arms are tense arms.  Tense arms aggravate RSI.
When my symptoms first worsened I found myself  walking around with unconsciously clenched fists to fend off the pain.  Having tense arms aggravated tendons, weakened muscles and did not help healing.  Making a conscious effort to keep my hands loose, open and out of my pockets finally gave my arms a chance to rest and recover during the day (also this makes you look professional!).  I’ve made ‘loose arms’ a constant mantra: if there’s pressure, tightness or strain on your arms you’re not helping yourself.


Sleep
Nightly recovery or aggravation?
You’re almost positively not coding in your sleep, but are you giving your arms a chance to recover?  Sleeping with wrist braces helped make sure my posture was good at night, but it took several months for me to realize awkward contortions and laying on my hand/arm was aggravating my arms.  I finally accepted that my girlfriend was right: I needed new pillows.  Even after a long day on the computer now, a good night’s rest with straight, loose arms can re,charge me fully for the next day.


Ergonomic
Use the right tools
This a big topic and should be driven by common sense.  When my problems first hit, I was using a stiff keyboard, mousing on the other side of my desk with my macbook’s trackpad and wresting my wrests on metal or a sharp table edge.  I was pushing my luck.  I’ve since re-imagined my home and work setups around a straight posture, a comfortable ergo keyboard and a setup that minimizes any repetitive motions.  After spending over a grand on new keyboards, my biggest and most worthwhile investment was a Kinesis’ split concave keyboard.


These adjustments have helped me get back to work without the tortuous pain I once had.  If you’re suffering from RSI then I hope researching your specific problems, listening to your body and some of these tips will help you live a less painful life and keep on hacking without shouting into an error-prone speech toolkit. If you have your own tips or information please share below, because there's always a better way :)

Push SMS with Google Voice and Speech Synthesis

Since Google Voice's introduction there has been an easy way to command your homebrewed applications via SMS.  This tutorial shows you how to push texts directly to a python application, and as a fun demo I use OSX's speech synthesizer to speak each received message.  You can find me @rwitoff with any q's.
Step 1: Forward your google voice texts to your gmail account.
Pasted_graphic_1
 
 
 
Step 2: In the gmail account that you forwarded your texts to, create a Filter that catches these forwarded texts with the following parameters, then click on 'Next Step'
Pasted_graphic_3
 
 
Step 3: Elect to forward this filter to your IP address.  (replace 127.0.0.1 with your public IP).  This step will push an SMS directly to an SMTP server running on your machine!
Pasted_graphic_4
Step 4: Publicize port 25 on the computer that will receive these texts.  You may need to open this port in any firewalls, and forward your router's port to this machine.
Pasted_graphic_5
Step 5: Run an SMTP mail server on your local machine to receive all of these texts from google voice, through gmail.  Save the below python example to SMTPSpeaker.py on your machine, and replace my 192.168.1.118 with the local IP of your machine.  Finally, run your server with 'sudo python smtpspeaker.py'.  
*OSX needs sudo privileges to bind to the SMTP port 25
Test it out by sending an SMS to your google voice number and listen to your computer speak back the message!
Pasted_graphic_7
And again, without color but copyable:
import smtpd, asyncore, re, os

class SMTPSpeaker(smtpd.SMTPServer):
    def process_message(self, peer, mailfrom, rcpttos, data):
        find = re.search('Content-Type: text/plain.*?\n(.*)', data, re.DOTALL)
        if find and len(find.groups())>0:
            msg = find.group(1)
            print "The message is: %s" % msg
            msg_clean = re.sub('[",\',!,@,#,$,%,^,&,*,(,)]', '', msg)
            os.system('say "%s" ' % msg_clean)
        else:
            print "no message found"

#put your IP in here!
server = SMTPSpeaker(('192.168.1.118', 25), None)
asyncore.loop()