Skip to content

Instantly share code, notes, and snippets.

View michaeldorner's full-sized avatar

Michael Dorner michaeldorner

View GitHub Profile
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"

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.
@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}")" .

Onboarding

Administration

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

Office

  • Design and order business cards (via Svetlana)
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"time"
@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]:
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):
import networkx as nx
def diffuse_information(G: nx.MultiGraph, seed: list, case='best_case'):
informed_nodes = {n: None for n in seed}
needs_update = True
while needs_update:
needs_update = False
for u, v, dt in G.edges(nbunch=informed_nodes, data='diffusion_time'):
if u in informed_nodes:
\begin{figure}[!htp] \centering
\begin{tikzpicture}
\def \radius {3cm}
\def \margin {10} % margin in angles, depends on the radius
\def \n {6}
\draw[color=white, name path=c] (0:\radius) arc (0:360:\radius);
\node[draw, rounded corners, fill=white, name path=realitynode] at ({360/\n * 2}:\radius) (reality) {Reality of interest};
import timeit
import random
import networkx as nx
# from https://networkx.org/documentation/stable/_modules/networkx/algorithms/components/connected.html#connected_components
def _plain_bfs(G, source):
"""A fast BFS node generator"""
G_adj = G.adj
seen = set()
nextlevel = {source}