Skip to content

Instantly share code, notes, and snippets.

View odanado's full-sized avatar

odanado odanado

View GitHub Profile
<template>
<div ref="stage"></div>
</template>
<script>
import * as THREE from 'three';
import Stats from 'stats.js';
import DataPoint from '@/lib/DataPoint';
import Axis from '@/lib/Axis';
<template>
<div>
<div>
<button
v-for="(_, i) in 17"
:key="i"
@click="needles.push(i)">
{{ i }}
</button>
</div>
syntax = "proto3";
package image_dataset;
message Image {
uint32 width = 1;
uint32 height = 2;
bytes data = 3;
string mode = 4;
}
This file has been truncated, but you can view the full file.
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <tuple>
#include <set>
#include <stack>
#include <queue>
def make_mask(lens, mask_shape):
mask = np.ones(mask_shape).astype('uint8')
for i, l in enumerate(lens):
mask[i, :l] = 0
return mask
batch_size = 2
seq_len = 4
lens = np.array([2, 3])
@odanado
odanado / colorize_text.py
Created November 21, 2017 13:20 — forked from ihsgnef/colorize_text.py
Visualize attention over text with background colors
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
def colorize(words, color_array):
# words is a list of words
# color_array is an array of numbers between 0 and 1 of length equal to words
cmap = matplotlib.cm.get_cmap('RdBu')
template = '<span class="barcode"; style="color: black; background-color: {}">{}</span>'
colored_string = ''
export XDG_CONFIG_HOME=$HOME/.config
source $HOME/.zplug/init.zsh
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
zplug "peco/peco", as:command, from:gh-r
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@odanado
odanado / work78.c
Created October 30, 2017 09:41 — forked from siberiy4/work78.c
#include<stdio.h>
int main(void){
int a,b,c=1, i, j, e, f, p, d;
printf("桁区切りする値の入力:");
scanf("%d",&a);
b=a;