Skip to content

Instantly share code, notes, and snippets.

View ysangkok's full-sized avatar

Janus Troelsen ysangkok

View GitHub Profile
*Main Data.Tree Data.Tree.Lens Control.Lens> let l = partsOf (traversed.(filtered ((==[]).subForest)))
*Main Data.Tree Data.Tree.Lens Control.Lens|
*Main Data.Tree Data.Tree.Lens Control.Lens> Node 1 [Node 2 [], Node 3 []] & l .~ [5,6]
<interactive>:7:1: error:
• Non type-variable argument in the constraint: Num (Tree a)
(Use FlexibleContexts to permit this)
• When checking the inferred type
it :: forall a. (Num (Tree a), Eq a) => Tree (Tree a)
Theorem add_le_cases : forall (n: nat) (m: nat) (p: nat) (q: nat),
n + m <= p + q -> n <= p \/ m <= q.
Proof.
intros.
generalize dependent p.
induction n.
- simpl.
intros.
apply or_introl.
apply le_0_n.
from typing import Protocol
class InterfaceAB(Protocol):
def method_a(self) -> None: ...
def method_b(self) -> None: ...
class ClassA:
def method_a(self) -> None:
print("a")
(ns hello-test (:require [secp256k1.core :as secp256k1] [clojure.test :as test]))
(def rs-pub
(secp256k1/public-key "028d7500dd4c12685d1f568b4c2b5048e8534b873319f3a8daa612b469132ec7f7") )
(def ls-priv
(secp256k1/private-key (hello/fromhex "1111111111111111111111111111111111111111111111111111111111111111")))
(= (seq (.getEncoded (secp256k1/public-key ls-priv) true))
(seq (hello/fromhex "01034f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa")))
import threading
import asyncio
import time
import json
import subprocess
import colorama
import os
from utils import BitcoinRpc
from electrumutils import ElectrumX, ElectrumNode
import re
import sys
import os.path
import ifcopenshell
import itertools
import json
def chunks2(iterable,size,filler=None):
it = itertools.chain(iterable,itertools.repeat(filler,size-1))
chunk = tuple(itertools.islice(it,size))
#!/usr/bin/env php
<?php
define("type","BBC");
#define("type","DMI");
//define("PLACE",35); //copenhagen
define("PLACE",52); //frankfurt
ob_start();
#!/bin/bash
TMPNAM=$(mktemp)
rm $TMPNAM
mkfifo $TMPNAM
curl http://data.iana.org/TLD/tlds-alpha-by-domain.txt | sed -e 1d | parallel -j 24 host '{}' 8.8.8.8 | grep "has address" > $TMPNAM &
echo -en "
import requests
with open('$TMPNAM') as f:
for tld, has, address, addr in map(lambda x: x.strip().split(' '), f.readlines()):
if addr.startswith('127'): continue

TYPISCHE ETHISCHE FRAGEN

  • log dateien

    logs müssen anonymisiert werden und darf nicht von jeder gelesen werden können.

    das leselabor ist nicht für jeden verfügbar. es ist auch leichter für die benutzer des leselabors die betreiber zu kontaktieren, um logs löschen zu lassen. deshalb ist das leselabor wesentlich privater als viele öffentliche web applikationen.

  • monitizing users (nutzer als produkte)

@ysangkok
ysangkok / gist:31008718adced6608669
Last active August 29, 2015 14:15
longjmp over different process invocations
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
static char encoding_table[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',