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
from heapq import heappush, heappop, heapify | |
class ErasableHeap(object): | |
# https://qiita.com/Salmonize/items/638da118cd621d2628d1 | |
def __init__(self, minheap=True): | |
self.data = [] | |
self.event = [] | |
if minheap: |
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(){var getText=function(node){var f=function(n,strs){if(n.nodeType==3){strs.push(n.data);}else if(n.nodeType==1){for(var m=n.firstChild;m!==null;m=m.nextSibling){f(m,strs);}}};var strings=[];f(node,strings);return strings.join('');};var reps=[];var anchors=document.getElementsByTagName('a');for(var i=0;i<anchors.length;i++){var a=anchors[i];var text=getText(a);if(text){reps.push({'a':a,'t':document.createTextNode(text)});}}for(var j=0;reps.length;j++){reps[j]['a'].parentNode.replaceChild(reps[j]['t'],reps[j]['a']);}})(); |
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
from glob import iglob | |
from sample_RNN import my_RNN | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import pickle | |
from sklearn.model_selection import train_test_split | |
def load_data(num_of_sample, length_of_sequences): | |
""" |
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 'hideshow) | |
(define-key hs-minor-mode-map (kbd "C-^") 'hs-toggle-hiding) | |
(add-hook 'python-mode-hook 'hs-minor-mode) | |
(defun display-code-line-counts (ov) | |
(when (eq 'code (overlay-get ov 'hs)) | |
(overlay-put ov 'display | |
(format " ... [%d]" | |
(count-lines (overlay-start ov) | |
(overlay-end ov)))) | |
(overlay-put ov 'face '(:foreground "yellow green")))) |
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
(defvar my/gtd-main-file "hogehoge") | |
;; agenda | |
(defvar my/agenda-files-outside '( | |
;; "hogehoge" | |
)) | |
(defun my/collect-org-agenda-files () | |
(append | |
(directory-files "hogehoge" |
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 sample.hoge; | |
import java.io.FileInputStream; | |
import com.google.firebase.FirebaseApp; | |
import com.google.firebase.FirebaseOptions; | |
public class FirebaseCommunicator { | |
FirebaseApp app; | |
public void initialize(String jsonFileName, String url, String identifier) throws Exception { |
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
# Created by newuser for 5.2 | |
export PS1='%n@ %~ $ ' | |
# 補完候補を一覧で表示する | |
setopt auto_list | |
# 補完キー連打で候補順に自動で補完する | |
setopt auto_menu | |
# コマンド履歴に実行時間も記録する | |
setopt extended_history | |
# 履歴中の重複行をすべて削除する |
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
# self.r.shape = (N , K) | |
# self.X.shape = (N, D) | |
# self.mu.shape = (K, D) | |
self.r = np.zeros((self.N, self.K)) | |
for i in range(self.N): | |
k = np.argmin([np.linalg.norm(self.X[i] - self.mu[k]) | |
for k in range(self.K)]) | |
self.r[i, k] = 1 | |
return self.r |
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 numpy as np | |
import itertools | |
from urllib.request import urlopen | |
from bs4 import BeautifulSoup | |
class Index(): | |
type = 0 | |
title = 1 | |
difficulty = 2 | |
level = 3 |
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 'cl) | |
;;;###autoload | |
(defun my/kill-other-buffers () | |
"Kill all other buffers." | |
(interactive) | |
(loop for buf in (buffer-list) | |
unless (or | |
(get-buffer-window buf) | |
(string= (substring (buffer-name buf) 0 1) " ") | |
(get-buffer-process buf) |
NewerOlder