Skip to content

Instantly share code, notes, and snippets.

View mcs07's full-sized avatar

Matt Swain mcs07

View GitHub Profile
@mcs07
mcs07 / open-babel-mavericks.diff
Last active August 29, 2015 14:07
Patch to backport upstream commit so Open Babel 2.3.2 can support libc++ on OS X 10.9+
From c3abbddae78e654df9322ad1020ff79dd6332946 Mon Sep 17 00:00:00 2001
From: Matt Swain <m.swain@me.com>
Date: Thu, 31 Oct 2013 15:25:53 +0000
Subject: [PATCH] Detect libc++ as this is now the default in OS X Mavericks
---
include/openbabel/obmolecformat.h | 7 ++++++-
include/openbabel/shared_ptr.h | 12 ++++++++++--
src/ops/unique.cpp | 8 ++++++--
3 files changed, 22 insertions(+), 5 deletions(-)
@mcs07
mcs07 / subset.diff
Created August 14, 2014 12:13
Patch for subset makefile to skip tests
diff --git a/makefile b/makefile
index 7afcae0..533b228 100644
--- a/makefile
+++ b/makefile
@@ -2,13 +2,3 @@ OBJECTS =main.o SCA.o bitvector.o argv.o error.o mem_2.o label_vector.o linkedli
CFLAGS = -O
subset: $(OBJECTS)
$(CC) $(OBJECTS) -o subset -lm
- subset < Test/label_vector.tab
- subset -sim 0.5 < Test/label_vector.tab
@mcs07
mcs07 / lilly.diff
Created May 18, 2014 18:08
Patch for Lilly MedChem Rules to compile on OS X Mavericks with clang.
diff --git a/include/iwaray.h b/include/iwaray.h
index 1b58e95..213f25a 100644
--- a/include/iwaray.h
+++ b/include/iwaray.h
@@ -341,7 +341,7 @@ resizable_array_p<T>::resizable_array_p (int n)
template <typename T>
resizable_array_p<T>::resizable_array_p (T * item)
{
- add (item);
+ this->add (item);
@mcs07
mcs07 / cinema.scpt
Created April 6, 2014 11:40
Parse booking confirmation emails from Cinema and add Calendar event.
-- Parse booking confirmation emails from Cinema and add Calendar event
-- Author: Matt Swain <m.swain@me.com>, Version 1.0, License: MIT
-- Triggered by Mail rule.
using terms from application "Mail"
on perform mail action with messages msgs for rule theRule
tell application "Mail"
repeat with msg in msgs
try
set msgcontent to content of msg
@mcs07
mcs07 / tautomer.py
Created April 3, 2014 15:20
Rough first go at tautomer enumeration and canonicalization using RDKit in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
from itertools import tee, izip
import logging
from rdkit import Chem
from rdkit.Chem.rdchem import BondType, BondStereo, BondDir
__author__ = 'Matt Swain'
@mcs07
mcs07 / ocrad-mavericks.diff
Last active December 30, 2015 00:39
A patch for ocrad 0.22 to compile with libc++ which is now the default in OS X Mavericks.
diff --git a/character_r11.cc b/character_r11.cc
index 9b054e1..794e9c0 100644
--- a/character_r11.cc
+++ b/character_r11.cc
@@ -18,6 +18,7 @@
#include <algorithm>
#include <cstdio>
+#include <cstdlib>
#include <vector>
@mcs07
mcs07 / rdkit-mavericks.diff
Created November 6, 2013 11:52
A patch for RDKit 2013.09.1 to compile with libc++ which is now the default in Mavericks.
diff --git a/Code/RDGeneral/Dict.h b/Code/RDGeneral/Dict.h
index 6d368a4..6f586a8 100644
--- a/Code/RDGeneral/Dict.h
+++ b/Code/RDGeneral/Dict.h
@@ -32,14 +32,12 @@
//!
class Dict {
public:
- typedef std::map<const std::string, boost::any> DataType;
+ typedef std::map<std::string, boost::any> DataType;
@mcs07
mcs07 / openbabel-parsmart.diff
Created November 1, 2013 11:51
A patch to prevent segmentation faults in Open Babel.
diff --git a/src/parsmart.cpp b/src/parsmart.cpp
index 120963e..22fe56e 100644
--- a/src/parsmart.cpp
+++ b/src/parsmart.cpp
@@ -1181,7 +1181,6 @@ namespace OpenBabel
FreeAtomExpr(expr1);
return (AtomExpr*)0;
}
- delete expr1;
expr1 = BuildAtomBin(AE_ANDLO,expr1,expr2);
@mcs07
mcs07 / gocr-libs.diff
Created August 14, 2013 09:02
A patch for the gocr makefile so `make libs` works properly.
diff --git a/src/Makefile.in b/src/Makefile.in
index bf4181f..883fec2
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -10,7 +10,7 @@ PROGRAM = gocr$(EXEEXT)
PGMASCLIB = Pgm2asc
#LIBPGMASCLIB = lib$(PGMASCLIB).a
# ToDo: need a better pgm2asc.h for lib users
-#INCLUDEFILES = gocr.h
+INCLUDEFILES = pgm2asc.h output.h list.h unicode.h gocr.h pnm.h
@mcs07
mcs07 / inchi-osx.diff
Last active July 4, 2022 13:08
A patch for the InChI 1.04 makefile to support Mac OS X. This is needed because the OS X linker does not support `soname` or `version-script`.
diff --git a/INCHI_API/gcc_so_makefile/libinchi.map b/INCHI_API/gcc_so_makefile/libinchi.map
index 0526992..0f768c8 100755
--- a/INCHI_API/gcc_so_makefile/libinchi.map
+++ b/INCHI_API/gcc_so_makefile/libinchi.map
@@ -1,5 +1,32 @@
-{
-global: CheckINCHI; CheckINCHIKey; FreeINCHI; FreeStdINCHI; FreeStructFromINCHI; FreeStructFromStdINCHI; Free_inchi_Input; Free_std_inchi_Input; GetINCHI; GetINCHIKeyFromINCHI; GetINCHIfromINCHI; GetStdINCHI; GetStdINCHIKeyFromStdINCHI; GetStringLength; GetStructFromINCHI; GetStructFromStdINCHI; Get_inchi_Input_FromAuxInfo; Get_std_inchi_Input_FromAuxInfo; INCHIGEN_Create; INCHIGEN_Destroy; INCHIGEN_DoCanonicalization; INCHIGEN_DoNormalization; INCHIGEN_DoSerialization; INCHIGEN_Reset; INCHIGEN_Setup; STDINCHIGEN_Create; STDINCHIGEN_Destroy; STDINCHIGEN_DoCanonicalization; STDINCHIGEN_DoNormalization; STDINCHIGEN_DoSerialization; STDINCHIGEN_Reset; STDINCHIGEN_Setup;
-local: *;
-};
-