Skip to content

Instantly share code, notes, and snippets.

View MPriess's full-sized avatar
🏠
Working from home

Michael Prieß MPriess

🏠
Working from home
View GitHub Profile
## Booting kernel from Legacy Image at 80000000 ...
Image Name: Ubuntu Kernel
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3734736 Bytes = 3.6 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 81600000 ...
Image Name: Ubuntu Initrd
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Platte /dev/dm-0: 4082 MByte, 4082106368 Byte
255 Köpfe, 63 Sektoren/Spur, 496 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Gerät boot. Anfang Ende Blöcke Id System
/dev/dm-0p1 * 1 9 72261 c W95 FAT32 (LBA)
/dev/dm-0p2 10 496 3911827+ 83 Linux
@MPriess
MPriess / gist:1566121
Created January 5, 2012 16:57
Bundle Manifest
Bundle headers:
Bnd-LastModified = 1324388798185
Build-Jdk = 1.6.0_21
Built-By = doe
Bundle-Description = sqljdbc4-osgi
Bundle-ManifestVersion = 2
Bundle-Name = sqljdbc4-osgi
Bundle-SymbolicName = com.microsoft.sqlserver.sqljdbc4-osgi
Bundle-Version = 3.0.0
Created-By = Apache Maven Bundle Plugin
@MPriess
MPriess / gist:1620048
Created January 16, 2012 09:54
Java Hibernate
public class UnicodeSQLServerDialect extends SQLServerDialect {
public UnicodeSQLServerDialect() {
super();
registerColumnType(Types.VARCHAR, 255, "nvarchar($l)");
registerColumnType(Types.CHAR, "nchar(1)");
registerColumnType(Types.CLOB, "nvarchar(max)");
}
}
@MPriess
MPriess / gist:2873822
Created June 5, 2012 09:23
ConnectionPool Test
public class JUnitTest
{
private PGPoolingDataSource dataSource;
@Before
public void setup() {
dataSource = new PGPoolingDataSource();
dataSource.setServerName("localhost:5432/foo");
dataSource.setUser("postgres");
dataSource.setPassword("postgres");
@MPriess
MPriess / latency.markdown
Created June 19, 2012 09:27 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

public FooWS getEndpoint() throws MalformedURLException {
if (webservice == null) {
FooWS client = new FooWSService(new URL(wsEndpoint)).getFooWSPort();
if (timeout != -1)
{
Client cl = ClientProxy.getClient(client);
HTTPConduit http = (HTTPConduit)cl.getConduit();
function createFooLayer() {
return new OpenLayers.Layer.Vector(" foo", {
minZoomLevel: 7,
maxZoomLevel: 10,
styleMap: new OpenLayers.StyleMap(incidentStyle),
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: geoserverUrl,
featureType: "foo",
featureNS: "http://www.foo.com",
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://raw.github.com/jzaefferer/jquery-validation/1.11.1/jquery.validate.js"></script>
<script src="http://raw.github.com/jzaefferer/jquery-validation/1.11.1/additional-methods.js"></script>
</head>
<body>
input {
log4j {
port => 4712
}
}
output {
loggly {
key => abcdef12-3456-7890-abcd-ef0123456789
proxy_host => myproxy.com # string (optional)
proxy_port => 8080 # number (optional)