Skip to content

Instantly share code, notes, and snippets.

Avatar

Wouter van Atteveldt vanatteveldt

View GitHub Profile
View KSP.log
[LOG 14:24:51.205] ******* Log Initiated for Kerbal Space Program - 1.10.1.2939 (LinuxPlayer) en-us *******
Kerbal Space Program - 1.10.1.2939 (LinuxPlayer) en-us
OS: Linux 5.8 Ubuntu 20.04 64bit
CPU: AMD Ryzen 5 1500X Quad-Core Processor (8)
RAM: 32106
GPU: GeForce RTX 2070 SUPER/PCIe/SSE2 (8192MB)
SM: 50 (OpenGL 4.5.0 NVIDIA 450.102.04)
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, ARGB4444, ARGB1555, Default, ARGB2101010, DefaultHDR, ARGB64, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8, ARGBInt, RGInt, RInt, BGRA32, RGB111110Float, RG32, RGBAUShort, RG16, BGRA10101010_XR, BGR101010_XR, R16
View update_query.py
import argparse
import django
from django.db.models import QuerySet
django.setup()
from amcat.models import Query, CodingJob, Project
import logging
logging.basicConfig(level=logging.INFO, format='[%(asctime)s %(name)-12s %(levelname)-7s] %(message)s')
View wordplot.R
library(quanteda)
corp = corpus_reshape(data_corpus_inaugural, to = "paragraphs")
dfm = dfm(corp, remove_punct=T, remove=stopwords("english"))
dfm = dfm_trim(dfm, min_docfreq = 5)
library(topicmodels)
dtm = convert(dfm, to = "topicmodels")
set.seed(1)
m = LDA(dtm, method = "Gibbs", k = 10, control = list(alpha = 0.1))
View codex.sty
% encoding: UTF-8
\RequirePackage{xkeyval}
\RequirePackage{tcolorbox}
\tcbuselibrary{skins,breakable,xparse,raster}
\RequirePackage{listings}
\RequirePackage{newfloat}
\RequirePackage{xstring}
\RequirePackage[utf8]{inputenc}
\DeclareFloatingEnvironment[fileext=ex,placement={!ht},name=Example]{ccsexample}
View monop.r
library(tidyverse)
hits_url = "https://fabdev.fr/articles/monopoly/"
hits = readLines(hits_url)[449:(449+35)] %>%
str_replace_all("(?<=[{ ])'|'(?=[,:])", '"') %>% str_remove(",$") %>%
purrr::map_df(jsonlite::fromJSON)
dutch_url = "https://www.allesopeenrij.nl/cultuur-2/klassiekers/de-adressen-van-monopoly/"
dutch_names = readLines(dutch_url)[443:464] %>% str_remove_all("</?li>")
View bertest.py
# https://towardsdatascience.com/identifying-hate-speech-with-bert-and-cnn-b7aa2cddd60d
# should also try this one? https://github.com/bentrevett/pytorch-sentiment-analysis/blob/master/6%20-%20Transformers%20for%20Sentiment%20Analysis.ipynb
from transformers import BertTokenizer, BertModel
import logging
import time
#import matplotlib.pyplot as plt
import numpy as np
View i3.config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
View energy_nl_cbs.r
# get data from https://opendata.cbs.nl/statline/#/CBS/nl/dataset/80030NED/table?fromstatweb
library(cbsodataR)
library(tidyverse)
d = cbs_get_data("80030NED") %>% cbs_add_date_column() %>% cbs_add_label_columns() %>%
filter(CentraleDecentraleProductie_label=="Totaal centrale/decentrale productie") %>%
select(date=Perioden_Date, source=Energiedragers_label, elec=ElektriciteitMWh_2)
# filter and translate energy sources
sources = c(coal="Steenkool", oil="Stookolie", gas="Aardgas", biomass="Biomassa", nuclear="Kernenergie", solar="Zonnestroom", wind="Windenergie", water="Waterkracht")
View counts.py
import re
import csv
import sys
from elasticsearch import Elasticsearch
from elasticsearch.helpers import scan
from collections import Counter
es = Elasticsearch("localhost:9201")
index = "amcat_vu"
View sulfuric acid
0eNq1W9ty4ygQ/ZUtPZsUIMQlb/sN+7g1lZJl7KFWljySlUxqKv++2JZsT9xAMzv7kvii093QV7rxj2LdTvYwuO5YPP8oXNN3Y/H8949idLuubk+fHd8Ptngutu3kNsWq6Or96W3rvvn3ZJza7TS4htSN//ZjVbhuY78Xz+zjy6qw3dEdnb0QPL95f+mm/doO/oErpaatB7d1/sNVcehHj+i7E19PhbByVbyf/rOPj9UDDX6lUXc7246kdgPZuvZoB8IBavpKbFVs3GCby5dyVfjX7gASct2uAFiXn1k3X+3eNXVLDm3t9/KRuZiZ8whzz3W0h3qoz98BbMWV7cFDyLEnu6Gfug3Aj8/8yk/8AKoVmiqDiQqAqPyJ6CMpeSUFgBVaogqWiANE9ZXo1/fN0Ic0xZZF0k8k7zT1btu2fyNv9Xi0/u/J4A7TyYqboOrMZ4vZeru3ZDzWzT+Q5T8tK/Ov0mtjNNcgOewM4m6VAR9/ZM7Q6pJXL4Do8ITNqCi6RKLBWMJEAs2qKPMKC4e5S1Q4nKOhTrs0w3sQvRA1CCPTaKIcJApKalI7t5CCMkC22QtwC++tflePs8mTjeu/u42FbJ5n2zxigznSAeC9wNo/BdFY+4d5o80fZp5KFoRd9QbBFS6yEzabpQhrHxfMuU4KXMYENkk4jcBLmoLPlY4C0QyJhnnfTPS1bl8t8SZvh63PhgAhg45X5c14x2ntk+L50UeKckmLymdFiI7IjXsY4SpciIK3W+LA8G6r3Cij0pVZeTNe1412OEK5RoHkvPK9fx1eHorNJ2YMZ1pdtHOqnA6u+Wd6eJLP30NiGfRaFag6KKIKigxMoO4EQ6JB5QmOdDQJokt8ra8WOklTFjf/qNtdbcm2HvakDJ9XeLgIvhDYDdZ2ZHT7QwsmSlHleqREqBXpVPDOZjsVGGqExp1wYBlSGaCKgCuKcOBqEf1zqgMdeN76mx8HPfjyJFgEVwwVxNUSwys4hlc866hkFnIiQK7MIsdYih4+xbCoFm+