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
import yaml | |
import os | |
from graphviz import Digraph | |
from uuid import uuid4 | |
class Block: | |
def __init__(self, graph_name, label): | |
self.graph_name = graph_name | |
self.name = str(uuid4()) |
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
with | |
installed_users as ( | |
select distinct | |
os | |
, gps_adid | |
, idfa | |
, idfv | |
from install_log | |
-- ログはUTC時間で収集されているので、JSTに合わせている | |
-- dt は hour 単位 |
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
import time | |
import json | |
import requests | |
import logging | |
import os | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
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
resource "google_project" "host-project" { | |
name = "host-project" | |
project_id = "host-project-id" // プロジェクトIDはグローバルで一つなので、実際に作るときはかぶらないように乱数をつけておくと良いかもしれません。 | |
auto_create_network = false // これを設定していないとリージョン毎にサブネットワークが生成される | |
} | |
resource "google_compute_network" "host-vpc" { | |
project = google_project.host-project.id | |
name = "default" | |
auto_create_subnetworks = false |
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
$ defaults write NSGlobalDomain InitialKeyRepeat -int 10 | |
$ defaults write NSGlobalDomain KeyRepeat -int 1 | |
やってから、ログアウト&ログイン |
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
print 'hello' | |
def func(x, y): | |
return x + y |
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
package main | |
import ( | |
"fmt" | |
"time" | |
"golang.org/x/net/context" | |
) | |
func leafFunc(ctx context.Context) string { |
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
import nltk | |
from nltk.corpus import wordnet as wn | |
from nltk.stem.porter import PorterStemmer | |
from nltk.stem import WordNetLemmatizer | |
wordnet_lemmatizer = WordNetLemmatizer() | |
porter_stemmer = PorterStemmer() | |
print porter_stemmer.stem('presumably') | |
print wordnet_lemmatizer.lemmatize('studies') |
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
require 'nn' | |
dataset = {} | |
function dataset:size() return 1000 end | |
for i = 1, dataset:size() do | |
local input = torch.randn(2) | |
print(input) | |
local output = torch.Tensor(1) | |
if input[1] * input[2] > 0 then | |
output[1] = 1 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder