Skip to content

Instantly share code, notes, and snippets.

View ctrueden's full-sized avatar
🛸
Experiencing technical difficulties

Curtis Rueden ctrueden

🛸
Experiencing technical difficulties
View GitHub Profile
@ctrueden
ctrueden / gist:1352276
Created November 9, 2011 18:00
Fiji daily build
git clean -x -d -f
git submodule foreach git clean -x -d -f
./Build.sh
./bin/make-app.py nojre linux64
tar cvf fiji-nojre.tar Fiji.app
jar cvf fiji-nojre.zip Fiji.app
@ctrueden
ctrueden / gist:1386332
Created November 22, 2011 17:40
Can "git rebase --onto" move commits to another branch?
: curtis@rook ~/code/LOCI/scifio (develop)
git st
# On branch develop
nothing to commit (working directory clean)
: curtis@rook ~/code/LOCI/scifio (develop)
echo hello >> pom.xml
: curtis@rook ~/code/LOCI/scifio (develop)
git st
# On branch develop
# Changes not staged for commit:
@ctrueden
ctrueden / KnipImageJ.java
Created December 11, 2011 12:09
How to load and invoke ImageJ2 plugins
//
// KnipImageJ.java
//
/*
ImageJ software for multidimensional image processing and analysis.
Copyright (c) 2010, ImageJDev.org.
All rights reserved.
@ctrueden
ctrueden / OpsTyping.java
Created February 7, 2012 18:28
Typing seems OK here...
//
// OpsTyping.java
//
import net.imglib2.type.numeric.ComplexType;
import net.imglib2.type.numeric.RealType;
public class OpsTyping {
public <V extends ComplexType<V>> void complex(V arg) {
@ctrueden
ctrueden / Overflows.java
Created February 22, 2012 17:59
Benchmarks performance of several methods of detecting integer multiplication overflows.
//
// Overflows.java
//
import java.math.BigInteger;
/**
* Benchmarks performance of several methods of detecting integer overflows.
*
* @author Curtis Rueden
@ctrueden
ctrueden / gist:2144264
Created March 21, 2012 04:16
RealPoint constructors
/**
* Protected constructor that can re-use the passed position array.
*
* @param position
* array used to store the position.
* @param copy
* flag indicating whether to make a copy of the array.
*/
protected RealPoint( final double[] position, final boolean copy )
{
@ctrueden
ctrueden / ConstructorPerformance.java
Created March 21, 2012 18:16
Comparing RealPoint constructor implementations
//
// ConstructorPerformance.java
//
public class ConstructorPerformance {
public static double x = 1, y = 2, z = 3;
public static void main(final String[] args) throws Exception {
final int iter = 10000000;
@ctrueden
ctrueden / gist:2220296
Created March 27, 2012 21:14
Example exception from license-maven-plugin 1.0
[WARNING] skip failed file : Could not extract header on file /Users/curtis/code/ImageJ/imagej/core/ext/src/test/java/imagej/ext/plugin/PluginDiscovery.java for reason copyright [Copyright (C) 2009 - 2012 Board of Regents of the University of
Wisconsin-Madison, Broad Institute of MIT and Harvard, and Max Planck
Institute of Molecular Cell Biology and Genetics.] is not valid
org.codehaus.mojo.license.header.InvalideFileHeaderException: Could not extract header on file /Users/curtis/code/ImageJ/imagej/core/ext/src/test/java/imagej/ext/plugin/PluginDiscovery.java for reason copyright [Copyright (C) 2009 - 2012 Board of Regents of the University of
Wisconsin-Madison, Broad Institute of MIT and Harvard, and Max Planck
Institute of Molecular Cell Biology and Genetics.] is not valid
at org.codehaus.mojo.license.UpdateFileHeaderMojo.processFile(UpdateFileHeaderMojo.java:776)
at org.codehaus.mojo.license.UpdateFileHeaderMojo.prepareProcessFile(UpdateFileHeaderMojo.java:689)
at org.codehaus.mojo.license.UpdateFileHe
@ctrueden
ctrueden / gist:2220389
Created March 27, 2012 21:23
Build failure when trying to install license-maven-plugin
: curtis@sirius ~/code/Maven/license-maven-plugin (fix-multi-line-copyright)
mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building License Maven Plugin 1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ license-maven-plugin ---
[INFO]
@ctrueden
ctrueden / gist:2238895
Created March 29, 2012 15:56
I am an idiot who deserves public shame
: curtis@sirius ~/code/ImageJ/imglib (master)
find . -exec sed -i '' -e 's/^M//' {} \;
sed: .: in-place editing only works for regular files
sed: ./.git: in-place editing only works for regular files
sed: ./.git/hooks: in-place editing only works for regular files
sed: ./.git/info: in-place editing only works for regular files
sed: ./.git/logs: in-place editing only works for regular files
sed: ./.git/logs/refs: in-place editing only works for regular files
sed: ./.git/logs/refs/heads: in-place editing only works for regular files
sed: ./.git/logs/refs/remotes: in-place editing only works for regular files