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
| #!/bin/bash | |
| # dev-null.sh | |
| # This shell script implement /dev/null as a Service(//aaS). | |
| IFS=$'\n\n' | |
| while true; do | |
| rm -rf /tmp/input /tmp/output | |
| mkfifo /tmp/input /tmp/output |
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
| --- weak-ordering.asm 2018-03-15 14:59:41.504213243 +0300 | |
| +++ stong-ordering.asm 2018-03-15 14:59:32.910123855 +0300 | |
| @@ -9,7 +9,7 @@ | |
| sub $0x38,%rsp | |
| mov 0x78(%rdi),%eax | |
| test %eax,%eax | |
| + jne 0x40a20a <StressPushPop(benchmark::State&)+490> | |
| - jne 0x40a218 <StressPushPop(benchmark::State&)+504> | |
| mov $0x409700,%r13d | |
| mov $0x62ff68,%r15d |
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 typing import List, Tuple | |
| from random import randint | |
| def gen_array(random=True, size=8 * 1024 * 1024): | |
| if random: | |
| return [randint(-1000, 1000) for i in range(size)] | |
| else: | |
| return list(sorted(gen_array(True, size))) |
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
| /** | |
| * \file endianness.h | |
| * \brief This header defines common routine for convertion from network | |
| * ordered integers(which is usually big endian) to byte order that is native | |
| * to host. | |
| * | |
| * There is if-constexpr so C++17 compiler is strongly needed for this. | |
| */ | |
| #pragma once |
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
| # FindFontConfig.cmake | |
| # Daniel Bershatsky, 2018 | |
| #.rst: | |
| # FindFontConfig | |
| # -------------- | |
| # | |
| # Find FontConfig library for configuring and customizing font access. | |
| # | |
| # Imported Targets |
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
| // socket-binding.c | |
| // | |
| // This is small tool that helps to clarify how to listen IPv6 socket and it | |
| // is nessesary or not listen IPv4 socket at the same time. | |
| // | |
| // Compile `gcc -std=c11 -o listen main.c` | |
| // | |
| // Run binary with option `-4` or `-6` and connect to port(default is 5489) | |
| // with netcat in the following way. | |
| // 1. `nc -4 127.0.0.1 5489` |
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
| /** | |
| * \file tty-size.c | |
| * \brief Get size of console attached to stderr. | |
| */ | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <errno.h> | |
| #include <sys/ioctl.h> | |
| #include <unistd.h> |
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 as T | |
| class Maxout(T.nn.Module): | |
| """Class Maxout implements maxout unit introduced in paper by Goodfellow et al, 2013. | |
| :param in_feature: Size of each input sample. | |
| :param out_feature: Size of each output sample. | |
| :param n_channels: The number of linear pieces used to make each maxout unit. | |
| :param bias: If set to False, the layer will not learn an additive bias. | |
| """ |
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
| # encoding: utf8 | |
| # filename: maxout.py | |
| import torch as T | |
| import torch.nn.init as I | |
| class TTMaxout(T.nn.Module): | |
| def __init__(self, in_features, out_features, n_channels, tt_rank, | |
| bias=True, irange=0.005): |
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
| # encoding: utf8 | |
| # filename: optimizer.py | |
| import torch as T | |
| def clip_momentum(value: float) -> float: | |
| if value > 1.0: | |
| return 1.0 | |
| elif value < 0.0: |