I put together some findings I gathered over the years on how small adjustements to XPath queries can lead to better performance. These are not definitive and should be tested if they apply to specific slow running queries you have issues with. I assume you have profiled your queries before in the bundled monex application. Here is a bit of documentation on this topic to help you get started: http://exist-db.org/exist/apps/doc/indexing.xml?field=all&id=D3.19#check-usage On a typical local instance this is available at: http://localhost:8080/exist/apps/monex/profiling.html
This file contains 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 python3 | |
# This script is explained here: <https://sixcolors.com/post/2024/10/putting-my-solar-system-in-my-menu-bar/> | |
# Adapted from grzegorz914@icloud.com <https://github.com/grzegorz914/homebridge-enphase-envoy> | |
# <xbar.title>Enphase Solar (Averages)</bitbar.title> | |
# <xbar.version>v1.2</xbar.version> | |
# <xbar.author>Jason Snell</xbar.author> | |
# <xbar.author.github>jasonsnell</xbar.author.github> | |
# <xbar.desc>Display local Enphase solar stats.</xbar.desc> |
This file contains 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
// | |
// OCXML.swift | |
// Created by Marco Arment on 9/23/24. | |
// | |
// Released into the public domain. Do whatever you'd like with this. | |
// No guarantees that it'll do anything, or do it correctly. Good luck! | |
// | |
import Foundation |
This file contains 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
xquery version "4.0"; | |
(:~ | |
: | |
: Module Name: Jaro-Winkler String Similarity | |
: Date: February 26, 2024 | |
: License: GPLv3 | |
: XQuery specification: 4.0 | |
: Dependencies: BaseX 11.0 | |
: @author @timathom |
This file contains 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
<main class="news-list__latest"> | |
<ul> | |
<li data-template="templates:each" data-template-from="articles" data-template-to="article"> | |
<a data-template="pr:article-link"/> | |
</li> | |
</ul> | |
</main> |
This file contains 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
# Go to https://bottlecaps.de/rex/ and use this command line on nested-parentheses.ebnf: -xslt -main -tree -ll 3 -backtrack | |
# Assumption: A Saxon front-end script called 'saxon' is on the path | |
saxon -o:out.xml -it:main -xsl:nested-parentheses.xslt input='{(((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20)))}' '!indent=yes' | |
# Looking at the main template of the generated XSLT, you need to surround the input string with curly braces; otherweise it will be interpreted as a file name |
This file contains 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:xdm-type($value as item()?) as xs:QName? { | |
typeswitch($value) | |
case array(*) return xs:QName("array") | |
case map(*) return xs:QName("map") | |
case function(*) return xs:QName("function") | |
case document-node() return xs:QName("document") | |
case element() return xs:QName("element") | |
case attribute() return xs:QName("attribute") | |
case comment() return xs:QName("comment") | |
case processing-instruction() return xs:QName("processing-instruction") |
This file contains 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"?> | |
<project default="xar" name="wilde" xmlns:xdb="http://exist-db.org/ant"> | |
<description>Wilde Trials International News Archive</description> | |
<property name="host" value="localhost"/> | |
<property file="${host}.properties"/> | |
<path id="classpath.core"> | |
<fileset dir="${local.dir}/lib"> | |
<include name="*.jar"/> |
This file contains 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
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<head> | |
<title>Insert with Origin</title> | |
<style type="text/css"> | |
@namespace xf url("http://www.w3.org/2002/xforms"); | |
body {font-family:Helvetica, sans-serif} | |
</style> | |
<xf:model> | |
<xf:instance id="i-rec"> | |
<TEI xmlns="http://www.tei-c.org/ns/1.0"> |
This file contains 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
xquery version "3.1"; | |
declare namespace dicey="http://line-o.de/ns/dicey"; | |
declare function dicey:sequence ($n as xs:integer, | |
$generator as map(xs:string, item())) as item()* { | |
fold-left( | |
1 to $n, | |
map { "sequence": (), "generator": $generator}, | |
dicey:reducer#2 |
NewerOlder