News for hackers. Stuff that matters.
Re:Show HN: A virtual whiteboard for working or teaching rem... by MarkMc on Thursday August 21, 2014 @08:39AM (#8207027)
The drawing is basically a list of strokes, and a stroke is a list of points - that is, (x, y) coordinates. So the database is mostly a huge table of (x,y) coordinates.

Uploading the entire canvas would far too inefficient - I simply upload the points.

The transfer between two clients uses a technique called 'long polling'. That is, the client sends an HTTP request to the server, and the server doesn't respond until it has received a message (ie. stroke) from another client.

Re:Show HN: A virtual whiteboard for working or teaching rem... by henningo on Thursday August 21, 2014 @01:03PM (#8208354)
Did you consider doing spline fits to the x,y coordinates and then just saving the spline coefficients instead?

The fit process could likely be done client-side, and could offer some subtle smoothing if wanted?

Anyhow, really nice execution!

Re:Show HN: A virtual whiteboard for working or teaching rem... by byoung2 on Thursday August 21, 2014 @03:51PM (#8209214)
paper.js has a nice method to do this. I actually used it in a whiteboard app I made as a proof of concept. Rather than saving every X,Y coordinate, it uses a configurable number of points and handles and makes bezier curves. http://paperjs.org/examples/path-simplification/
Re:Show HN: A virtual whiteboard for working or teaching rem... by dceddia on Thursday August 21, 2014 @09:35AM (#8207244)
Did you end up using any libraries for the communication, such as socket.io? (http://socket.io/)
Re:Show HN: A virtual whiteboard for working or teaching rem... by MarkMc on Thursday August 21, 2014 @10:18AM (#8207443)
No just the standard async Java servlet calls. To be honest I didn't find out about socket.io until half way through the project.