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
declare namespace trang="java:com.thaiopensource.relaxng.translate.Driver"; | |
trang:new()=> trang:run( | |
("C:\Users\andy\git\qd-cmpx\src\main\content\components.rnc" | |
,"C:\Users\andy\git\qd-cmpx\src\main\content\output.xsd") | |
) |
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
declare function local:result($id){ | |
try{ | |
map{ "result":async:result($id) | |
} | |
} catch * { | |
map{ "error": map { | |
'code': $err:code, | |
'description': $err:description, | |
'module': $err:module, | |
'line': $err:line-number, |
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
(:~ | |
: tail recursion example | |
:) | |
declare function local:sum-a($n){ | |
if($n eq 0) then 1 else $n+ local:sum-a($n - 1) | |
}; | |
declare function local:sum-b($n){ | |
local:sum-iter(1,$n) | |
}; |
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
(: let $combs:=[(),1,2,3,(1,2),(2,3),(1,3),(1,2,3)] :) | |
declare function local:powerset($items as item()* ) | |
as array(*){ | |
if (count($items)=0) then [()] | |
else let $x:=local:powerset(tail($items)) | |
return array:join(($x, | |
array:for-each($x,function($v){head($items),$v})) | |
) | |
}; |
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
import module namespace eval = "quodatum.eval" at "../../../app-doc/src/doc/lib/eval.xqm"; | |
let $s:=" | |
declare variable $state as element(state):=db:open('doc-doc','/state.xml')/state; | |
(replace value of node $state/hits with 1+$state/hits, | |
1+$state/hits) | |
" | |
let $b:= eval:update($s,"",map{}) | |
return ($b,$b?result+100) |
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
(: Java8 XQuery Javascript :) | |
declare namespace se="java:javax.script.ScriptEngine"; | |
declare namespace sm="java:javax.script.ScriptEngineManager"; | |
let $engine:= sm:getEngineByName(sm:new(),"nashorn") | |
return ( | |
se:put($engine,"a","This string is encoded!"), | |
se:eval($engine,"escape(a)") | |
) |
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
(:~ | |
: JSON test apb 2dec 2014 | |
:) | |
module namespace page = 'json-test'; | |
declare variable $page:data:=<json objects="json _"> | |
<total type="number">15</total> | |
<entity>app</entity> | |
<items type="array"> |
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
Using http://xml.coverpages.org/bosakShakespeare200.html | |
Timing BaseX 7.9 GUI find command, numbers in parentheses are fails | |
q1:to be or not to be | |
q2:Brevity is the soul of wit | |
index defined q1 q2 | |
--------------------------------- | |
none 500ms 400ms | |
fulltext~5mb 30ms 3ms |
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
<bar> | |
<crumbs type="array"> | |
<link> | |
<text>Suites</text> | |
<href>#</href> | |
<title>List of suites</title> | |
</link> | |
<link> | |
<text>{{activesuite}}</text> | |
<href>#/suite/{{activesuite}}</href> |
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
pi@raspberrypi ~ $ cat /boot/config.txt | |
# uncomment if you get no picture on HDMI for a default "safe" mode | |
#hdmi_safe=1 | |
# uncomment this if your display has a black border of unused pixels visible | |
# and your display can output without overscan | |
#disable_overscan=0 | |
# uncomment the following to adjust overscan. Use positive numbers if console | |
# goes off screen, and negative if there is too much border |