$ humm
# hum
hm3
// comment
; comment
/* comment */
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
| import sys | |
| sys.path.append("/path/to/anvill/python") | |
| import anvill | |
| p = anvill.get_program(cache=False) | |
| p.add_function_definition(here()) | |
| open("/tmp/spec.json", "w").write(p.proto()) |
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
| from multiprocessing import Process | |
| def bigJob(): | |
| # | |
| result = 0 | |
| # | |
| for i in range(12345678): | |
| result += i | |
| print(result) | |
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
| """ | |
| docs: https://docs.python.org/2/library/struct.html#struct-format-strings. | |
| This example is just for using struct library instead of int.from_bytes. | |
| """ | |
| import struct | |
| bs1 = b'\xff\xff' | |
| bs2 = struct.unpack('<L', bs1)[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
| import torch | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| import torch.optim as optim | |
| import numpy as np | |
| # I think my nural network learn x1^3 + x2^2 + x1^1 + 1... | |
| # x 는 -1~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
| #!/usr/bin/python3 | |
| """Random Forest Examples. 2020-09-17. Author: Yu JaeIL | |
| This example follows https://towardsdatascience.com/random-forest-in-python-24d0893d51c0 | |
| These codes are written and test in python 3.7.7. | |
| References, | |
| decision tree: https://www.youtube.com/watch?v=n0p0120Gxqk&t=5s | |
| randorm forest: https://www.youtube.com/watch?v=nZB37IBCiSA | |
| One-Hot-Encode: https://en.wikipedia.org/wiki/One-hot |
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
| ======= | |
| Answer | |
| ======= | |
| [[p]] : {z, y, alloc_1} | |
| [[alloc_1]] : set() | |
| [[q]] : {y} | |
| [[z]] : set() | |
| [[x]] : set() | |
| [[y]] : set() | |
| ==== |
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
| async function makeId(number){ | |
| let bitMask1 = 0xffffffffffffffffffffffffffffffff00000000000000000000000000000000; | |
| let bitMask2 = 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff; | |
| let bitArray = new Uint32Array(2); | |
| bitArray[0] = bitMask1^number; | |
| bitArray[1] = bitMask2^number; | |
| let hashBuffer = await crypto.subtle.digest('sha-256',bitArray); | |
| let hashArray = Array.from(new Uint8Array(hashBuffer)); |
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 <unistd.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| #include <sys/mman.h> | |
| void foo(void); | |
| int change_page_permissions_of_address(void *addr); | |
| int main(void) |
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> | |
| int main(){ | |
| printf("Hello World."); | |
| return 0; | |
| } |