Skip to content

Instantly share code, notes, and snippets.

@vpozhidaev
vpozhidaev / CDC_MySQL_Replication.xml
Created November 12, 2020 19:13 — forked from mattyb149/CDC_MySQL_Replication.xml
NiFi template with end-to-end table replication from a source MySQL database to a target MySQL database
<?xml version="1.0" ?>
<template encoding-version="1.1">
<description>This template shows an end-to-end example of how to replicate table(s)
from a source MySQL database to a target MySQL database</description>
<groupId>68961054-015b-1000-2c21-01b42e84dbe0</groupId>
<name>CDC_MySQL_Replication</name>
<snippet>
<connections>
<id>9a0f0bca-5c0c-3f1e-0000-000000000000</id>
<parentGroupId>23d80cd0-6e6e-31c9-0000-000000000000</parentGroupId>

An introduction to recursion in XQuery

  • Created: Nov 28, 2017
  • Updated: Nov 29, 2017: Now covers transformation of XML documents

Recursion is a powerful programming technique, but the idea is simple: instead of performing a single operation, a function calls itself repeatedly to whittle through a larger task. In XQuery, recursion can be used to accomplish complex tasks on data that a plain FLWOR expression (which iterates through a sequence) cannot, such as transforming an entire XML document from one format into another, like TEI or DocBook into HTML, EPUB, LaTeX, or XSL-FO. Transforming a document is well-suited to recursion because each of the document's nodes may need to be examined and manipulated based on the node's type, name, and location in the document; and once a node has been processed, the transformation must continue processing the nodes' children and descendants until the deepest leaf node has been processed. But learning the technique of recursion is often hard for a beginning program

@vpozhidaev
vpozhidaev / gist:82bcd1988e0a21d99dee28d85d965b24
Created April 8, 2016 17:18 — forked from pstoellberger/gist:3899805
Conditional Formatting in Saiku
In the mondrian schema xml:
-----------------------------------------------------------------------------------------------------------
<CalculatedMember
name="Profit"
dimension="Measures">
<Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" expression="Iif(([Measures].[Store Sales] - [Measures].[Store Cost]) &lt; 10000, '|(#,##0.00 &#8364;)|style=red', '|#,##0.00 &#8364;|style=green')"/>
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="4"/>
</CalculatedMember>