Skip to content

Instantly share code, notes, and snippets.

View mcs07's full-sized avatar

Matt Swain mcs07

View GitHub Profile
@mcs07
mcs07 / osra_lib.patch
Created March 5, 2017 14:46
Patch osra lib v2.1.0
diff --git a/src/osra_lib.cpp b/src/osra_lib.cpp
index 4262e83..48979ae 100644
--- a/src/osra_lib.cpp
+++ b/src/osra_lib.cpp
@@ -635,7 +635,7 @@ int osra_process_image(
if (type.empty() || type == "PDF" || type == "PS")
{
#ifdef OSRA_LIB
- poppler_doc = load_from_raw_data(image_data, image_length);
+ poppler_doc = poppler::document::load_from_raw_data(image_data, image_length);
@mcs07
mcs07 / boost-1.60.diff
Created April 21, 2016 18:22
Fix auto-pointer registration in Boost Python 1.60 from https://github.com/boostorg/python/pull/59
diff --git a/boost/python/object/class_metadata.hpp b/boost/python/object/class_metadata.hpp
index c71cf67..5009c17 100644
--- a/boost/python/object/class_metadata.hpp
+++ b/boost/python/object/class_metadata.hpp
@@ -164,7 +164,7 @@ struct class_metadata
>::type held_type;
// Determine if the object will be held by value
- typedef is_convertible<held_type*,T*> use_value_holder;
+ typedef mpl::bool_<is_convertible<held_type*,T*>::value> use_value_holder;

Download:

cd /opt
wget https://github.com/rdkit/rdkit/archive/Release_2015_09_2.tar.gz
tar -xvf Release_2015_09_2.tar.gz
mv rdkit-Release_2015_09_2 rdkit_2015_09_2

Setup environment:

cd /opt/rdkit_2015_09_2

@mcs07
mcs07 / osra-makefile.diff
Created January 3, 2016 14:17
Remove Makefile.dep from OSRA makefile so it compiles without java
diff --git a/src/Makefile b/src/Makefile
index 031a499..3ba2de7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -3,7 +3,6 @@
#
include ../Makefile.inc
-include Makefile.dep
@mcs07
mcs07 / osra-adaptiveThreshold.diff
Created January 2, 2016 20:47
Fix OSRA use of graphicsmagick adaptiveThreshold to avoid ambiguous error
diff --git a/src/osra_grayscale.cpp b/src/osra_grayscale.cpp
index 32816ed..1b819d1 100644
--- a/src/osra_grayscale.cpp
+++ b/src/osra_grayscale.cpp
@@ -266,12 +266,12 @@ bool convert_to_gray(Image &image, bool invert, bool adaptive, bool verbose)
image.despeckle();
if (invert)
{
- image.adaptiveThreshold(window,window,7);
+ image.adaptiveThreshold(window,window,7.0);
@mcs07
mcs07 / indigo-depict-1.2.1.diff
Created January 2, 2016 16:56
Fix indigo-depict link flags
diff --git a/utils/indigo-depict/CMakeLists.txt b/utils/indigo-depict/CMakeLists.txt
index ac7e6ec..34ae32d 100644
--- a/utils/indigo-depict/CMakeLists.txt
+++ b/utils/indigo-depict/CMakeLists.txt
@@ -4,6 +4,7 @@ project(IndigoDepict)
include(DefineTest)
include_directories(../../api ../../api/plugins/renderer ../../common)
+include_directories(${IndigoRenderer_SOURCE_DIR} ${Indigo_SOURCE_DIR} ${Indigo_SOURCE_DIR}/src ${Cairo_SOURCE_DIR} ${Common_SOURCE_DIR} ${Common_SOURCE_DIR}/..)
@mcs07
mcs07 / indigo-el-capitan.diff
Created January 2, 2016 16:39
Allow Indigo to compile under OS X 10.11
diff --git a/common/cmake/GetSystemVersion.cmake b/common/cmake/GetSystemVersion.cmake
index 17615ab..794babd 100644
--- a/common/cmake/GetSystemVersion.cmake
+++ b/common/cmake/GetSystemVersion.cmake
@@ -27,6 +27,8 @@ elseif(APPLE)
set(SUBSYSTEM_NAME "10.9")
elseif(DARWIN_VERSION MATCHES 14)
set(SUBSYSTEM_NAME "10.10")
+ elseif(DARWIN_VERSION MATCHES 15)
+ set(SUBSYSTEM_NAME "10.11")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Download all UV-Vis spectra available from NIST Chemistry Webbook."""
import os
import re
import requests
from bs4 import BeautifulSoup
@mcs07
mcs07 / keybase.md
Created January 12, 2015 23:15
keybase.md

Keybase proof

I hereby claim:

  • I am mcs07 on github.
  • I am mcs07 (https://keybase.io/mcs07) on keybase.
  • I have a public key whose fingerprint is 9329 8D08 E4D2 F2B6 85FB 56B0 3872 03B9 4DFC 10FD

To claim this, I am signing this object: