Putting the magic in the machine since 1980.

Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Wednesday, November 6, 2013

iMedTracker: Offline Webapp for Tablets

The scheenshot on the right is of a webapp I developed to help track the movement of nurses in a hospital. The webapp is to be used by someone tracking a nurse and is optimized for iPads. The user taps on each event as it happens and the app records the time and duration of all events.

The app uses jquery mobile and localStorage so all the data is stored on the iPad, since there is no wifi on the hospital floor (that we can use). At the end of the day the user can then upload all the data to the server by the click of a button.

We then use this data to feed our 2D Netlogo models, and 3D Unity models, which you can learn more about by reading some of our recent papers.

This work is part of research we are doing with the School of Nursing into building agent-based models of workflows inside a hospital, and how these might be used to help reduce errors, and optimize flow.

Android and Speech Recognition Hacking

As part of this project, I developed an Android app that uses the built-in voice recognition to let nurses check items for a patient as he is getting ready for surgery.

Voice recognition is was found to be not good enough, for some words. We are examining possible ways of post-processing the results that come back from Google in order to improve the accuracy, for our domain. For this, I am starting with simple Bayesian learning techniques, but, we might try other techniques in the near future.

The app you see on the right was just for testing. I have another app which implements the actual checklists. We plan to tie it to the hospital's Electronic Medical Records systems using their REST API. Fun stuff!

As always, if you are a USC student (grad or undergrad) interested in hacking on think kind of stuff, just email me. We are also building 3D simulations in Unity.

Friday, February 10, 2012

Interactive Quiz Web Application

The video below is a short demo of a little webapp I developed for Julia Englund, Psychology Department, for giving interactive tests to (young) kids. The kids go to the website, take the tests, and their results are automatically sent back to the server. Julia designed the tests, I merely implemented the program. The app uses jQuery and the soundmanager.js library for handling sounds. It is an example of how one can build desktop-like interactive applications using javascript.


Sunday, June 12, 2011

iPad App for Taking Surveys

I've been playing around with mobile webapps and JavaScript toolkits like Sencha touch and jQuery mobile. With all the news about native iphone apps, a lot of people forget that one can easily build iphone/ipad webapps that work offline and let you bypass the Apple store (so, no waiting weeks for approval, just upload it to your own website).

Dr. Jim Thrasher, from the Arnold School of Public Health, asked me to build an iPad app for his survey-administrators to use in administering surveys. The iPad is used to randomize questions and store all the survey answers, which are later uploaded to the server, when an Internet connection is available. The server is a google appengine web app.

Lessons learned:

  1. Offline webapps are possible (almost too easy) on the iPad/iPhone. But, I had to train the users on how to clear the Safari cache whenever I put out a non backwards-compatible version.
  2. A JavaScript toolkit like jQuery mobile or Sencha touch is needed for all its widgets. We need more widgets: this is probably the biggest current limitation.
  3. My app auto-downloads and installs the latest version the moment it is run, kinda like Chrome, thus enabling a fast development cycle.

Friday, May 6, 2011

A Webapp for Turning in Programming Homeworks

Since I had to grade about 20 programs every week and since these howeworks were webapps themselves that would be posted on some website that I could test, I figured that best way would be to have a pastebin-like app that allowed me to view all submitted homeworks. No such thing existed so I built one and called it i-am-done.

I used it last semester and it works very well. I allows one to:

  1. create a class, and homeworks for it, giving each one a due date,
  2. get a simple URL to give students for turning in programs for that homework,
  3. view all the submitted howeworks for each student, in nicely colorized code thanks to prettify,
  4. students can upload and delete any number of files associated with a particular homework but, of course, they can't see anyone else's homeworks.

It is like a paste-bin where only the person that created the class can see the code pasted under that class. I have placed the code here in case someone wants to make a fully featured system out of it. I would loooove to see that.

Tuesday, December 28, 2010

Sending Emails from a Google Spreadsheet

I have been using Google Spreadsheet to keep my class grades for a couple of years. It has several advantages over the PC version:

  1. I can share the spreadsheet with my TAs so they can enter grades for their labs. We are all always on the same page.
  2. Google spreadsheet keeps track of all old revisions, so if any one of us makes a mistake we can always go back to see what the original grade was.
  3. It is trivially easy to create a graph of the grades and post a link to it on the class blog. The graph gets updated automatically as the grades change.

However, one remaining problem was how to give each student his grades without revealing all the grades, which our university frowns upon, even if the names are not posted. The clear answer is to email each student his own grade.

Luckily, Google has a cool feature called Google Apps Script which lets one write JavaScript programs that can access the data on a Google doc and do things like send emails. So, I wrote a short program to automatically send each student his grades.

Installation

To use it you must first set up your grades spreadsheet to look like this one. Note that

  1. the first row has a 'name', 'email' and other columns for each item,
  2. some columns have the same name as other columns, but with ' Comment' appended, for example: 'Test 1' and 'Test 1 Comment', the comment columns contain any comments you want to give the student
  3. the sheets are named 'grades' and 'template'
  4. the 'template' sheet contains the template information for building the emails (your message).

Once you have the spreadsheet built, go to 'Tools -> Scripts -> Scripts Editor and cut-and-paste the emailgrades.js script in there. Save it, then close and re-open the spreadsheet (or, run the onOpen method if you know how to do that). You should now see a new menu item on you spreadsheet called 'Class', as shown in the screenshot.

Usage

The 'Send Emails' item will send each student (row) his grades if you choose it when you have no cells selected. If you first select (light blue background box) some cells in the spreadsheet then it will only email the students in the selected rows. You can verify that the emails have been sent by going into your gmail account and checking the 'Sent Mail' folder. It can take several minutes for the emails to start appearing so be patient.

The 'Preview Emails' item is mostly for debugging. It will show you a preview of two of the emails that send emails would send. The 'Show Email Quota' item tells you how many more emails you can send today. Google limits scripts to 500 emails per day to keep spammers from abusing the system. Since my classes have at most 60 students this has not been a problem for me.

If you have any comments, bug reports, or feature requests please post them below.