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
#!/bin/bash | |
set -euo pipefail | |
WAIT_SECONDS=1 | |
USER_AGENT='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0' | |
logger_info() { | |
echo "$(LANG=C date --rfc-3339=seconds) [INFO] ${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
#!/usr/bin/env python | |
import os | |
import subprocess | |
HOMEDIR = os.getenv('HOME') | |
GIT_COMMAND = 'git pull --rebase origin master' | |
git_clone_dirs = ['.rbenv', '.rbenv/plugins/ruby-build', '.pyenv'] | |
brew_commands = ['perlbrew self-upgrade', 'perlbrew -f install-cpanm', 'nodebrew selfupdate'] |
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 'set' | |
class RPN | |
def initialize(exp) | |
@exp = exp.split(/\s+/) | |
@stack = [] | |
@operators = Set['+', '-', '*', '/', '%'].freeze | |
end | |
def eval |
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
# Priority Queueの練習 | |
# | |
# 参考 | |
# - https://ufcpp.net/study/algorithm/col_heap.html | |
class PriorityQueue | |
attr_reader :data, :test_function | |
def initialize(test_function = ->(a, b) { a <=> b }) | |
@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
# ヒープソートの練習 | |
# | |
# 参考 | |
# - https://ufcpp.net/study/algorithm/col_heap.html | |
# - https://ufcpp.net/study/algorithm/sort_heap.html | |
def make_heap(array, last_index) | |
while (last_index > 0) | |
parent = ((last_index - 1) / 2).floor | |
break unless (array[last_index] > array[parent]) |
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
# https://www.tensorflow.org/get_started/eager | |
# Configure imports and eager execution | |
from __future__ import absolute_import, division, print_function | |
import os | |
import matplotlib.pyplot as plt | |
import tensorflow as tf | |
import tensorflow.contrib.eager as tfe |
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 'uri' | |
require 'net/http' | |
username = "<YOUR API KEY>" | |
password = "<PASSWORD>" | |
file = 'TEST.wav' | |
response = nil | |
url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?model=ja-JP_BroadbandModel' |
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
// -*- mode: c; coding: utf-8 -*- | |
/* | |
* リンクリストの練習 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* | |
* リストの要素型 |
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
################################################################################ | |
# E-mail tool in PowerShell | |
# | |
# 0. Set execution policy to "RemoteSighed" in PowerShell | |
# Set-ExecutionPolicy RemoteSigned | |
# | |
# 1. Right click this file and select "Run with PowerShell" from context menus. | |
# Or run the following command in cmd.exe. | |
# powershell -Sta -File send-message.ps1 | |
# |
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
# | |
# INSERT query generator for Oracle | |
# | |
# Requirements: | |
# - Ruby 2.0 or later (https://www.ruby-lang.org/) | |
# - ruby-oci8 (gem install ruby-oci8) | |
# - Oracle Database | |
# | |
require 'oci8' |
NewerOlder