HackTX 2013

This prototype was made in under 24 hours for the 2nd annual HackTX Hackathon in Austin, TX on Nov 15, 2013.

Our vision is to create hidden wearable tech that allows you to touch type like you would on any normal QWERTY keyboard, but in the air or on your lap. For products like google glass, an invisible keyboard would be much easier to interact with the device, and would also prevent you from having to talk to yourself in front of other people.

This prototype includes hardware (let me remind you none of us are hardware guys, thus the very un-invisible keyboard), an algorithm to predict which word you are trying to type, and a custom android keyboard that interacts with the hardware and can be used with any application on the device. We use a micro arduino to interpret signals coming from our invisible keyboard and send them to the android device, which in turn uses a custom input method editor to display possible candidates for words to be chosen.

It’s like what T9 did for cell phones with hard keyboards. Except there are 8 buttons instead of 9. And ideally they aren’t actually buttons, you just move your fingers.

My team members:
Anubhav Ashok
Sidhant Srikumar

Techie Takeaways

Sometimes the trickiest bugs are right in front of you. Also, they actually aren’t tricky at all so just pay attention to what you are doing

We spent a lot of time focusing on getting our serialized hash map which stored all possible words for each integer sequence into the android application. Anubhav worked on the algorithm to generate the serialized hash map, but when I stored that file in res/raw of android it wasn’t loading the data of our dictionary info. We spent around four hours trying to figure out why this was happening, decided maybe it was some strange serializable incompatibility between java versions and decided to serialize it to json instead using gson. Unfortunately, even loading gson from the android assets folder still didn’t fix our issue of loading the data structure.

I’m almost embarassed to say it but I spent way too long trying to track down a null pointer exception about 12 hours in. I’ll blame it on exhaustion. A global variable was getting allocated locally, so when I thought the candidates list was getting updated with possible words to present to the user, it was actually getting destroyed after that function finished executing. I was too busy looking for a more complex solution to a problem that was really simple and I should have that recognized sooner.

This ended our issue of loading the hashmap in from a persistent state, but for some reason our json was malformed and we were unable to actually get a coherent hash map generated. This was also a quick fix and only required a little flushing on Anubhav’s side ;)

Sidhant worked on several hardware prototypes and wrote up the code for the arduino to handle incoming signals. Anubhav worked on the algorithm for generating the serialized hash map which was our key into generating a candidates list for user input. I really enjoyed creating an input method on the android side. I initially started with a main activity and was just making a custom edit text to handle key events, but I realized that an IME would allow users to use the keyboard across the entire phone on any text input. I’ve only ever built an actual app that you can run from the home screen, so this was a great learning experience building something more behind the scenes.

Comments

Seamless SSH: Aliases and Passwordless Login

Much of my development environment involves using ssh and scp on a daily basis. There are a few easy settings that allow for a much easier way of connecting to other servers.

SSH Aliases

Normally, you can connect to another computer by using a command like this:

1
2
$ ssh username@hostname
username@hostname's password:

Two things can be optimized here. First, we can create an alias for our username and hostname. For example, we could create an alias “home” that represents our home computer ip address and login name. This will allow us to simply type in:

1
2
$ ssh home
username@hostname's password:

This can become very useful when you have to connect to random ip addresses that are hard to remember.  It’s very easy to set up:

First, we need to get to the directory where ssh settings are stored:

1
$ cd ~/.ssh/

If there isn’t already a config file, then go ahead and create one. To add our alias add this to the config file:

1
2
3
4
Hostname home
    Hostname 10.0.0.1
    User myusername
    Port 22

The Port setting is optional but comes in handy if you use different ports other than the default for ssh (22).

SSH Password-less login

So now we have an easy way to ssh to other machines without having to type in pesky ip addresses or cumbersome hostnames. But, typing in a password can still be time consuming if you are constantly logging in and out of servers.

Thus, the passwordless logon. For starters we must genearte asymmetric keys. I won’t enlighten you with the intricacies of public key cryptography but if you are interested wikipedia will always suffice.

First you will need to generate a public and private key pair. If you already have one then you can skip ahead to Set up login.

Generate the keys

First run ssh-keygen to generate the keys from the client machine. By default the keypair will be saved as ~/.ssh/id_rsa and the public key as ~/.ssh/id_rsa.pub, but you can specify a different name if you’d like.

Next it will ask you for a passphrase. Now I know I said this is a passwordless login. You don’t have to store a password for your private key, but if you don’t that means that anyone who gains access to your computer, either physically or remotely, can then compromise your keys. In effect, they could log in to any computer that you have authorized with your keys.

That being said, I recommend you create a password for your keypair. If you are using OSX you can store this password in your keychain and you will only have to enter it ocasionally.

Now you must store the client’s public key on the server you want to connect to.

Set up auto login

Run the following command to copy the client’s public key over to the server’s authorized_keys file.

1
cat ~/.ssh/id_rsa.pub | ssh home 'cat >> ~/.ssh/authorized_keys'

You will have to enter your password one more time for this command to complete.

After the public key has been appended to the server’s authorized_keys list you should now be able to ssh into it without a password!

Combine that with an alias and all you have to type is ssh home

Voila.

Comments

Harbinger

I have teamed up with writer/director MacGregor Greenley and producer Sofia Sada this semester to help shoot our undergraduate thesis film Harbinger. It follows Charlie Day, an employee of a courier service that delivers bad news, so you don’t have to. As an employee of the Bad News Bearers, Charlie has become sucked into a world of callousness, drifting away from any sort of sane or tactful interaction with the people he delivers his news to.

The story revolves around Charlie Harbinger who works for a bad news messaging service, where he is essentially responsible for having those often awkward, mostly uncomfortable and generally unpleasant conversations in which someone is fired, divorced or dying. He acts as a surrogate, delivering the bad news for you so you don’t have to. With a job like that you can imagine how light and whimsical his life is (read: not light or whimsical at all).

His story changes dramatically when he runs into Miriam Day who sort of forces her way into his life and ruins his perfectly timed, tried and true method of doing his job while avoiding any and all personal connection. When she shows up, a new narrative begins capturing the transformation of a militant isolationist, challenging Charlie to feel many of the things he has so long avoided.

Of course, we can’t spoil the ending for you, the only thing we can tell you is that the main character isn’t dead the whole time (Or is he? He isn’t). Instead we’ll ask for your patience and provision so that we can make any of it (the end included) happen. There will be comedy, there will be drama, there will be bad news to spare. If you want to see how it all unfolds, now is your chance to make sure you can. Donate today!

Comments