Skip to content

Instantly share code, notes, and snippets.

package main
import (
"math/rand"
"time"
"github.com/nsf/termbox-go"
)
const coldef = termbox.ColorDefault
package main
import (
"math/rand"
"time"
"github.com/nsf/termbox-go"
)
const (
@tomowarkar
tomowarkar / timestamp.go
Last active December 11, 2019 08:42
Goでのタイムスタンプ
package main
import (
"fmt"
"time"
)
func main() {
t := time.Now()
timestamp := fmt.Sprintf("%04d%02d%02d%02d%02d%02d",
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"math/rand"
"os"
"time"
@tomowarkar
tomowarkar / character2png.go
Last active December 11, 2019 12:08
文字列を画像化
package main
import (
"bytes"
"fmt"
"image"
"image/png"
"os"
"github.com/golang/freetype/truetype"
@tomowarkar
tomowarkar / ga.go
Created December 16, 2019 07:18
遺伝的アルゴリズム
package main
import (
"fmt"
"math/rand"
"sort"
)
const (
// 淘汰率, 交差率, 突然変異率
@tomowarkar
tomowarkar / video.html
Created December 16, 2019 09:10
ブラウザでのビデオ表示
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0" />
<title></title>
<style>
body {
margin: 0;
@tomowarkar
tomowarkar / mecab_cabocha.ipynb
Last active October 24, 2022 03:18
How to use MeCab and CaboCha in Google Colaboratory! you can also see here: https://tomowarkar.github.io/blog/posts/colab_mecab/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tomowarkar
tomowarkar / index.html
Last active August 5, 2020 08:01
中国語リスニング練習用
<input type="file" name="file" id="file" />
<div id="display">
<div class="example" style="display: flex;">
<p>你好</p>
<button class="speak-btn" style="margin: 10;">再生</button>
</div>
</div>
<script>
function loadVoices() {