Skip to content

Instantly share code, notes, and snippets.

View fkohlgrueber's full-sized avatar

Felix Kohlgrüber fkohlgrueber

View GitHub Profile
@fkohlgrueber
fkohlgrueber / mpl_dev_win.md
Last active May 22, 2017 10:46
Matplotlib installation using conda
@fkohlgrueber
fkohlgrueber / kogsys_ue2.ipynb
Last active June 10, 2017 19:15
KogSys Aufgabenblatt 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fkohlgrueber
fkohlgrueber / kogsys_ue3.ipynb
Last active June 20, 2017 13:58
KogSys Exercise 3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fkohlgrueber
fkohlgrueber / cython-benchmark.ipynb
Last active October 28, 2017 14:09
cython benchmark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import subprocess
def to_hex(byte_string):
return " ".join("{:02x}".format(b) for b in byte_string)
def to_bin(byte_string):
return " ".join("{:08b}".format(b) for b in byte_string)
@fkohlgrueber
fkohlgrueber / Quadrate.java
Created December 7, 2017 18:08
Quadratzahlen
public class Quadratzahlen
{
public static void main(String[] args)
{
// Aufgabe: gib die ersten zehn Quadratzahlen auf der Konsole aus.
//
// Korrekte Ausgabe:
// 1 4 96 16 25 36 49 64 81 100

Initial configuration:

  • queue with capacity for 3 elements
  • two producers p1, p2 and one consumer c1
  • queue contains one element "x" at the first position
  • Thread p1 wants to insert an element "Y"

Pointers and queue content at initial configuration:

  • Feature Name: syntax_tree_patterns
  • Start Date: (fill me in with today's date, YYYY-MM-DD)
  • RFC PR: (leave this empty)
  • Rust Issue: (leave this empty)

Summary

Introduce a DSL that allows to describe lints using syntax tree patterns.

// tested using nix 0.15.0
extern crate nix;
use std::path::Path;
use nix::pty::{posix_openpt, grantpt, unlockpt, ptsname};
use nix::fcntl::{OFlag, open};
use nix::sys::{stat, wait};
use nix::unistd::{fork, ForkResult, setsid, dup2};
use nix::libc::{STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO};