Skip to content

Instantly share code, notes, and snippets.

@micheee
micheee / fn:nilled.xq
Last active March 11, 2019 03:22
fn:nilled.xq
declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance";
(:
Tries to mimic http://www.w3.org/TR/xpath-functions-30/#func-nilled
If $arg is the empty sequence, the function returns the empty sequence.
:)
declare function local:nilled($arg as node()?) as xs:boolean? {
if(empty($arg)) then ()
else (
not($arg/(text()|node())) and $arg/@xsi:nil eq "true"
@micheee
micheee / vimrc
Created December 10, 2013 17:12 — forked from arolle/vimrc
" First step to make VIM an XQuery IDE using BaseX
"
" Adds possibility to run the currently edited XQuery file
" using key combination <leader>r
" An error output jumps to the file, line and column
" where the error occured.
"
" associate *.bxs with xml filetype
@micheee
micheee / groupby.xq
Created May 21, 2012 10:52
Groups authors by author/name and returns all authors that have more than one distinct author/@id attribute
let $authors :=
<authors>
<author id="a"><name>Foo</name>…whatever…</author>
<author id="b"><name>Foo</name>…whatever…</author>
<author id="a"><name>Foo</name>…whatever…</author>
<author id="c"><name>Bar</name>…whatever…</author>
<author id="d"><name>Bar</name>…whatever…</author>
<author id="f"><name>FooBar</name>…whatever…</author>
</authors>
return
@micheee
micheee / KeyTest.txt
Created February 22, 2011 10:50
keycode
Michael-Seiferles-MacBook-Pro:~ michael$ java KeyTest
Pressed: java.awt.event.KeyEvent[KEY_PRESSED,keyCode=157,keyText=?,keyChar=Undefined keyChar,modifiers=?,extModifiers=?,keyLocation=KEY_LOCATION_LEFT,rawCode=0,primaryLevelUnicode=0,scancode=0] on frame0
Pressed: java.awt.event.KeyEvent[KEY_PRESSED,keyCode=65,keyText=A,keyChar='a',modifiers=?,extModifiers=?,keyLocation=KEY_LOCATION_STANDARD,rawCode=0,primaryLevelUnicode=0,scancode=0] on frame0
Typed: java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Unknown keyCode: 0x0,keyChar='a',modifiers=?,extModifiers=?,keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLevelUnicode=0,scancode=0] on frame0
97
Pressed: java.awt.event.KeyEvent[KEY_PRESSED,keyCode=67,keyText=C,keyChar='c',modifiers=?,extModifiers=?,keyLocation=KEY_LOCATION_STANDARD,rawCode=0,primaryLevelUnicode=0,scancode=0] on frame0
Typed: java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Unknown keyCode: 0x0,keyChar='c',modifiers=?,extModifiers=?,keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLe
@micheee
micheee / ldap auth.php
Created February 8, 2011 16:42
personal stuff removed
<?php
/*
* Author: <xxxx>@uni-konstanz.de
* Version: 20080915
*/
class LDAP {
var $authed = false;
/**
* Auth a username and a password against the ldap service
* @param object $username [optional]