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
var Person = function() { | |
var name; | |
var age; | |
var savings = 0.0; | |
this.getName = function() { | |
return name; | |
}; | |
this.setName = function(value) { |
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 class Methoden { | |
public static void main(String[] args){ | |
// da kein return Wert, brauchen wir auch nichts speichern | |
ausgeben("Hallo Ausgabe"); | |
// da keine Argumente erwartet, uebergeben wir auch keine | |
int zahl = gibDrei(); | |
System.out.println(zahl); |
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 class String_Schleife { | |
public static void main(String[] args) { | |
// Arrays | |
// Datentyp[] meinArrayName = new Datentyp[anzahlderElemente]; | |
// String array erstellen | |
String[] stringArray = new String[3]; // groesse muss festgelegt sein | |
// mit stringArray.length laesst sich die laenge des arrays (hier 4) abfragen |
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 class C_Schleifen { | |
public static void main(String[] args){ | |
// Fuer Programmteile die beliebig oft wiederholt werden sollen | |
// bietet Java Schleifen | |
// Beispiel: Zaehlervariable soll von 0 bis 10 in 1er Schritten erhoeht werden | |
int zaehler = 0; |
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 class B_Bedingungen { | |
public static void main(String[] args) { | |
// Variablen a, b | |
int a = 10; | |
int b = 11; | |
// Ohne Bedingungen werden Java Programme Zeile für Zeile ausgewertet |
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 class A_Zuweisungen { | |
public static void main(String[] args) { | |
// Deklarierung (ohne Wert) | |
int a; | |
int b, c, d; | |
// Initialisierung (mit Wertzuweisung) | |
a = 7; |
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
/** | |
* Finds posts by the specified blog | |
* | |
* @param \TYPO3\Blog\Domain\Model\Blog $blog The blog the post must refer to | |
* @param integer $limit The number of posts to return at max | |
* @return \TYPO3\Flow\Persistence\QueryResultInterface The posts | |
*/ | |
public function findByBlog(\TYPO3\Blog\Domain\Model\Blog $blog, $limit) { | |
$query = $this->createQuery(); | |
$query->setLimit($limit); |
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
PHP Code:: | |
class Ship { | |
public $name; | |
public $coaches; | |
public $engineStatus; | |
public $speed; | |
function __construct($name, $coaches) { |
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
/** | |
* given three positions in an array a, | |
* checks which of those array elements is the median | |
* and returns the corresponding index | |
* if multiple elements are equal, returns second if appropriate | |
* | |
* @param first index of first element to compare | |
* @param second index of second element to compare | |
* @param third index of third element to compare | |
* @return the index of the found median element |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
#LICENSE: WTFPL | |
#DEPENDS: on this cool font from http://asdasd.rpg.fi/~svo/glasstty/ | |
#TODO: port to Python3 | |
from time import sleep | |
from sys import stdout |