What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-07 12:42:04
Daten Abfragen mit PHP aus MySQL Datenbank mysqli
<?php $mysqli = new mysqli("localhost", "user", "password", "database"); if ($mysqli->connect_errno) { die("Verbindung fehlgeschlagen: " . $mysqli->connect_error); } $id = ... Add solution -
Javascript 2021-10-07 00:53:06
The constructor property returns the constructor function for all JavaScript variables.
"John".constructor // Returns function String() { [native code] } (3.14).constructor &n... Add solution -
Java 2021-10-06 09:20:03
java list get first element
final Object firstElement = list.stream() .findFirst() .orElse(new Object()) //Give a default value if there are no elements final Object firstElement = list.stream() .findFirst() .orElseThrow(() -> new Exception()) //Throw an exception if t... Add solution -
Java 2021-10-05 12:42:03
java mongodb find with multiple conditions
BasicDBObject criteria = new BasicDBObject(); criteria.append("color", "black"); criteria.append("shape", "round"); criteria.append("weight", 100); DBCursor cur = widgets.find(criteria); Add solution -
Javascript 2021-09-29 16:16:03
javascript get line number of error
function getErrorObject(){ try { throw Error('') } catch(err) { return err; } } var err = getErrorObject(); var caller_line = err.stack.split("\n")[4]; var index = caller_line.indexOf("at "); var clean = caller_line.slice(index+2,... Add solution -
TypeScript 2021-09-28 23:06:03
reading multiple objects from file in java
FileInputStream fis = new FileInputStream("outputFile"); ArrayList<Object> objectsList = new ArrayList<>(); boolean cont = true; while (cont) { try (ObjectInputStream input = new ObjectInputStream(fis)) { Object obj = input.rea... Add solution
Best helpers
Ranking is empty