This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func pointOfNoReturn(n int) (r int) { | |
defer func() { | |
e := recover() | |
r = e + 1 | |
}() | |
panic(n - 1) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(declare expr->html write-props write-tags) | |
(defn write-props | |
[props] | |
(reduce | |
(fn [out [k v]] | |
(str out " " (name k) "=" \" (name v) \")) | |
"" | |
props)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <assert.h> | |
#define NPARTS 4 | |
#define IS_ODD(x) ((x) % 2) | |
#define IS_EVEN(x) (((x) + 1) % 2) | |
int main(void) { | |
int part_widths[NPARTS] = {0}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Serie 7, Aufgabe 4 | |
(defn gcd [a b] | |
(cond | |
(zero? a) b | |
(zero? b) a | |
(> b a) (recur b a) | |
:else (recur b (mod a b)))) | |
(defn coprime? [a b] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
#include <WinUser.h> | |
#include <random> | |
int main() { | |
int x {GetSystemMetrics(SM_XVIRTUALSCREEN)}; | |
int y {GetSystemMetrics(SM_YVIRTUALSCREEN)}; | |
int w {GetSystemMetrics(SM_CXVIRTUALSCREEN)}; | |
int h {GetSystemMetrics(SM_CYVIRTUALSCREEN)}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* USB HID Keyboard scan codes as per USB spec 1.11 | |
* plus some additional codes | |
* | |
* Created by MightyPork, 2016 | |
* Public domain | |
* | |
* Adapted from: | |
* https://source.android.com/devices/input/keyboard-devices.html | |
*/ |