Skip to content

Instantly share code, notes, and snippets.

View martyngigg's full-sized avatar

Martyn Gigg martyngigg

View GitHub Profile
@martyngigg
martyngigg / gist:8539043
Created January 21, 2014 12:22
GitHub API Ref
List tree for SHA: curl -i -H application/vnd.github.v3+json https://api.github.com/repos/martyngigg/workflow/git/trees/HEAD
List tree recursively for SHA: curl -i -H application/vnd.github.v3+json https://api.github.com/repos/martyngigg/workflow/git/trees/HEAD?recursive=1
@martyngigg
martyngigg / tcmalloc.md
Last active August 29, 2015 14:05
Current state of Tcmalloc in Mantid

Timing Code

import mantid
from mantid.simpleapi import Load
import sys
import time

precount = ("-npc" not in sys.argv)
@martyngigg
martyngigg / main.cpp
Last active August 29, 2015 14:07
3D NeXus writing
//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include <cmath>
#include <iostream>
#include <unistd.h>
#include <vector>
#include <nexus/NeXusFile.hpp>
@martyngigg
martyngigg / Notes
Created January 29, 2015 11:11
IDF v2
* A single common way of describing the instrument
* Need to be able to define arbitrary flight path
* Include all components e.g. components and what they do to the beam
* Moving components (some during a run so that flight path can change)
* Can we build the control system from the instrument definition
* Interchangeable components
* More first-class shapes: simple tubes, tube arrays, detectors with inherent energy resolution, detectors able to record depth ...
* What file format: HDF?
* Instrument that we need to make sure we've covered most things:
** POLREF
@martyngigg
martyngigg / LoadLotsOfInstruments-osx-10.9.md
Last active August 29, 2015 14:15
Timings for instrument loading

Report for LoadLotsOfInstruments-osx-10.9.log

Created from log at git revision a7bc302 Timings in seconds.

Instrument File Timing
GEM_Definition.xml 910.910000
HRPD_Definition.xml 468.870000
@martyngigg
martyngigg / CodeDiscussion.md
Last active August 29, 2015 14:17
Python Code Discussion
@martyngigg
martyngigg / JenkinsGroovy.md
Last active August 29, 2015 14:18
Useful Jenkins Groovy Scripts

List all scm urls

import jenkins.model.*;
import hudson.model.*;
import hudson.tasks.*;
import hudson.plugins.git.*;
import org.eclipse.jgit.transport.RemoteConfig;
import org.eclipse.jgit.transport.URIish;
@martyngigg
martyngigg / git_commands.md
Last active August 29, 2015 14:20
Generate Release Changes

Algorithms:

Assumes the header file has version() in it:

git diff --name-only --diff-filter=A v3.3.0 HEAD | grep -v 'Test.h'| grep -E ".h$" | xargs grep -l -E "^.*version\(\).*" | sed -r -e 's@.*/(.*).h@\1@g' | sort | sed -r -e 's@(.*)@* [http://docs.mantidproject.org/algorithms/\1 \1]@g'`

Change --diff-filter=A to --diff-filter=M for changed algorithms

@martyngigg
martyngigg / third-party-dlls.md
Last active August 29, 2015 14:21
Third Party DLLS

Required DLLs

Whitelisted DLLs from third party for Windows:

  • boost_date_time-vc110-mt-1_52.dll
  • boost_python-vc110-mt-1_52.dll
  • boost_regex-vc110-mt-1_52.dll
  • cblas.dll
  • gsl.dll
@martyngigg
martyngigg / stacktrace.txt
Last active August 29, 2015 14:22
CMake Windows Crash
Exception type is std::bad_alloc.
[size] 633402058 int
insert trying to add 7240 chars
> msvcr110d.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 152 C++
msvcr110d.dll!operator new(unsigned int size) Line 63 C++
cmake.exe!std::_Allocate<char>(unsigned int _Count, char * __formal) Line 28 C++
cmake.exe!std::allocator<char>::allocate(unsigned int _Count) Line 591 C++
cmake.exe!std::_Wrap_alloc<std::allocator<char> >::allocate(unsigned int _Count) Line 877 C++