Skip to content

Instantly share code, notes, and snippets.

View keithoma's full-sized avatar

Kei Thoma keithoma

  • Berlin
View GitHub Profile
@keithoma
keithoma / huffman.cpp
Created May 26, 2019 05:48
the binary tree fucks me
#include <string>
#include <vector>
#include <map>
#include <iostream>
#include <algorithm>
#include <utility>
#include <optional>
using namespace std;
@keithoma
keithoma / transpose.cpp
Created April 16, 2021 17:07
Reference? Pointer? Iterator?
#include <vector>
using namespace std;
vector<vector<int>> MATRIX (10, vector<int>(10, 0));
// wie kann ich die Funktion so machen, dass sie nicht eine neue 2d vector Objekt returned, sondern eine Art
// Referenzen oder Pointer auf die Originale?
vector<vector<int>> transpose(vector<vector<int>> matrix) {
vector<vector<int>> T (10, vector<int>(10, 0));
entity mux1 is
port(
A : in bit;
B : in bit;
SEL : in bit;
Y : out bit);
end mux1;
architecture beh of mux1 is
signal sel_n, and1_out, and2_out: bit;
begin
# not enough time, but should work something like this
def postfix(input_string):
def get_next_term(input_string):
a
for i in range(len(input_string), 0, -1):
if input_string[i] != '+':
a.append(input_string[i])
def three_dices_max_five():
outcome = [[x, y, z] for x in range(1, 7) for y in range(1, 7) for z in range(1, 7)]
event = [dices for dices in outcome if max(dices) == 5]
print(event)
print(len(event))
if __name__ == "__main__":
three_dices_max_five()
library ieee;
use ieee.std_logic_1164.all;
use IEEE.numeric_std.all;
use work.cpu_constants_pkg.all;
entity ALU is
port (
A_VALUE : in DATA_TYPE;
B_VALUE : in DATA_TYPE;
Get-ChildItem -Directory -Recurse |
Sort-Object { $_.FullName.Length } -Descending |
ForEach-Object {
$newName = $_.Name -replace ' ', '_'
if ($newName -ne $_.Name) {
Rename-Item -LiteralPath $_.FullName -NewName $newName -WhatIf
}
}