Skip to content

Instantly share code, notes, and snippets.

View xquery's full-sized avatar

James Fuller xquery

View GitHub Profile
@xquery
xquery / build.gradle
Last active May 27, 2016 10:00
mlcp is a powerful tool for loading data into MarkLogic but many (including myself) consistently trip up on installing deps or getting classpaths right. Drop the following 2 files into a directory and then create a nested dir (lets call it /data) and put some docs in there and run 'gradle importData'.
plugins {
id "com.marklogic.ml-gradle" version "2.2.0"
}
repositories {
jcenter()
maven { url "http://developer.marklogic.com/maven2/" }
maven { url "http://repository.cloudera.com/artifactory/cloudera-repos/" }
}
Herewith my experiences of building curl.
1) fork (curl)[https://github.com/curl/curl]
2) setup build env
```
./configure --disable-shared --enable-debug --enable-maintainer-mode
```
#! /bin/bash
query=${1:-*}
echo ${query} >/dev/null
echo "query returned no results"
#include <iostream>
#include <map>
using namespace std;
typedef multimap <string, tuple<int,int> > ptable;
int main() {
string orig = "a large span of text";
#ifndef HEADER_CURL_ALTSVC_H
#define HEADER_CURL_ALTSVC_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2018, Daniel Stenberg, <[email protected]>, et al.
@xquery
xquery / alt-svc.h
Last active November 26, 2018 07:23
#ifndef HEADER_CURL_ALTSVC_H
#define HEADER_CURL_ALTSVC_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2018, Daniel Stenberg, <[email protected]>, et al.
xquery version "3.0";
(: the power of algebraic data types in xquery
This example shows how we can composite up data models
which 'carry' their own operations along with them.
:)
(: using John Snelson's inspirational https://github.com/jpcs/data.xq :)
@xquery
xquery / topo.xqy
Created February 8, 2019 09:34
example topo sort in xquery
declare function local:topo-sort($unsorted, $sorted ) {
if (empty($unsorted)) then $sorted
else
let $allnodes := $unsorted [ every $id in depends/@id satisfies $id = $sorted/@id]
return
if ($allnodes) then
local:topo-sort( $unsorted except $allnodes, ($sorted, $allnodes ))
else ()
};
@xquery
xquery / single-issue-presidency.txt
Last active August 5, 2019 04:42
'single issue' candidacy for President
Once in office will work with congress to pass rational gun law (and nothing else).
Choose vice president running mate based on 2nd best polling.
Once gun laws have been passed or executive orders declared, retire.
@xquery
xquery / gist:b9925d22e19abf7bc69ca3c9d253765a
Last active February 3, 2020 10:27
libcurl build flags for just HTTP/HTTPS protocols and SSL IPv6 AsynchDNS NTLM HTTP2 HTTPS-proxy features
./configure \
--without-PACKAGE \
--without-zlib \
--without-brotli \
--without-winssl --without-schannel \
--without-mesalink --without-nss --without-libpsl \
--without-libmetalink \
--without-librtmp \
--without-winidn --without-libidn2 \
--disable-NTLM --disable-ntlm-wb \