Skip to content

Instantly share code, notes, and snippets.

@cidermole
cidermole / Makefile
Last active January 3, 2016 18:39
Problem in C++ function template instantiation from class template
MAIN = program
OBJECTS = main.o myclass.o
all : $(MAIN)
$(MAIN) : $(OBJECTS)
g++ -o $@ $(OBJECTS)
%.o : %.cpp
g++ -c $<
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.Random;
public class TestWCJava2 {
@cidermole
cidermole / rbtree.hpp
Created June 10, 2016 14:33 — forked from upsuper/rbtree.hpp
A Red-Black Tree implemented in C++ (need C++11)
#ifndef RBTREE_RBTREE_H_
#define RBTREE_RBTREE_H_
#include <cstddef>
#include <cassert>
#include <utility>
namespace upsuper {
namespace learning {
//
// Obtain class member signatures as required for Jenkins whitelists
// as used in the Script Security plugin,
// https://github.com/jenkinsci/script-security-plugin
//
// Usage example: $ groovy signatures.groovy java.lang.String
//
def resolveArrayType(typeName) {
def arrNames = [
@cidermole
cidermole / jenkins-agent.service
Last active February 20, 2024 11:53
Systemd service file for Jenkins agent on Ubuntu 20.04 Focal Fossa
# Steps to install Jenkins Agent using JNLP connection on Ubuntu 20.04 Focal Fossa
#
# * create an Agent node on the web GUI: https://wiki.jenkins.io/display/JENKINS/Step+by+step+guide+to+set+up+master+and+agent+machines+on+Windows
# * $ sudo apt-get install -y openjdk-14-jre-headless
# * $ sudo adduser jenkins
# * $ curl http://jenkins-master.internal/jnlpJars/agent.jar -o /home/jenkins/agent.jar
# * create systemd service: place this file in /lib/systemd/system/jenkins-agent.service
# * $ sudo systemctl enable myservice
# * $ sudo systemctl start jenkins-agent