Skip to content

Instantly share code, notes, and snippets.

View erikbgithub's full-sized avatar

Erik Bernoth erikbgithub

View GitHub Profile
public class ShowIf {
public void printWay(boolean A, boolean B) {
if(A) {
System.out.println("A is true, but B is not");
}
if(B) {
System.out.println("B is true, but A is not");
}else{
System.out.println("Both A and B aren't true");
}
public class ShowIf {
public void printWay(boolean A, boolean B) {
if(A) {
if(B) {
System.out.println("A ist wahr, und auch B");
} else {
System.out.println("A ist wahr, aber nicht B");
}
} else {
if(B) {
return actualValue < maximumValue;
sut.printWay(true, true);
sut.printWay(true, false);
sut.printWay(false, true);
sut.printWay(false, false);
public class ShowIf {
public void printWay(boolean A, boolean B) {
if(A && B) {
System.out.println("A ist wahr, und auch B");
} else if(A) {
System.out.println("A ist wahr, aber nicht B");
} else if(B) {
System.out.println("B ist wahr, aber nicht A");
} else {
System.out.println("weder A noch B ist wahr");
if(actualValue < maximumValue) {
return True;
} else {
return False;
}
export PS1="\[\033[01;36m\]`ifconfig -a |\
perl -ne 'if (m/^\s*inet (?:Adresse:)?([\d.]+).*?cast/) \
{print qq($1); exit 0; }'`\[\033[00m\]:\[\033[01;36m\]\W \
\[\033[01;36m\]\u\[\033[00m\]\$ "
#!/bin/sh ####################################################################
#
# author: Erik Bernoth
#
# tricks the mac 10.5 terminal tab name into writing the ssh position instead
# of just "ssh"
#
# (c) 2009, do with this program what you want
#
##############################################################################
unset PROMPT_COMMAND
function title {
echo -en "\033]2;$1\007"
}
title `ifconfig -a | perl -ne \
'if (m/^\s*inet (?:addr:)?([\d.]+).*?cast/) {print qq($1); exit 0; }'`
public List getRoute(myNode start, myNode end){
//initialise variables
myNode actual = end;
myNodeList wayBack = new myNodeList();
wayBack.add(end);
myNodeList way = new myNodeList();
//find the minimum spanning tree with end
myNodeMap map = this.spanner.span(this.g, start);