Skip to content

Instantly share code, notes, and snippets.

View joe776's full-sized avatar

Joerg Schoenfisch joe776

  • Mannheim, Germany
View GitHub Profile
import 'dart:convert';
void main() {
print(json.encode([null]));
print(json.encode(double.nan, toEncodable: (_) => 'NaN'));
print(json.encode([double.nan], toEncodable: (_) => 'NaN'));
print(json.encode({'foo': [double.nan]}, toEncodable: (_) => null));
}
@joe776
joe776 / BasicExampleReuse2.groovy
Created November 13, 2015 15:25
PSL basic-example using an existing database
import java.text.DecimalFormat
import edu.umd.cs.psl.application.inference.MPEInference
import edu.umd.cs.psl.config.*
import edu.umd.cs.psl.database.DataStore
import edu.umd.cs.psl.database.Database
import edu.umd.cs.psl.database.Partition
import edu.umd.cs.psl.database.rdbms.RDBMSDataStore
import edu.umd.cs.psl.database.rdbms.driver.H2DatabaseDriver
import edu.umd.cs.psl.database.rdbms.driver.H2DatabaseDriver.Type
@joe776
joe776 / BasicExampleReuse.groovy
Created November 13, 2015 15:15
PSL basic-example using an existing database
import java.text.DecimalFormat
import edu.umd.cs.psl.application.inference.MPEInference
import edu.umd.cs.psl.config.*
import edu.umd.cs.psl.database.DataStore
import edu.umd.cs.psl.database.Database
import edu.umd.cs.psl.database.Partition
import edu.umd.cs.psl.database.rdbms.RDBMSDataStore
import edu.umd.cs.psl.database.rdbms.driver.H2DatabaseDriver
import edu.umd.cs.psl.database.rdbms.driver.H2DatabaseDriver.Type
@joe776
joe776 / index.html
Created October 10, 2011 07:54 — forked from yohman/index.html
Twitter Smash
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.29.1"></script>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places" type="text/javascript"></script>
<link href='http://fonts.googleapis.com/css?family=Ubuntu:500' rel='stylesheet' type='text/css'>
@joe776
joe776 / data.json
Created October 7, 2011 09:34
Force-direct graph with rectangular nodes and labels
{"links":[{"source":22,"target":0},{"source":2,"target":70},{"source":2,"target":71},{"source":2,"target":72},{"source":17,"target":170},{"source":5,"target":0},{"source":18,"target":144},{"source":1,"target":121},{"source":1,"target":120},{"source":18,"target":142},{"source":1,"target":123},{"source":18,"target":141},{"source":1,"target":122},{"source":1,"target":117},{"source":1,"target":116},{"source":1,"target":119},{"source":1,"target":118},{"source":1,"target":115},{"source":21,"target":0},{"source":16,"target":143},{"source":16,"target":144},{"source":6,"target":0},{"source":18,"target":63},{"source":18,"target":64},{"source":18,"target":62},{"source":20,"target":0},{"source":16,"target":142},{"source":16,"target":141},{"source":3,"target":0},{"source":19,"target":0},{"source":15,"target":135},{"source":15,"target":134},{"source":4,"target":0},{"source":15,"target":136},{"source":15,"target":133},{"source":15,"target":132},{"source":23,"target":89},{"source":7,"target":43},{"source":23,"target":88},{"s
/*
* Added additional null checks when closing the ResultSet and Statements.
*
* Thanks to pihug12 and Grzegorz Oledzki at stackoverflow.com
* http://stackoverflow.com/questions/5332149/jdbc-scriptrunner-java-lang-nullpointerexception?tab=active#tab-top
*/
/*
* Modified: Use logWriter in print(Object), JavaDoc comments, correct Typo.
*/
/*