Saturday, 2 February 2013
Sunday, 6 January 2013
ubuntu remote mount
#usermod -a -G fuse andy
#sshfs root@velvet:/c/media/Pictures Pictures
remove
fusermount -u Pictures
#sshfs root@velvet:/c/media/Pictures Pictures
remove
fusermount -u Pictures
Thursday, 20 December 2012
Imagemagick
The version of Imagemagick on velvet did not support the -path option for mogrify
How to install ImageMagick and Imagick on Debian Linux
Also needed:
# mogrifyUpgraded using:
Version: ImageMagick 6.2.4 07/28/09 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC
How to install ImageMagick and Imagick on Debian Linux
Also needed:
- http://stackoverflow.com/questions/11515118/imagemagick-not-converting-jpegs
- http://www.hardwaretutorials.com/2012/05/installing-png-support-for-debian/
/usr/local/bin/mogrify | more
Version: ImageMagick 6.8.1-0 2012-12-20 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Monday, 19 November 2012
XQuery templating engines and TXQ
"...separating logic from presentation" is good thing; and you don`t need much presentation before code can start looking a bit messy. Here is an example of mine at about the limit of what I feel comfortable with.
Landscape
I have been using Node.js a bit recently and it has an impressive list of templating engines. One of the things I like about Node is the module ecosystem; where vast numbers of different approaches compete in Darwinian fashion for "developer mind share". For reasons that I can't quite remember, I ended up using EJS with custom delimiters of single { and }. It looks a bit like XQuery.When it comes to XQuery there are not so many choices :-). Maybe most are mentioned in this thread: eXist MVC and separating XHTML templates from XQuery code More recently eXistdb has Exist html templates. This looks to be standard XQuery 3.0 and provide a lot of high level functionality, but very much linked into the eXistdb environment.
What the world needs now is...
.. another XQuery templating system. So from my experience with EJS and express.js. Some features that I liked are:
- A render method to take a view and a map type object to produce a page
- A location, a collection or folder, for templates (views) completely separated from the code.
- A quick syntax to wrap common page features around rendered results.
- A block/partial/repeat type concept for list/tables.
- A XML document is a valid XQuery program.
- If we put some {$var} type expressions in it and get XQuery to evaluate it in the right context- we are almost there.
- BaseX has a (non-standard) function xquery:invoke that has just the right signature.
Layout pages use the convention that a layout template has a $body field into which the sub template will be inserted
Example layout template.
Invoking
Often there is a need to render repeated items from some node collection. A solution to this repeatedly invoke a sub-template, injecting a map with an item set to each node in turn. For example our map has a "actions" value. An XML node with a variable number of <generate> sub nodes that we wish to render.
A slight addition to the original render function makes this easy. Below shows the the full TXQ module.
Saturday, 10 November 2012
Software updates
NAS updates
- RAIDiator on readynas to 4.1.10 need to add index.xml to /etc/frontview/apache/httpd.conf
- RAIDiator on velvet to 4.2.22
PaaS
My openshift BaseX instances seem broken by their upgrades. Version rhc 1.0.4 is giving permission denied for server. this?Wednesday, 12 September 2012
Gadgets: tl-wr703n
I bought one of these : totocity Chinese Handy Wi-Fi Wireless Router 150M Wifi Wi-Fi for USB 3G LAN WAN Converter with the idea of creating a MIFI wireless network to use with my tablet.
To be honest I thought it had a 3G modem, but in fact it can only make use of one via USB - never mind I have a ZTE modem and it looks like a fun device.
£21 for a tiny UNIX server with LAN + WIFI. More information here. Hardware hacks here
To be honest I thought it had a 3G modem, but in fact it can only make use of one via USB - never mind I have a ZTE modem and it looks like a fun device.
£21 for a tiny UNIX server with LAN + WIFI. More information here. Hardware hacks here
Step 1
"I wouldn't call this a router for the average home user."I replaced the Chinese interface with open-wrt see instructions at Installing OpenWrt on the TL-WR703N not too hard really.
http://wiki.openwrt.org/toh/tp-link/tl-wr703n
Step 2
Getting the modem to work..
install packages :
- kmod-usb2,
- kmod-usb-option,
- comgt,
- usb-modeswitch,
- usb-modeswitch-data
to be continued...the boot log
Monday, 3 September 2012
Drawing trees with XQuery and SVG
Looking for a simple way to draw tree structures, I came across this old xml.com article Automated Tree Drawing: XSLT and SVG by Jirka Kosek. This uses some EXSLT extensions. I am sure it could have been rewritten in XSLT2 but I thought it would be interesting to try it in XQuery ( and add a RESTXQ web interface). Demo and source.
Subscribe to:
Posts (Atom)
