- serialize the base document (version 0) in the variable
String ver0_string; - serialize the modified document (version 1) in the variable
String ver1_string; - create a
ByteArrayOutputStream diff_resultobject.
This file contains hidden or 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
| + set -e | |
| + set -u | |
| + export LC_ALL=C | |
| + direct=true | |
| + h=localhost | |
| + dr=/tmp/annex | |
| + sync=sync -c annex.alwayscommit=true | |
| + chmod a+rwx -R pc1 pc2 | |
| + rm -Rf pc1 pc2 | |
| + ssh localhost chmod a+rwx -R /tmp/annex/Docs.git |
This file contains hidden or 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
| <!DOCTYPE ead PUBLIC "+//ISBN 1-931666-00-8//DTD ead.dtd (Encoded Archival Description (EAD) Version 2002)//EN" "http://lcweb2.loc.gov/xmlcommon/dtds/ead2002/ead.dtd"> | |
| <ead> | |
| <eadheader langencoding="iso639-2b" | |
| countryencoding="iso3166-1" | |
| dateencoding="iso8601" | |
| repositoryencoding="iso15511" | |
| scriptencoding="iso15924" | |
| relatedencoding="DC"> | |
| <eadid identifier="TEST-EAD; erste Akzession" | |
| url="http://localhost:2234/atom-testing/index.php/somethinglikethis" |
This file contains hidden or 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
| impl<'a> FromBase64 for &'a [u8] { | |
| fn from_base64(&self, config: Config) -> Result<Vec<u8>, FromBase64Error> { | |
| let mut r = Vec::new(); | |
| let mut buf: u32 = 0; | |
| let mut modulus = 0i; | |
| let chars = match config.char_set { | |
| Standard => STANDARD_CHARS, | |
| UrlSafe => URLSAFE_CHARS, | |
| XmlNmtoken => XML_NMTOKEN_CHARS, |
This file contains hidden or 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/bin/env ruby | |
| require 'nokogiri' | |
| src =<<EOD | |
| <wrapper xmlns="ns" xmlns:extra="extra"> | |
| <record xml:id="r1"> | |
| <field>aaa</field> | |
| <field extra:type="second">bbb</field> | |
| </record> |
This file contains hidden or 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/bin/env bash | |
| set -e | |
| set -u | |
| #USER="" # set username | |
| #PASS="" # set password | |
| #HOST="" # set host, eg. localhost:8080 | |
| COLLECTION_BASE_URL="http://$USER:$PASS@$HOST/exist/rest/db" |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <xsl:stylesheet | |
| xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xmlns:sch="http://purl.oclc.org/dsdl/schematron" | |
| xmlns:s="http://www.ascc.net/xml/schematron" | |
| xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" | |
| xmlns:rng="http://relaxng.org/ns/structure/1.0" | |
| xmlns:tei="http://www.tei-c.org/ns/1.0" | |
| xmlns:teix="http://www.tei-c.org/ns/Examples" |
This file contains hidden or 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
| require 'rom-repository' | |
| require 'rom-sql' | |
| db = ROM.container(:sql, 'sqlite::///tmp/foo.sqlite') do |c| | |
| c.default.create_table(:users) do | |
| primary_key :id | |
| column :name, String, null: false | |
| end | |
| end |
So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.
-
Database in a browser, a spec (Stepan Parunashvili)
What problem are we trying to solve with a sync system?
-
The web of tomorrow (Nikita Prokopov)
OlderNewer