Skip to content

Instantly share code, notes, and snippets.

View michaeldorner's full-sized avatar

Michael Dorner michaeldorner

View GitHub Profile
import requests
import json
from tqdm.notebook import tqdm
import time
import multiprocessing as mp
import datetime
import pandas as pd
import itertools
def convert_gerrit_timestamp_to_datetime(s):
@michaeldorner
michaeldorner / ICM.py
Created September 2, 2020 18:37
Reference implementation for Independent Cascade Model
def diffuse_information(G: nx.MultiGraph, seed: list, beta: float=1.0, case='best_case'):
informed_nodes = {n: None for n in seed}
changed = True
while changed:
for u, v, dt in G.edges(nbunch=informed_nodes, data='diffusion_time'):
changed = False
if informed_nodes[u] == None or informed_nodes[u] < dt[case]: # shall we
if random.random() < beta:
if v not in informed_nodes or dt[case] < informed_nodes[v]:
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"time"

Onboarding

Administration

  • Apply for Personnummer (via yourself)
  • Get employee card (via reception)

Office

  • Design and order business cards (via Svetlana)
@michaeldorner
michaeldorner / latexmk.tpbuild
Last active December 6, 2019 10:05
My latexmk build file for Texpad fixing the issue with paths which contain spaces
#!/bin/bash
# Texpad 1.7 Build script to build with latexmk
tempdir="$(dirname "${TEXPAD_ROOTFILE}")/.texpadtmp";
latexmk -pdf -interaction=nonstopmode -outdir="${tempdir}" -file-line-error -synctex=1 "${TEXPAD_ROOTFILE}";
#mv "${tempdir}/$(basename "${TEXPAD_ROOTFILE}")" .

Pervasion of and Motivation behind Code Review

Question 1: Do you review code as part of your daily work?

  • Rationale: We want to understand why developers review code. Our research indicated, that some just do not or if they do, they are forced to do so, but do not see any value in reviewing code.
  • Answers: Single choice with
    • No.
    • Yes, because I was told to do so.
    • Yes, because I see value in code review.
curl -o response_1.txt -k "https://android-review.googlesource.com/changes/?q=change:I78c787fd5dd09fc7700f3093341532fe23f20eb8&o=DETAILED_LABELS"
curl -o response_2.txt -k "https://android-review.googlesource.com/changes/I78c787fd5dd09fc7700f3093341532fe23f20eb8/detail"

Keybase proof

I hereby claim:

  • I am michaeldorner on github.
  • I am michaeldorner (https://keybase.io/michaeldorner) on keybase.
  • I have a public key whose fingerprint is 25BC ED74 2ACF BB2F CB10 8E78 A1C3 90C0 CFC2 4F1F

To claim this, I am signing this object:

@michaeldorner
michaeldorner / toggle_hidden_files
Last active November 2, 2018 16:35
Toggle the visibility of hidden files in macOS using Python
#!/usr/local/bin/python3
import subprocess
if __name__ == '__main__':
get_command = 'defaults read com.apple.finder AppleShowAllFiles'
current_visibility = subprocess.check_output([get_command], shell=True).decode().strip()
update_command = 'defaults write com.apple.finder AppleShowAllFiles ' + {'True': 'False', 'False': 'True'}[current_visibility] + '; killall Finder;'
subprocess.call([update_command], shell=True)
package main
import (
"encoding/gob"
"fmt"
"os"
)
func writeGob(file_path string, object interface{}) error {
file, err := os.Create(file_path)