Skip to content

Instantly share code, notes, and snippets.

Daniel Mitterdorfer danielmitterdorfer

Block or report user

Report or block danielmitterdorfer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@danielmitterdorfer
danielmitterdorfer / MixedRandomList_GarbageProducer
Created Jul 17, 2018 — forked from jsound/MixedRandomList_GarbageProducer
GC benchmark producing a mix of lifetime=0 and lifetime>0 objects which are kept in randomly updated lists
View MixedRandomList_GarbageProducer
package de.am.gc.benchmarks;
import java.util.ArrayList;
import java.util.List;
/**
* GC benchmark producing a mix of lifetime=0 and lifetime>0 objects which are kept in randomly updated lists.
*
* @author jsound
*/
@danielmitterdorfer
danielmitterdorfer / recover_source_code.md
Created Mar 23, 2017 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory
View recover_source_code.md

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
View DnsDemo.java
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Calendar;
import java.util.Optional;
public class DnsDemo {
public static void main(String[] args) throws Exception {
while (true) {
System.out.printf("%1$tH:%1$tM:%1$tS%n", Calendar.getInstance());
printAddressInfo(addressOf("www.google.com"));
View gist:9099932
// Leads to command line output (jmh 0.4):
//
// # Warmup Fork: 1 of 3
// # Warmup Fork: 2 of 3
// # Warmup Fork: 3 of 3
// # Warmup Fork: 4 of 3
// # Warmup Fork: 5 of 3
//
@Fork(value = 3, warmups = 5)
public class JMHSettingsMicroBenchmark {
You can’t perform that action at this time.