This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Server() { | |
this.rev = 0; | |
this.data = {}; | |
this.changes = []; // { id, rev } | |
} | |
/** | |
* Finds changes after given revision. Returns array of {id, op, rev}. | |
*/ | |
Server.prototype.changesAfter = function(rev) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Client 1 data before 1st sync | |
Revision: 0 | |
Data: | |
1: d1-1.0 | |
2: d2-2.0 | |
Changes: | |
r0 1 | |
r0 2 | |
Client 1 data after 1st sync | |
Revision: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Client.prototype.sync = function(server) { | |
var scs = server.changesAfter(this.rev); | |
var ccs = this.currentChanges(); | |
var conflicting = {}; // id -> true | |
var client = this; | |
// Find and resolve conflicting changes. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Server() { | |
this.rev = 0; | |
this.data = {}; | |
this.changes = []; // { id, rev } | |
} | |
/** | |
* Finds changes after given revision. Returns array of {id, op, rev}. | |
*/ | |
Server.prototype.changesAfter = function(rev) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start.sh: | |
#!/usr/bin/env bash | |
if [ -e 'master.pid' ] | |
then | |
echo 'Master PID file exists, cannot start.' | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cluster = require('cluster'); | |
var fs = require('fs'); | |
var config = require('./config.json'); | |
var assets = require('./lib/assets'); | |
// Fork child processes. | |
if (cluster.isMaster) { | |
// Run asset cleanup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cluster = require('cluster'); | |
var config = require('../config.json'); | |
var fs = require('fs'); | |
// Helper module to use cluster. | |
var pidfile = config.server.pidfile; | |
// Signals that can be caught and handled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Header | |
class MouseClickEventFilter : public QObject | |
{ | |
Q_OBJECT | |
public: | |
explicit MouseClickEventFilter(QObject *parent = 0); | |
signals: | |
void clicked(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/Trolltech/Qt-4.8.2/bin/moc -DMACROS_LIBRARY -DIDE_LIBRARY_BASENAME=\"lib\" -DQT_NO_CAST_TO_ASCII -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQT_NO_DEBUG -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.8.2/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.8.2/include/QtCore -I/usr/local/Trolltech/Qt-4.8.2/include/QtGui -I/usr/local/Trolltech/Qt-4.8.2/include -I../../../src -I../../libs -I/home/raivo/Downloads/qt-creator-2.5.0-src/tools -I../../plugins -I../../libs/3rdparty/botan/build -I.moc/release-shared -I.uic macrooptionspage.h -o .moc/release-shared/moc_macrooptionspage.cpp | |
g++ -c -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DMACROS_LIBRARY -DIDE_LIBRARY_BASENAME=\"lib\" -DQT_NO_CAST_TO_ASCII -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQT_NO_DEBUG -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.8.2/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.8.2/include/QtCor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./configure \ | |
-release \ | |
-opensource \ | |
-shared \ | |
-no-fast \ | |
-no-accessibility \ | |
-largefile \ | |
-exceptions \ | |
-no-stl \ | |
-plugin-sql-sqlite \ |
OlderNewer