This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JOptionPane { | |
/** | |
* input is essentially the same array as args | |
*/ | |
private static String[] input; | |
/** | |
* ctr is the index of the value we want from args | |
* it starts at 0 and is incremented every time showInputDialog is called | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Matrix { | |
public static float[] toMatrix( | |
float m00, float m01, float m02, float m03, | |
float m10, float m11, float m12, float m13, | |
float m20, float m21, float m22, float m23, | |
float m30, float m31, float m32, float m33) { | |
float[] f = { | |
m00, m10, m20, m30, | |
m01, m11, m21, m31, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ulyssecarion.pdb.distances.precalculations; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.biojava.bio.structure.Atom; | |
import org.biojava.bio.structure.Calc; | |
import org.biojava.bio.structure.Chain; | |
import org.biojava.bio.structure.Group; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
puts "Usage: nowplus [seconds].\nDefaulting to Time.now:" unless ARGV[0] | |
puts Time.now + ARGV[0].to_i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function itemOut(event) { | |
var to = event.relatedTarget; | |
var from = event.currentTarget; | |
// Get the first parent of from and to that match the selector ".isotope-item"; | |
// if parents() returns undefined, then simply return from / to. | |
var parentFrom = $(from).parents(".isotope-item")[0] || from; | |
var parentTo = $(to).parents(".isotope-item")[0] || to; | |
// if the two elements are part of the same .isotope-item, then do not do any animation (this avoids shutter effects). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<cml> | |
<MDocument> | |
<MChemicalStruct> | |
<molecule title="alkyl" molID="m1"> | |
<propertyList> | |
<property dictRef="rotation.unit" title="rotation.unit"> | |
<scalar>15</scalar> | |
</property> | |
<property dictRef="abbreviation" title="abbreviation"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for dir in */ | |
do | |
find ./$dir -type f | wc -l | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.pdb.query.simple.distance; | |
import java.io.File; | |
import java.io.IOException; | |
import java.sql.Connection; | |
import java.sql.SQLException; | |
import java.util.List; | |
import org.apache.commons.io.FileUtils; | |
import org.biojava.bio.structure.Element; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'docker' | |
require 'shellwords' | |
image = Docker::Image.all.first | |
s = IO.read('tmp.rb').shellescape | |
cmd = [ "/bin/bash", "-c", "echo #{s} > roobee.rb; ruby roobee.rb" ] | |
puts "Response from Docker: " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'extension_cord' | |
def average_reduce(arr) | |
arr.reduce(:+).to_f / arr.size | |
end | |
def average_upto(arr) | |
sum = 0 |
OlderNewer