Skip to content

Instantly share code, notes, and snippets.

evanl@THINKPAD-T480 ~/boost/tools/docca/example
$ b2 .//_reference-dir-vis/stage1_visualized/code-trace-enabled/stage1.xsl --docca-visualize -d+2
Performing configuration checks
- default address-model : 32-bit (cached)
- default architecture : x86 (cached)
- symlinks supported : no (cached)
- junctions supported : yes (cached)
- hardlinks supported : yes (cached)
common.mkdir ..\..\..\bin.v2\tools\docca\example\_reference-dir-vis
<widget xmlns="http://example.com/widgets">
<part count="30">
<name>Thingamajig</name>
</part>
</widget>
curl -v -X POST \
--digest --user admin:admin \
-H "Content-Type: application/json" \
-d '{"query":{"and-query":{"queries":[{"range-constraint-query":{"constraint-name":"name","value":["James Stewart"]}}]}}}' \
"http://localhost:8003/v1/search?format=json&view=all&options=all&start=1&pageLength=10"
<widget xmlns="http://example.com/widgets">
<part count="30">
<name>Thingamajig</name>
</part>
</widget>
<book>
<title>My book</title>
<chapter>
<title>Introduction</title>
<section>
<title>My section</title>
...
<section>
<title>My sub-section</title>
...
@evanlenz
evanlenz / ex01.sh
Created August 31, 2012 16:36
Code samples for MarkLogic REST API
curl -X GET \
--anyauth --user rest-writer:x \
'http://localhost:8011/v1/search?q=chicken&format=json'
@evanlenz
evanlenz / ex01.java
Created August 7, 2012 22:25
Code samples for MarkLogic for Java Developers
# properties to configure the examples
example.writer_user=rest-writer
example.writer_password=x
example.admin_user=rest-admin
example.admin_password=x
example.host=localhost
example.port=8011
example.authentication_type=digest
for $item in $my-nodes return lower-case($item)
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- By default, copy everything unchanged -->
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
@evanlenz
evanlenz / BinaryReader.java
Created April 24, 2012 22:26
Connector examples for Hadoop class at MarkLogic World
package com.marklogic.mapreduce.examples;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;