Skip to content

Instantly share code, notes, and snippets.

View adamfowleruk's full-sized avatar

Adam Fowler adamfowleruk

View GitHub Profile
@adamfowleruk
adamfowleruk / 001-article-main.xqy
Created November 1, 2012 17:53
article controller main function
declare function c:main() as item()*
{
let $acount := xdmp:estimate((fn:doc()/article))
return
(
ch:add-value("articlecount",$acount),
ch:add-value("title", "Articles")
)
};
@adamfowleruk
adamfowleruk / mldb-create-db.js
Last active December 15, 2015 10:19
MarkLogic World 2013 - MLDB talk
var dosomething = function() { /* whatever */ };
var db = new mldb(); // default options
db.exists(function(result) {
if (!result.inError) {
if (result.exists) {
// already exists
dosomething();
} else {
// create then destroy
<link rel="stylesheet" type="text/css" href="/css/widgets.css" />
<script type="text/javascript" src="/js/mldb.js"></script>
<script type="text/javascript" src="/js/mldb-jquery.js"></script>
<script type="text/javascript" src="/js/widgets.js"></script>
<script type="text/javascript" src="/js/widget-search.js"></script>
<script type="text/javascript" src="/js/page-search-main.js"></script>
<div id="search-content">Search content goes here</div>
@adamfowleruk
adamfowleruk / brew install collada-dom
Created December 9, 2013 11:18
Brew install collada-dom failure
I have ran through the troubleshooting guide.
Install verbose output:-
==> Downloading http://downloads.sourceforge.net/project/collada-dom/Collada%20DOM/Collada%20DOM%202.4/collada-dom-2.4.0.tgz
Already downloaded: /Library/Caches/Homebrew/collada-dom-2.4.0.tgz
==> Verifying collada-dom-2.4.0.tgz checksum
tar xf /Library/Caches/Homebrew/collada-dom-2.4.0.tgz
==> Patching
@adamfowleruk
adamfowleruk / Search Options
Created December 20, 2013 18:10
Geospatial range index scoring example in MarkLogic 7.0-1
{
"options": {
"debug": false,
"transform-results": {
"apply": "raw"
},
"constraint": [{
"name": "stars",
"range": {
"type": "xs:int",
@adamfowleruk
adamfowleruk / ublox-i2c.c
Created June 26, 2014 18:11
Serial and I2C comms examples for Airbot UBlox GPS and compass part
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <linux/i2c-dev.h>
@adamfowleruk
adamfowleruk / gpsprinter.c
Created July 13, 2014 22:51
NMEA decoder and Airbot UBlox GPS working on Arduino Pro Mini 3.3V
#include <nmea.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX - change for your connections
NMEA nmeaDecoder(ALL);
void setup()
{
// Open serial communications and wait for port to open:
@adamfowleruk
adamfowleruk / gpscompassread.c
Created July 14, 2014 15:50
Sending GPS and Compass information to hardware serial on Arduino Pro Mini with UBlox GPS and HMC5883L compass chip (Airbot UBlox 2.0 module)
#include <nmea.h>
#include <SoftwareSerial.h>
#include <Wire.h>
SoftwareSerial mySerial(2, 3); // RX, TX
NMEA nmeaDecoder(ALL);
void setup() {
// Open serial communications and wait for port to open:
Wire.begin();
@adamfowleruk
adamfowleruk / part.previous.log
Created July 24, 2018 10:01
part.previous.log
[2018-07-17 15:07:25,833][INFO ][Part : 125] main - PART command: publish
[2018-07-17 15:17:04,906][INFO ][Part : 125] main - PART command: publish
[2018-07-17 15:19:47,025][INFO ][Part : 125] main - PART command: publish
[2018-07-17 15:20:02,320][FATAL][GitManager : 117] initialiseCaptureRepos - Failed to create develop branch
org.eclipse.jgit.api.errors.RefNotFoundException: Ref HEAD cannot be resolved
at org.eclipse.jgit.api.CreateBranchCommand.getStartPointObjectId(CreateBranchCommand.java:276)
at org.eclipse.jgit.api.CreateBranchCommand.call(CreateBranchCommand.java:129)
at org.pentaho.part.versioning.GitManager.initialiseCaptureRepository(GitManager.java:115)
at org.pentaho.part.commands.PublishCommand.execute(PublishCommand.java:74)
at org.pentaho.part.Part.main(Part.java:157)
@adamfowleruk
adamfowleruk / part.previous.log
Created July 24, 2018 10:49
part.previous.log
[2018-07-17 15:07:25,833][INFO ][Part : 125] main - PART command: publish
[2018-07-17 15:17:04,906][INFO ][Part : 125] main - PART command: publish
[2018-07-17 15:19:47,025][INFO ][Part : 125] main - PART command: publish
[2018-07-17 15:20:02,320][FATAL][GitManager : 117] initialiseCaptureRepos - Failed to create develop branch
org.eclipse.jgit.api.errors.RefNotFoundException: Ref HEAD cannot be resolved
at org.eclipse.jgit.api.CreateBranchCommand.getStartPointObjectId(CreateBranchCommand.java:276)
at org.eclipse.jgit.api.CreateBranchCommand.call(CreateBranchCommand.java:129)
at org.pentaho.part.versioning.GitManager.initialiseCaptureRepository(GitManager.java:115)
at org.pentaho.part.commands.PublishCommand.execute(PublishCommand.java:74)
at org.pentaho.part.Part.main(Part.java:157)