This file contains 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
private float ScaleValue(float value, float[] from, float[] to) | |
{ | |
var scale = (to[1] - to[0]) / (from[1] - from[0]); | |
var capped = Math.Min(from[1], Math.Max(from[0], value)) - from[0]; | |
return capped * scale + to[0]; | |
} |
This file contains 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
class Singleton { | |
static final Singleton _singleton = Singleton._(); | |
factory Singleton() { | |
return _singleton; | |
} | |
Singleton._(); | |
} |
This file contains 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/env bash | |
echo "echo.sh" | |
./echo_2.sh |
This file contains 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/env python | |
# -*- coding: utf-8 -*- | |
import tensorflow as tf | |
import numpy as np | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
def load_data(): |
This file contains 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
javascript:(function(){window.location.href = window.location.href + '?sort=p';})(); |
This file contains 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/env python | |
# -*- coding: utf-8 -*- | |
def f(s: str, n: int): | |
if n > 0: | |
return s[:len(s) // 2] * n + s[len(s) // 2:] * n | |
# return s[:len(s) // 2] + f(s, n - 1) + s[len(s) // 2:] | |
else: | |
return '' |
This file contains 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
@charset "UTF-8"; | |
/*! | |
* Marp irodori theme. | |
* | |
* @theme irodori | |
* @author taznica | |
* | |
* @auto-scaling true | |
* @size 16:9 1280px 720px | |
*/ |
This file contains 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
/*! @theme orange */ | |
/* $color-white: #FFFFF0; */ | |
/* $color-black: #323232; */ | |
/* $color-green: #42B983; */ | |
@import 'default'; | |
section { | |
background-color: #FFFFF0; |
This file contains 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
console.dog = (bark, l = bark.toString().length / 1.66) => { | |
console.log(` | |
/ ̄${` ̄ ̄`.repeat(l)} ̄ | |
🐶 < `,bark,` | |
\\_${`__`.repeat(l)}_ | |
`) | |
} | |
console.dog('wan wan') | |
console.dog({ja: 'wan wan', en: 'bow wow'}) |
This file contains 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/env python | |
# -*- coding: utf-8 -*- | |
class Singleton: | |
_instance = None | |
def __new__(cls, *args, **kwargs): | |
if cls._instance is None: | |
cls._instance = super(Singleton, cls).__new__(cls) |
NewerOlder