Sunday, December 11, 2011

My first bug fix!

So I just pushed a bug fix to the Tweepy library. I found a bug here: https://github.com/tweepy/tweepy/issues/41 that seemed like low hanging fruit. The loop that was reading information from the server response was very naive and basically assumed there would be no problems. I changed it to check the server status before each loop. This should solve the problem.

Pull Request: https://github.com/tweepy/tweepy/pull/139

Diff: https://github.com/tjr1351/tweepy/commit/d459ab929b18409534f15920e32ff35d0adc36f7

Although the change itself is not huge, I had to do a bit of research to figure out how to get the server status and then what status numbers to look for.

Node.js for gaming

So I'm taking a class now that is focused on open source social/ casual games. We're focusing on creating games with javascript and html5. Because of this I've decided to use Node.js to help write my game.

Node.js is a server architecture written in Javascript that allows for very easy, fast web applications. One of the huge benefits of Node.js is it's callback structure. It wraps a lot of costly, slow operations such as file system calls and database queries in a callback that does not block. Also, everything is run on a single process so, unlike other server architectures, it's very easy to see what users are online and pass information between them or two certain groups. Both of these features make it very easy to create multiplayer games.

I recently found an awesome blog post by Daniel Baulig showing how to link a Node.js server to a libary called Socket.io. Linking the two libraries to the same session ID allows you to now send dynamic messages to the client using a socket FROM your server. Normally with no configuration these two libraries run independently and cannot be called from within one another.

I'm still not sure what I want to do for my game but I'm leaning towards some sort of MMO turned based strategy game. Maybe one where it queries popular open source websites for your user name and gives your character bonuses based on your open source contributions.

Here's some other good Node.js references:
Express.js
Socket.io
nodetuts.com

Wednesday, August 10, 2011

POSSE Hackfest '11

I'm currently hanging out with the Foss Box and some professors from various local schools. We're trying to teach them about all things open source. I've been playing with Open Video Chat again to see if it works on the newest Sugar build. Sugar 0.92.2 is now running on Fedora 14. Hopefully this means it either has the version of Telepathy we need or we can install it. I was able to get OVC running on two XO's and connected them. When it tried to connect the pipes I got an error though. Seems to be a break at a file open :/ I'll have to look at this more.

Side Note: The XO's automagically start an adhoc network and connect to eachother again! WOOOOO!

Friday, July 22, 2011

jQuery VideoBox

jQuery VideoBox is a modification of jQuery LightBox designed to work with local video sources using Html5. Video formats currently supported: mp4, ogv, and webm. Source code and download can be found on GitHub.


Currently tested on Firefox 5. Please let me know if you have problems with other browsers.

I should be updating GitHub soon with a detailed user manual. For now consult the example index.html.

Monday, July 18, 2011

Prototype

Just got some web hosting space from my friend Greg. We were trying to get some space on the Foss@Rit servers but they aren't ready yet. You can find our prototype at http://gregjurman.com/trose/firstemt/. We deleted the video so we don't nuke his bandwidth. ^_^

In other news... I got the jQuery plugin working. It's still just a hack so I'm not going to publish it yet... I need to clean the code up a ton before then.

Wednesday, July 13, 2011

RIP Gnome3 Hot Corner

FINALLY!

After weeks of anguish I have finally figured out how to disable the hot corner on Gnome 3 that has been the bain of my existence since switching to Fedora 15.


What's the problem with a Hot Corner?

Well if aren't familiar with Gnome 3 there is an Overview that allows you to quickly open programs and switch between currently open ones.
The hot corner is in the top left corner of the screen and activates when the cursor is in the (0,0) coordinate. The problem with the hot corner is that you often accidentally activate it when trying to click things close to the top left corner. It's also highly redundant since the "Activities" button there has the same functionality. Personally, when I want to use the Overview I just hit the super key (windows key).

The Solution

You need to modify the javascript backend for gnome panel. Yeah Gnome 3 is partly in javascript... You'll find the necessary file under /usr/share/gnome-shell/js/ui/. Next you want to open panel.js in your favorite text editor. I like Geany :P You'll need to find this line:

this._corner = new Clutter.Rectangle({ width: 1, height: 1, opacity: 0, reactive: true });

and modify it to say "reactive: false". This will disable the hot corner functionality without disabling Overview.

I found this solution here and credit goes to Jinx.

Monday, July 11, 2011

Success!!! kind of...

So I've got an interactive webpage made that dynamically generates buttons based on an xml file. It even updates on the fly with a drop down menu to switch between languages. One small problem though... the javascript I hacked together to make the pretty video popups is scanning the page before the other javascript has dynamically populated the page. So basically the video isn't working at all. Tomorrow I'll have to look at possible solutions. I think the best route is to actually get around to finishing jQuery-izing the video plugin. Then I can just attach a listener to a <div> and link it to the video proper. Luckily tomorrow is the Foss@Rit hackfest so I'll have plenty of time ^_^

Tuesday, July 5, 2011

TIL Javascript

So I've been banging out my javascript video plugin. Turns out there's more work to do than I thought. I plan on making it fully jQuery compatible as it currently doesn't play well with the other jQuery elements we're using.

We just had a meeting with Dr. Sutton and he likes our prototypes so far. Next step is to start adding functionality. Our two week goal is to add basic clinical questions. We will model it off of the interaction that receptionists typically have with patients when they first come in. While I'm waiting for example questions from the clinic, I'm going to start creating a dynamic internationalization system. basically all text in the program will be assigned to variables. Then in the backend each variable can have multiple translations stored for it. If we do this right we can make it simple for non-technical humans to add new questions and translations.

Updates later :-)

Tuesday, June 28, 2011

Webpage Prototypes

I've been prototyping First EMT using html5 and css3. Things are starting to look pretty sexy. Right now I'm trying to find a work around to display video in a pretty popup. My first thought was the lightbox jQuery plugin. That doesn't support video though. There doesn't seem to be a very good video alternative with the same look. I think what I'm going to have to do is hack something together that looks similar. I'll post a tutorial tomorrow with the best method I come up with.

In other news, JT and I are going to start putting our prototypes online. We're going to put our source up on github tomorrow. I also want to look at hosting the webpages on Red Hat's cloud app service, Open Shift. Updates tomorrow.

Thursday, June 23, 2011

Design Design Design

They say you should always measure twice and cut once. Well that's our take to project design. This past week we drew up a bunch of paper prototype interfaces. These are basically just pen and paper representations of our interface layout. JT and I had several potential users look over the paper diagrams and give us input. We ended up making a great connection with Matt Purcel, President of the RIT Ambulance. Doctor James Sutton was also able to give us a lot of great input about how to improve our design.

Now that our design is coming to fruition I can finally start coding. Time to start reading up on HTML 5, CSS 3.0 and Javascript. If I run into any interesting problems I plan on writing up a tutorial here.

Thursday, June 16, 2011

Design concerns in a multilingual application

One of our biggest design concerns for First EMT is creating an interface that is universally accessible regardless of language, culture, or education. To make language selection universally accessible we are using a combination of a flag icon, text, and audio stating the language a button selects.

One part of the program will have phrases that a health care provider may want to say to a patient. We originally were going to record audio of each phrase. After speaking with Dr. James Sutton we actually learned that some cultures can be pretty "freaked out" by random talking boxes. As a solution we plan on recording video of translators speaking. This will also allow us to incorporate American Sign Language.

Monday, June 13, 2011

Internationalization in PHP


Our current game plan with First EMT is to build a Javascript and PHP web application so I've been looking at ways to do internationalization in PHP. If you're writing code that needs to be accessible in many different languages, internationalization is a must. Instead of hard coding text you create a variable for every body of text in your interface. Then you store translation files for every language your UI must support. By changing your locale variable you can quickly and easily switch the language your UI displays. If you make the translation files human readable it is also very easy to add new languages by simply hiring a professional translator for a few hours of work.

My first searches seemed fruitful... I found this documentation describing Resource Bundles. It seemed great until I noticed it was under the header "Future Directions". I'm a fairly proficient programmer but I'm certainly not ready to write a patch to PHP... time to look at other options...

The best option I've found so far is called Zend_Translate. Zend's translate framework is really flexible. You can provide something as basic as arrays of words to translate or as complex as importing a Translation Memory file and dynamically translating everything. For my purposes I think I'm going to use the TMX adapter. TMX is an extension of XML and it's an industry standard for this sort of application. It can be modified in any XML editor which makes it very easy to add new translations. An example TMX file would be something like:


  1. <?xml version="1.0" ?>
  2. <!DOCTYPE tmx SYSTEM "tmx14.dtd">
  3. <tmx version="1.4">
  4. <header creationtoolversion="1.0.0" datatype="winres"segtype="sentence"
  5.         adminlang="en-us" srclang="de-at" o-tmf="abc"
  6.         creationtool="XYZTool" >
  7. </header>
  8. <body>
  9. <tu tuid='message1'>
  10. <tuv xml:lang="de"><seg>Nachricht1</seg></tuv>
  11. <tuv xml:lang="en"><seg>message1</seg></tuv>
  12. </tu>
  13. <tu tuid='message2'>
  14. <tuv xml:lang="de"><seg>Nachricht2</seg></tuv>
  15. <tuv xml:lang="en"><seg>message2</seg></tuv>
  16. </tu>
  17. </body>
  18. </tmx>


This example is straight from the Zend Framework website.

Wednesday, June 8, 2011

Research

Starting to find some good articles to use for our project and the paper later on in the summer. I'm going to aggregate them here for my own use :-P

These articles will be good for pointing out the existence of language barriers and the problems they cause in the medical profession:

Lost in translation? pediatric preventive care and language barriers
http://www.sciencedirect.com/science/article/pii/S0022347605011194


Language barriers and the use of interpreters in the public health services. A questionnaire-based survey
http://www.sciencedirect.com/science/article/pii/S0738399110002697

One of the ideas we've been throwing around was a what-if scenario where ambulances could have a 3G connection and send information from the tablet to the hospital before the patient arrives. It turns out this has already been an idea.

http://v-scheiner.brunel.ac.uk/bitstream/2438/2430/1/Ambulance%203G.pdf

We'll have to see if the Rochester area ambulances have 3G connections.

I am also interested in the translation aspect of the project. I want to make sure whatever translation we're using will be correct. Often times machine translation will have errors. This is obviously unacceptable for medical practice. We may need to look at simply providing hard-coded translation for the forms and leave MT for the open ended, less-important questions.

open source translation: http://www.apertium.org/

Tuesday, June 7, 2011

First EMT

So I'm doing research again this summer. This time around I'm working on First EMT. First Encounter Medical Translator will be an EMT assistant providing several multilingual or language independent tools for first responders. I'm going to be working with my buddy JT throughout the summer. You can follow his blog here: http://www.jtmengel.com.

Medical professionals today run into problems with patients who do not speak English. Obviously they must help these people but communication can be very difficult. We're going to design a tablet-based system that will allow first responders to gather data in a number of different languages. It will also have a diagram of a person where a patient can zoom in and let an EMT know where they're injured. We may also add a page where an EMT can pull up common questions in several different languages so they can verbally ask things like "who is your primary doctor?" or "do you have any allergies?".

This first week we will be writing up the design documents and figuring out exactly what our user experience is going to be. I'm also going to be researching options for translation since Google is dropping their translation API (link). Moses looks like a good alternative. I'll be posting more information on it as I learn more.

I'm very excited about this project and can't wait to get cracking hacking.

Tuesday, February 1, 2011

Rochester GREAT Student Achievement Award

So Justin, Fran, and I received a Rochester GREAT Student Achievement Award tonight for our work with Open Video Chat. Thanks to Remy DeCausemaker and Steven Jacobs for making this possible. Special thanks to our project advisors Luke Macken and Mel Chua :D


p.s. Sorry about the squinty face, I can't deal with camera flash :(

Friday, January 28, 2011

PHP: SUCCESS!

I've got an upload form working on the Rock Climbing Club staging server. As soon as I get the time I'll create and populate a database on the production server and push this live! Now officers will be able to upload photos with the click of a button. Next I want to look at possibly moving to a Flickr API or, if that fails, write a graphical interface with delete functionality. If you haven't yet, check out the club's website! http://www.rit.edu/rocks/ Now with 100% faster picture uploads!

Monday, January 24, 2011

PHP mini-project Update

I hit a small roadblock this weekend trying to get file uploading to work. That plus my AI homework really slowed down the project. I'm still banging away at it. Today I managed to get uploads to the web server. Next steps: Get the uploads to the right place. Password protect it! (O_O) Then I'm going to get the app pushing information to a database. From there I'll get the front page of the website reading information from that database.

Thursday, January 20, 2011

PHP: Photo Hero Project

So I'm the webmaster of the RIT Rock Climbing Club. What this basically means as far as the club is concerned is that I'm the only one that knows what a terminal window is. I figure since I know a thing or two more than that I should write some code to help future members of the club. So here's my idea:

Right now the club's front page has a slideshow of club members doing club-y stuff.(link) The members of the club wish to be able to change the images in the slideshow from time to time. Right now the current system is for them to send me an image. I crop the image to the right resolution and send it server side using sftp. Then I have to modify the index.php file to include the new image + alt text. The final step is using RIT's web manager to push everything to the production server. This is all really basic and easy since I program. However in the future the club might not have a programmer available to do this.

My goal this weekend is to create a web interface for uploading and deleting images from the slide show. This should allow club admins to easily modify the front page of the website.

Goals:

  • Simple web interface to upload and delete images from the server
  • RIT LDAP authentication using a database of admin user names
  • Database storing image location on server + image information (photographer, alt text, etc)
  • modified index.php with generic data structure filled with info from the database
I only have passing knowledge of both PHP and SQL so this whole project should be rather interesting. I don't think it's going to be incredibly hard. Most of the work should be researching how to do the things I want in PHP.

Useful links: