This file contains hidden or 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
/** | |
* | |
* @author Florian Nitschmann | |
* @version 1.0 | |
*/ | |
public class fractionArithmetic { | |
/* | |
* Variablen für den Bruch (Zähler und Nenner) | |
* |
This file contains hidden or 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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
/* | |
* Interface.java | |
* | |
* Created on 27.03.2012, 21:01:59 | |
*/ |
This file contains hidden or 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
/** | |
* Easy JAVA class to sort numeric arrays | |
* | |
* @author Florian Nitschmann ([email protected]) | |
* @version 0.1 | |
*/ | |
public class QuickSort { | |
/* | |
* void sort - Sort an numeric array |
This file contains hidden or 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
static int linearlySearch(int[] field, int searchIndex) { | |
for (int i = 0; i < field.length; i++) | |
if (field[i] == searchIndex) | |
return i; | |
return -1; // -1 no valid index | |
} |
This file contains hidden or 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 static int binaereSuche(int[] feld, int x) | |
{ | |
int unten=0, mitte=0, oben=feld.length; | |
while (unten<oben) | |
{ | |
mitte=(unten+oben)/2; | |
if (feld[mitte]==x) | |
{ | |
return mitte+1; | |
} |
This file contains hidden or 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 function array_multi_unique($multiArray){ | |
$uniqueArray = array(); | |
foreach($multiArray as $subArray) { | |
if(!in_array($subArray, $uniqueArray)) { | |
$uniqueArray[] = $subArray; | |
} | |
} | |
return $uniqueArray; | |
} |
This file contains hidden or 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
int potency(int basis, int exponent) { | |
if(exponent == 1) return basis; | |
else return this.potenz(basis, exponent-1)*basis; | |
} |
This file contains hidden or 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
# !/bin/sh | |
user="$(whoami)" | |
bin_dir="/Users/$user/bin" | |
if [ ! -d "$bin_dir" ] | |
then | |
echo "Create directory $bin_dir\n" | |
mkdir "$bin_dir" | |
fi | |
command_line="/Applications/Sublime Text 2.app/Contents/SharedSupport/bin" |
This file contains hidden or 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
ENV["RAILS_ENV"] ||= "test" | |
require File.expand_path("../dummy/config/environment.rb", __FILE__) | |
require "rubygems" | |
require "spork" | |
require "rspec/rails" | |
require "rspec/autorun" | |
Spork.prefork do |
This file contains hidden or 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
class String | |
# Print a String in a specfic color | |
def colorize(text, color_code) | |
"#{color_code}#{text}\e[0m" | |
end | |
# Green String | |
def green | |
colorize(self, "\e[1m\e[32m") | |
end | |
end |
OlderNewer