Skip to content

Instantly share code, notes, and snippets.

View hellow554's full-sized avatar
💭
/(°□°)/ ︵ ┻━┻

Marcel Hellwig hellow554

💭
/(°□°)/ ︵ ┻━┻
  • Hamburg, Germany
View GitHub Profile
from myhdl import *
R0 = 0
R1 = 1
R2 = 2
R3 = 3
R4 = 4
R5 = 5
R6 = 6
R7 = 7
from myhdl import *
from functools import wraps
from argparse import *
from unittest import main
import sys
_trace = False
def testmain():
#! /bin/bash
SC=https://raw.githubusercontent.com/astraw/svg_stack/master/svg_stack.py
SC_TMP=$(mktemp)
SVG=$(mktemp)
TMP_SVG=$(mktemp)
TMP_TMP_SVG=$(mktemp)
cat << EOF > $SVG
<?xml version="1.0" encoding="utf-8"?>
@hellow554
hellow554 / Kernel Oops
Last active August 2, 2018 13:47
Kernel Panic
[ 1125.090000] Unable to handle kernel paging request at virtual address c14fe63a
[ 1125.100000] pgd = c14d8000
[ 1125.100000] [c14fe63a] *pgd=8140041e(bad)
[ 1125.100000] Internal error: Oops: 1 [#1] PREEMPT ARM
[ 1125.100000] Modules linked in:
[ 1125.100000] CPU: 0 Not tainted (3.4.113 #1)
[ 1125.100000] PC is at udp_recvmsg+0x284/0x33c
[ 1125.100000] LR is at 0x0
[ 1125.100000] pc : [<c0228adc>] lr : [<00000000>] psr: a0000013
use std::collections::VecDeque;
fn solve_a(players: u32, last_marble: u32) -> u32 {
let mut score = vec![0; players as usize];
let mut playfield = VecDeque::new();
let mut cur_pos = 1usize;
playfield.push_back(0);
playfield.push_back(1);
use petgraph::prelude::*;
use regex_syntax::hir::{self, Hir, HirKind};
use regex_syntax::ParserBuilder;
use std::collections::{HashMap, HashSet};
use std::ops::Add;
type MyGraph = DiGraph<Pos, f32>;
type GraphMap = HashMap<Pos, NodeIndex>;
#[derive(Debug, Default, Clone, Copy, Hash, PartialEq, Eq)]
@hellow554
hellow554 / day01.rs
Last active December 2, 2019 11:54
2019
const INPUT: &str = include_str!("../input");
fn parse(s: &str) -> Vec<u32> {
s.lines().map(|x| x.parse().unwrap()).collect()
}
fn required_fuel(st: u32) -> Option<u32> {
(st / 3).checked_sub(2)
}
fn solve_a(v: &[u32]) -> u32 {
const INPUT: &str = include_str!("../input");
fn parse(s: &str) -> Vec<u32> {
s.split(',').map(|x| x.parse().unwrap()).collect()
}
fn solve_a(memory: &mut [u32]) {
const OPS: &[fn(u32, u32) -> u32] = &[
|_, _| panic!("unsupported opcode"),
|a, b| a + b,
use std::collections::{HashMap, HashSet};
const INPUT: &str = include_str!("../input");
#[derive(Clone)]
enum Movement {
Up,
Down,
Left,
Right,
use std::mem;
use std::ops::Range;
const INPUT: &str = "307237-769058";
struct ExtractConsecutive<'a> {
string: &'a str,
}
impl<'a> Iterator for ExtractConsecutive<'a> {