Skip to content

Instantly share code, notes, and snippets.

@thisMagpie
thisMagpie / hookblockview
Created October 29, 2012 10:19
removingfromLine569 on casetracker some conflict.
/**
* Implements hook_block_view().
*/
function casetracker_block_view($delta) {
switch ($delta) {
case 'case':
if (user_access('access content')) {
$block['subject'] = t('Jump to case');
$block['content'] = drupal_get_form('casetracker_block_jump_to_case_number');
}
@thisMagpie
thisMagpie / PCB method
Created November 24, 2012 18:11
PBC code: Checked and Works if it is called in leapPosition. Seems to fix min image issue from earlier
public static Vector3D boundaryPositions(Vector3D position){
double posX=position.getX();
double posY=position.getY();
double posZ=position.getZ();
/*********** X Direction ***********/
if(posX < 0)
posX = posX + lengthOfBox;
@thisMagpie
thisMagpie / dimensionswitcher.txt
Created January 7, 2013 15:36
Belongs in Vector3D
//sets the x y and z coordinate in a more compact way (saves a bit of space when calling the coordinates)
public void setDim(int i, double dimension) {
switch (i) {
case 0:
x = dimension;
break;
case 1:
@thisMagpie
thisMagpie / Residuals template.
Created January 25, 2013 02:10
This is a template based on my residuals data.
#!/bin/bash
gnuplot << TOEND
# Set the output file
set terminal postscript eps color enhanced
set output 'nfnResiduals.eps'
unset key
set title "Residuals against Current for N-Type No field"
import java.io.*;
import java.util.*;
public class Hall{
// private static final int rows=8;
// private static final int cols=2;
public static void main (String[] args) throws IOException {
@thisMagpie
thisMagpie / IOUtil.java
Created January 25, 2013 02:21
messy and unfinished.
import java.io.*;
import java.util.*;
/*
***********************************8**********************************
***************** By Magdalen Berns for miniproject ******************
**********************************************************************
*
* This is a generic IOUtil class to make IO matters more simple to handle.
* Not to be confused with UserInput which is full of static methods that are not very "transferable". (i.e. I am unlikely to use them again in another program)
/*
* ********************************************************** *
* ******************* By Magdalen Berns ******************** *
* ********************************************************** *
* CONTAINS:
* a static method to compute the gaussian distribution
*
* a static method to convolve two signals (expected input gaussian distribution and set of data points we wish to smooth
import java.io.*;
import java.util.*;
public class Hall{
public static void main (String[] args) throws IOException {
if(args.length>0){
@thisMagpie
thisMagpie / GNUPlot.java
Created January 30, 2013 14:15
puts the files in the right format x y xerror yerror
import java.util.Scanner;
class GNUPlot {
private double gradient;
private double xVariance;
private double yVariance;
private double offset;
private double xxVariance;
private double yyVariance;
@thisMagpie
thisMagpie / Hall.java
Created January 30, 2013 14:17
class to hold main method for hall experiment
import java.io.*;
import java.util.*;
public class Hall{
public static void main (String[] args) throws IOException {