Skip to content

Instantly share code, notes, and snippets.

View apb2006's full-sized avatar

Andy Bunce apb2006

  • Quodatum
  • London, UK
View GitHub Profile
@apb2006
apb2006 / gist:1603598
Created January 12, 2012 22:39
Install basex on readynas duo 2
velvet:~# wget http://ftp.us.debian.org/debian/pool/main/b/basex/basex_7.0.2-1_all.deb
--2012-01-12 22:35:23-- http://ftp.us.debian.org/debian/pool/main/b/basex/basex_7.0.2-1_all.deb
Resolving ftp.us.debian.org... 35.9.37.225, 128.30.2.36
Connecting to ftp.us.debian.org|35.9.37.225|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2122208 (2.0M) [application/octet-stream]
Saving to: `basex_7.0.2-1_all.deb'
100%[======================================>] 2,122,208 542K/s in 4.3s
@apb2006
apb2006 / gist:1643724
Created January 19, 2012 23:34
basex 7.02 performance
(: 100ms :)
import module namespace app="/apb/bxnfactbook/0.1" ;
declare namespace functx="http://www.functx.com";
declare function local:foo(){
let $a:=app:entity("city")
let $schema:=$app:schema/schema/db/entity[@name="city"]
let $sorted:=app:sequence-sort($a,"name",1,"string")
let $table:=app:sequence-to-table3($sorted,$schema)
return $sorted
@apb2006
apb2006 / gist:1695027
Created January 28, 2012 17:01
a91 with 3g modem ZTE CDMA Technologies MSM
<6>usb 1-2.1: new high speed USB device using ehci-omap and address 3
<6>usb 1-2.1: New USB device found, idVendor=19d2, idProduct=2000
<6>usb 1-2.1: New USB device strings: Mfr=2, Product=1, SerialNumber=3
<6>usb 1-2.1: Product: ZTE CDMA Technologies MSM
<6>usb 1-2.1: Manufacturer: ZTE,Incorporated
<6>usb 1-2.1: SerialNumber: 1234567890ABCDEF
<4>USB usb_probe_device idVendor=19d2 idProduct=2000 product=(ZTE CDMA Technologies MSM)
<6>usb 1-2.1: configuration #1 chosen from 1 choice
<6>usb 1-2.1: USB disconnect, address 3
<6>usb 1-2.1: new high speed USB device using ehci-omap and address 4
@apb2006
apb2006 / gist:1701099
Created January 29, 2012 22:35
IFree=0
velvet:/tmp# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md0 4184756 1722772 2252324 44% /
tmpfs 16 0 16 0% /USB
/dev/c/c 1930585268 906876 1929678392 1% /c
/dev/c/c_2011_07_08_22_18
1930585268 208984 1930376284 1% /c_2011_07_08_22_18
velvet:/tmp# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/md0 65536 65536 0 100% /
@apb2006
apb2006 / gist:1817999
Created February 13, 2012 16:25
XQueryV30.xq basex 7.1
(: time 3448088ms ~ 1hr :)
import module namespace p="XQueryV30" at "C:\Program Files\xquerydoc-0.1\src\xquery\parsers\XQueryV30.xq";
p:parse-XQuery("2+3")
@apb2006
apb2006 / gist:1879855
Created February 21, 2012 23:38
anotations from Xquery
import module namespace p="apb.parser-basex";
let $xq:='
declare
%rest:path("/stock/widget/{$id}")
function local:widget($id as xs:int) {
(: get the widget :)
fn:collection("/db/widgets")/widget[@id eq $id]
};
2+3
@apb2006
apb2006 / gist:1895476
Created February 23, 2012 22:39
time... 1.2 sec
import module namespace q="apb.pacman";
q:info()
hello from pacman
@apb2006
apb2006 / End up as..
Created April 11, 2012 22:24
xsltforms without <?css-conversion no?>
<style type="text/css">XML Parsing Error: not well-formed Location: http://localhost:8984/lib/bootstrap/css/bootstrap-responsive.min.css Line Number 1, Column 10:.clearfix {*zoom:1;}
.clearfix:before, .clearfix:after {display:table;content:"";}
{}
</style>
@apb2006
apb2006 / basexhttp.sh
Last active February 5, 2017 14:56
init.d script for BaseX server
#!/bin/sh
### BEGIN INIT INFO
# Provides: basexhttp
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: basex initscript
# Description: basex
@apb2006
apb2006 / gist:2979965
Created June 23, 2012 21:04
tika metadata from photo
java -jar ~andy/tika-app-1.1.jar skating.jpg
<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Software" content="Picasa"/>
<meta name="GPS Altitude Ref" content="Sea level"/>
<meta name="subject" content="greenwich"/>
<meta name="subject" content="ice"/>
<meta name="subject" content="skate"/>
<meta name="Content-Length" content="96154"/>
<meta name="Exif Version" content="2.20"/>