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
private void submitSolution(String[] tokens) { | |
if(tokens.length == 4) { | |
if(!isValidNumber(tokens[1])) { | |
System.err.println("Error! Invalid task ID."); | |
return; | |
} | |
if(!isValidMatrNo(tokens[2])) { | |
System.err.println("Error! Invalid matrNo."); |
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
$em = $client->getContainer()->get('doctrine')->getEntityManager(); | |
$company = $em->getRepository('FirmaLogicBundle:User')->findOneBy(array()); | |
$crawler = $client->request('GET', '/firma/' . $company->getSlug()); | |
$this->assertEquals(200, $client->getResponse()->getStatusCode()); | |
// check if heading is correct | |
$this->assertEquals(1, $crawler->filterXPath('/html/body/div/div[2]/div/h2')->count()); | |
$this->assertEquals(1, $crawler->filter('html:contains("' . $company->getName() . '")')->count()); |
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
function objSort(&$arr) { | |
usort($arr, function($a, $b) { | |
if($a !== null && $b !== null) { | |
return $a->compareTo($b); | |
} | |
} | |
} |
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
/** | |
* @ORM\ManyToMany(targetEntity="Product", inversedBy="contactPersons", fetch="EXTRA_LAZY", cascade={"persist"}) | |
* @ORM\JoinTable(name="contactPersons_products") | |
* @ORM\OrderBy({"name"="ASC"}) | |
*/ | |
protected $products; |
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
/** | |
* @ORM\Entity | |
*/ | |
class UserProductAssociation | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="bigint") | |
* @ORM\GeneratedValue(strategy="AUTO") |
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
BufferedImage tmp = ImageIO.read(new File(currentBestMatch.getFilename())); | |
Image scaled = tmp.getScaledInstance(fragmentSize, fragmentSize, BufferedImage.SCALE_SMOOTH); | |
g.drawImage(scaled, i, k, null); |
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
/* Auch wieder in die user.css packen; komplett ungetestet in allem | |
außer Chrome; dürfte vermutlich im IE < 9 nicht funktionieren. | |
Problem: Die erste Codebox eines Artikels darf nicht zu weit oben | |
im Artikel stehen, ansonsten überlagert die Seitenleiste den Code. | |
Deswegen wird die „Verbreiterung“ sicherheitshalber auch nur auf | |
Code im „Erweiterten Eintrag“ angewendet – aber auch da aufpassen, | |
wenn der „Teaser“ (also der „normale“ Eintrag sehr kurz ist, kann | |
das wahrscheinlich trotzdem überlagern.) */ |
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/bash | |
UBERSPACE=paddya | |
DOMAIN=paddya.de | |
SUBDOMAIN=$1 | |
SQLDB="${UBERSPACE}_$1" | |
if [[ "$1" = "" ]] | |
then | |
echo "Oops, no subdirectory name specified." | |
exit 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
<?php | |
// database access | |
$dbName = ''; | |
$dbUser = ''; | |
$dbPass = ''; | |
$dbHost = 'localhost'; | |
// table | |
$table = 'values'; |
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
char* getTime() | |
{ | |
struct timeval time; | |
static char timeString[30]; | |
gettimeofday(&time, NULL); | |
strftime(timeString, 30, "%d.%m.%Y - %H:%M:%S", localtime(&time.tv_sec)); |