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
import java.util.Calendar; | |
import java.util.Date; | |
public Date dateIn(int days) { | |
Date date = new Date(); | |
Calendar cal = Calendar.getInstance(); | |
cal.setTime(date); | |
cal.add(Calendar.DATE, days); | |
cal.set(Calendar.MINUTE, 0); |
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 ajax(url, method, data, async) { | |
method = typeof method !== 'undefined' ? method : 'GET'; | |
async = typeof async !== 'undefined' ? async : false; | |
if (window.XMLHttpRequest) { | |
var xhReq = new XMLHttpRequest(); | |
} | |
else { | |
var xhReq = new ActiveXObject('Microsoft.XMLHTTP'); | |
} |
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
# This is a quick and dirty script for Max OS X Mavericks to install | |
# the Ruby rmagick Gem (Version 2.12.2) correct with Homebrew and ImageMagick | |
# Uninstall current ImageMagick (if installed) | |
if brew list -1 | grep -q "imagemagick"; then | |
brew uninstall imagemagick --force | |
fi | |
# Get all versions of ImageMagick via Homebrew | |
brew versions imagemagick |
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
/** | |
* | |
* @author Florian Nitschmann | |
* @version 1.0 | |
*/ | |
public class fractionArithmetic { | |
/* | |
* Variablen für den Bruch (Zähler und Nenner) | |
* |
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
/* | |
* 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 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 (f.nitschmann@googlemail.com) | |
* @version 0.1 | |
*/ | |
public class QuickSort { | |
/* | |
* void sort - Sort an numeric array |
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
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 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 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 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; | |
} |
OlderNewer