This file contains hidden or 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
def calculate_average(num): | |
sum = 0 | |
for num in nums: | |
sum += num | |
return sum / len(nums) | |
N = int(input()) | |
numbers = [] | |
for _ in range(N+1): | |
numbers.append(int(input())) |
This file contains hidden or 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 | |
read -p "page no => " page | |
getwindowid "Kindlei Classic" --list | |
#brew install smokris/getwindowid/getwindowid でインストールする. | |
read -p "window id => " wid | |
osascript -e 'tell application "Kindle" to activate' |
This file contains hidden or 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 | |
#前提: cpdfをhttps://github.com/coherentgraphics/cpdf-binariesから取得してインストールしておく | |
if [ $# -ne 1 ];then | |
echo "Usage: $0 <pdf filename>"; | |
exit 1 | |
fi | |
w=$(cpdf -page-info $1 | grep MediaBox | awk -F' ' '{print $4}' | uniq) |
This file contains hidden or 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 'fileutils' | |
#使い方 | |
#デスクトップ等でターミナルから「ruby pdf_downloder.rb」と入力してください。 | |
#最初に大会Webページからhtmlをダウンロードし、html内を解析してリンクされたpdfファイルをダウンロードします(サーバ負荷で迷惑にならないようにsleepかけています)。 | |
#最終的に、1〜8.htmlとpdfディレクトリがrubyを実行したディレクトリに生成されます。それぞれのhtmlファイルを開いてご利用ください。 | |
#参加登録したらメールで送られてくる論文アクセス情報がありますので、それぞれuseridとpasswordに設定してください | |
base = 'https://onsite.gakkai-web.net/ipsj/onsite/html/program' | |
userid = '*****' |
This file contains hidden or 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
//使い方: | |
// 1. Google Driveのトップにスクリプトを新規作成し以下のコピペする。 | |
// 2. 抽出したいClassroomの課題フォルダのFOLDER_IDを取得して以下にコピペする | |
// 3. あとは1で作成したスクリプトを実行する(コード上の実行ボタンを押すだけ)。 | |
// 4. Google DriveのトップにLatest Submissionsというフォルダができるのでその中に提出された最新ファイルだけがコピーされる。 | |
function extractLatestSubmissions() { | |
// Define the folder containing the submissions | |
var folder = DriveApp.getFolderById("FOLDER_ID"); | |
// Get all the files in the folder |
This file contains hidden or 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 | |
page=10 #Kindleのページ数をいれる | |
wid=7374 #brew install smokris/getwindowid/getwindowid でインストールして「getwindowid Kindle --list」を実行した書籍のウィンドウIDを取得していれる | |
osascript -e 'tell application "Kindle" to activate' | |
while (( page-- > 0)); do | |
/usr/sbin/screencapture -l$wid -x -r o/c_`ls o/*png | wc -w | sed 's/^[[:blank:]]*//'`.png | |
osascript -e 'tell application "System Events" to keystroke (ASCII character 29)' |
This file contains hidden or 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
class Entry: | |
def add(): | |
pass | |
def getName(): | |
pass | |
class File_(Entry): | |
def __init__(self, name): | |
self.__name = name | |
def add(self): |
This file contains hidden or 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
class Chara: | |
def __init__(self): | |
self.__cs = [] | |
def add(self, c): | |
self.__cs.append(c) | |
def draw(self) : | |
pass |
This file contains hidden or 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
class Chara: | |
def __init__(self): | |
self.__cs = [] | |
def add(self, c): | |
self.__cs.append(c) | |
def draw(self) : | |
pass |
This file contains hidden or 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 random | |
class Hand: | |
hand = ['GUU', 'CHO', 'PA'] | |
@classmethod | |
def getHand(cls, i): | |
return cls.hand[i] | |
class Strategy: | |
def nextHand(self): |
NewerOlder