Skip to content

Instantly share code, notes, and snippets.

View hdclark's full-sized avatar

Hal Clark hdclark

View GitHub Profile
@hdclark
hdclark / PKGBUILD.sh
Last active January 8, 2016 08:26 — forked from chrismullins/PKGBUILD.sh
PKGBUILD for gdcm
# Maintainer: Andrzej Giniewicz <[email protected]>
# Contributor: Chris <christopher.r.mullins g-mail>
pkgname=gdcm
pkgver=2.6.2
pkgrel=3
pkgdesc='a C++ library for DICOM medical files'
arch=('i686' 'x86_64')
url='http://gdcm.sourceforge.net'
license=('BSD')
@hdclark
hdclark / Sample Excerpt
Created July 20, 2012 17:52
popen Segfault
....
FILE *fp;
....
while( true ){
if(fp == nullptr) pclose(fp); // <---seg. fault happens here. (see below)
// or
@hdclark
hdclark / "Annoy"
Created January 28, 2012 04:21
Why did I create this?
#!/bin/bash
width=200
offset=400
var=$RANDOM
let "var %= $width"
let "var += $offset"
@hdclark
hdclark / Imebra_Deprecation
Created January 14, 2012 07:04
Example Imebra auto_ptr deprecation warnings with C++0x with GCC version 4.6.2 20111223 (prerelease) (GCC)
g++ -std=c++0x -ggdb -S Imebra_Shim.cc imebra20110918/library/imebra/src/dataHandlerStringUT.cpp imebra20110918/library/imebra/src/data.cpp imebra20110918/library/imebra/src/colorTransformsFactory.cpp imebra20110918/library/imebra/src/dataHandlerTime.cpp imebra20110918/library/imebra/src/transaction.cpp imebra20110918/library/imebra/src/colorTransform.cpp imebra20110918/library/imebra/src/dataHandlerStringDS.cpp imebra20110918/library/imebra/src/dataHandlerString.cpp imebra20110918/library/imebra/src/MONOCHROME2ToYBRFULL.cpp imebra20110918/library/imebra/src/dataHandlerStringPN.cpp imebra20110918/library/imebra/src/image.cpp imebra20110918/library/imebra/src/drawBitmap.cpp imebra20110918/library/imebra/src/dataHandlerDateTimeBase.cpp imebra20110918/library/imebra/src/dataHandlerStringLT.cpp imebra20110918/library/imebra/src/dataHandlerDateTime.cpp imebra20110918/library/imebra/src/dataHandlerStringAE.cpp imebra20110918/library/imebra/src/YBRFULLToRGB.cpp imebra20110918/library/imebra/src/dicomCodec.cpp imebr
@hdclark
hdclark / pdf_grep.sh
Created November 5, 2011 20:16
PDF grepping.
#!/bin/bash
###########################################################################################
# This script is used to comb a pdf file for a specific phrase. It is bad, inefficient
# script, but I haven't been able to figure out how to properly do it yet (and I've been
# looking for several months - combing S.O. and freshmeat/freecode for proper index/search
# solutions.)
#
# Usage:
# Ensure script is executable: chmod +x /path/to/pdf_grep.sh
@hdclark
hdclark / gist:1325029
Created October 29, 2011 20:17
Shogun tutorial example #3
// Compiling with g++ Shogun.cpp -lshogun -o shoguntest
#include <shogun/features/Labels.h>
#include <shogun/features/SimpleFeatures.h>
#include <shogun/kernel/GaussianKernel.h>
#include <shogun/classifier/svm/LibSVM.h>
#include <shogun/base/init.h>
#include <shogun/lib/common.h>
#include <shogun/io/SGIO.h>
@hdclark
hdclark / Spline_test.cc
Created August 29, 2011 17:55
My Einspline test program
#include <iostream>
#include <cmath>
#include "einspline/bspline.h"
//
//Compiled with: g++ -L/usr/local/include -leinspline Spline_test.cc -o spline
//
// NOTE: if using a 32-bit computer, compile with the '-malign-double' flag.
//
@hdclark
hdclark / Read_Temp
Created August 6, 2011 01:37
ACPI Temperature echoer
// Compile with 'g++ <thisfile>.cc -o <you_choose_the_program_name_here>
//
// Use with xmobar/xmonad by inserting a line like so into your .xmobarrc.
//Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
// , bgColor = "black"
// , fgColor = "grey"
// , position = Top
// , lowerOnStart = True
// , commands = [ Run Weather "EGPF" ["-t","<station>: <tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000
// , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
@hdclark
hdclark / streamplayer.sh
Created August 5, 2011 09:47
Streamplayer
#!/bin/bash
# These are the kludge commands. If I am on my PC, I want to view things
# with XXXX options. If on my laptop, YYYY options.
if [ "$( uname -n )" = "Crushernator" ] ; then
# Laptop: Bad video card. Use x11 and zoom to reduce strain and choppiness.
extras=" -vo x11 -zoom "
elif [ "$( uname -n )" = "flancrest" ] ; then
# Desktop: So far, nothing.
extras=" "