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 Patrick Bisenius | |
| */ | |
| public class MathUtil { | |
| public static double scalarProduct(double[] v1, double[] v2) { | |
| double scalarProduct = 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
| driver.get(baseUrl + "/app_dev.php/firma/sascha-weyers-internet-solutions-7"); | |
| driver.findElement(By.cssSelector("span > span > span")).click(); | |
| driver.findElement(By.cssSelector("#googleMapsToggle > span > span > span")).click(); | |
| for (int second = 0;; second++) { | |
| if (second >= 60) fail("timeout"); | |
| try { if (isElementPresent(By.cssSelector("div[title=\"Satellitenbilder anzeigen\"]"))) break; } catch (Exception e) {} | |
| Thread.sleep(1000); | |
| } | |
| driver.findElement(By.cssSelector("div[title=\"Satellitenbilder anzeigen\"]")).click(); |
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 Person findMostSimilarTo(Person p) { | |
| Person bestMatch = null; | |
| Profile ownProfile = this.getProfile(p); | |
| int bestScore = 0; | |
| for(int i = 0; i < this.profiles.length; i++) { | |
| // don't compare the person with itself | |
| if(p.equals(this.profiles[i].getOwner())) { | |
| continue; | |
| } |
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 Person[] getPersons() { | |
| Person[] persons = new Person[this.getSize()]; | |
| int length = 0; | |
| for(int i = 0; i < profiles.length; i++) { | |
| if(profiles[i] != null) { | |
| persons[length] = profiles[i].getOwner(); | |
| length++; | |
| } | |
| } |
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 Baby { | |
| String name; | |
| double gewicht; | |
| double groesse; | |
| double lautstaerke; | |
| double stillfrequenz; | |
| String haarfarbe; | |
| char geschlecht; |
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 ip2country($ipv4) { | |
| $sock = fsockopen("whois.ripe.net", 43); | |
| fwrite($sock, $ipv4."\n"); | |
| $info = ''; | |
| while (!feof($sock)) { | |
| $info .= fgetc($sock); | |
| } | |
| fclose($sock); | |
| preg_match("/country:[ ]+([A-Z]{2})\n/", $info, $match); | |
| if(isset($match[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
| // DB-Kram einbinden | |
| $tunings = $db->get_results("SELECT * FROM tunings"); | |
| $by_component = array(); | |
| foreach($tunings AS $tuning) { | |
| $by_component[$tuning['component']] = $tuning; | |
| } |
NewerOlder