Allowed Users and UGRS

Today Asher and I submitted our abstract for Briefcase to the undergrad research symposium. Not much else to say about that 🙂

We also worked on getting allowed_users working. I added a many to many relationship field to the Spreadsheet database model that links with the UserProfile model. Asher changed it so that the owner username and the file primary key can be sent through the url. Now not only can you view a spreadsheet if you are the owner, you can also view someone else’s spreadsheet if you are logged into an account that is in the allowed users list for that file.

Automatic Server Updating

Though I recently wrote a post. I recently struggled with a problem I found more difficult then most.
For a while we manually updated our server. It worked quite seamlessly to any observer.
But now it automaticly gets our code from online, the solution could possibly be considered divine.
So to you all I would like to bestow, our simple PHP code below.

  echo "Pulling Repo <br>";
  echo exec("cd /home/shared/Briefcase; git pull readonly master");
  echo "<br> Finished";

‘Live Editing’ problems and a possible solution

We are at the stage where I believe that we can implement live coding (and live spreadsheets) however I am running into a few problems. These problems are not actually with the algorithm for syncing code they are with the undo stack (ctrl-z). Here is the problem: when javascript edits a segment of text that the user is able to select then the native undo stack is deleted or made unusable. This makes sense because the computer now has no idea what has been changed by the javascript and cannot justly apply the undo action to data that could be completely different. I have been informed that javascript is getting a standard way of controlling native undo functionality but for now it does not work.

The solution. Create a custom undo stack. This stack would be able to adapt to the changes of external users as well.  This stack would not be too complicated it would be an array of associated ‘region’ values of what the code used to be and what the code is now. This way you get the undo and the redo capabilities. As a result this stack can also be used as a monitor to what has and has not been sent to the server because it contains the regions of typed text already. I just actually came up with that idea now, interesting how just writing out ideas in a blog can help you find solutions.

Asher Glick
Keep Going


Today I started switching the file system over to django models and linking them with owner users. I didn’t get very far, but I’m meeting with Asher on saturday to make more progress. Some of the stuff I need to do I can’t do without him since I don’t know much about his front end. Hopefully at the end of saturday we will have saving and loading spreadsheets from the database working – including being able to save multiple files.

Also, I actually used something I learned in the database systems class I’m currently taking. Even though django models the database for you based off of your models, you still need to manage the types of relationships to a degree. I started messing with adding a many to many field to the spreadsheet model that would represent the “allowed users” relationship between spreadsheets and user profiles.

Presentation And Realizations

Last Friday (the 10th) we gave a presentation to RCOS.  We were able to learn a lot of things from peers. Two things of importance are where to save the files. Previously we were using a files system, this has been replaced with a database, much better. The other important thing is syntax highlighting. Colin Kuebler with the Koala project has spent a year learning and experimenting with syntax highlighting inside web browsers. While I initially assumed that the style of highlighting he used was inefficient and not-cross browser capable I now find that his method is actually one of the most efficient methods out there. Hopefully one of the next features we will have is the multi user editable content.

The presentation can be found at: Breifcase_Presentation_3

Saving and Loading

Last weekend we got the saving and loading feature to work for the spreadsheet and django using ajax.We will be expanding this feature in the coming weeks to include:

  • Multiple files to be saved by each user
  • Multiple file types to be saved by each user
  • Files can be shared in between users
  • Files can be edited by multiple users at the same time

An API for saving and loading is also going to be developed. This will help when creating more complex applications with more then one central data source. It will be able to take in a variable (or multiple variables) and send an AJAX request to the server. The functions will also be able to get the file via AJAX from the server and parse into it’s individual variables.