Skip to content

Instantly share code, notes, and snippets.

View forflo's full-sized avatar

Florian Mayer forflo

  • Erlangen, Germany
View GitHub Profile
@forflo
forflo / seven_segment_controller.vhd
Created December 11, 2015 16:33
This is a addon entity for the picoblaze. It adds an seven segment multiplexer with integrated registers for the segments bit patterns
----------------------------------------------------------------------------------
-- Company:
-- Author: Florian Mayer
--
-- Create Date: 16:18:13 12/09/2015
-- Design Name:
-- Module Name: seven_segment - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
\documentclass[12pt]{article}
\usepackage{color}
\usepackage{listings}
\definecolor{fgcolor}{RGB}{0,0,0}
\definecolor{bgcolor}{RGB}{255,255,255}
\lstset{
numbers=left,
numberstyle=\tiny\ttfamily{},
stepnumber=1,
@forflo
forflo / relinux.sh
Last active January 30, 2016 21:18
curlable bash script to reenable grub if windows destroyed it
execChroot(){
echo "$@" | chroot /mnt/ /bin/bash || {
return 1
}
return 0
}
DEVICE=sdb1
DEV=sdb
@forflo
forflo / quinebomb.sh
Created March 6, 2016 02:01
A forkbomb using a quine in bash
#quinebomb
(
quote=39
code=(
'quote=39'
''
'code=('
')'
''
@forflo
forflo / AfpList.java
Last active March 19, 2016 22:56
Java 8 functional list implementation
package afp;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Random;
public class AfpList {
public final static int DEBUG = 0;
digraph g{
graph [ranksep="3.0 equally"];
edge [arrowhead=vee, color=black];
node [shape=record, color=indigo];
node__0 [label="{{Entity}|{name|fir_filter}}"];
node_0_1 [label="{{InterfacePort}|{port mode|PORT_IN}|{port name|rst}}"];
node_00_2 [label="{{VTypePrimitive}|{packed?|1}|{type|STDLOGIC}}"];
node_1_2 [label="{{InterfacePort}|{port mode|PORT_IN}|{port name|clk}}"];
node_10_3 [label="{{VTypePrimitive}|{packed?|1}|{type|STDLOGIC}}"];
node_2_3 [label="{{InterfacePort}|{port mode|PORT_IN}|{port name|coef_ld}}"];
#include <iostream>
#include <limits>
using namespace std;
template<bool cond, typename T, typename E> class If {
public:
typedef T result;
};
#include <iostream>
/* Loops */
using namespace std;
template<int i>
struct Statement {
enum { n = i };
static void execute(){
#include <iostream>
using namespace std;
const int endValue = ~(~0u >> 1); // value for nil (smalles int)
struct tmp_list_end {
enum { head = endValue };
typedef tmp_list_end tail;
};