設定名は後述する設定ファイルで設定します。
$ /path/to/mail.py '設定名' '宛先アドレス' '題名' '本文'
// ========================== KeySnail Init File =========================== // | |
// この領域は, GUI により設定ファイルを生成した際にも引き継がれます | |
// 特殊キー, キーバインド定義, フック, ブラックリスト以外のコードは, この中に書くようにして下さい | |
// ========================================================================= // | |
//{{%PRESERVE% | |
plugins.options["ldrnail.keybind"] = { | |
'j': 'next', | |
'k': 'prev', | |
'p': 'pin', |
(defn access [array & idxs] | |
(loop [i (first idxs) | |
idxs (rest idxs) | |
ret array] | |
(if i | |
(recur (first idxs) (rest idxs) (get ret i)) | |
ret))) | |
(access [[0 1 2]] 0 1) |
# crontab format | |
# * * * * * command to be execute | |
# | | | | +---- day of week (0 - 6) (Sunday = 0 or 7) or sun, mon, ..., sat | |
# | | | +------ month (1 - 12) or jan, feb, ..., dec | |
# | | +-------- day of month (1 - 31) | |
# | +---------- hour (0 - 23) | |
# +------------ minute (0 - 59) | |
# special string | |
# string meaning | |
# ------ ------- |
#!/bin/sh | |
osascript -e "tell application \"Safari\" | |
tell window 1 | |
set current tab to (make new tab) | |
set currenttab to open location \"$@\" | |
end tell | |
end tell" |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# bookmark script for newsbeuter | |
# by Akihiro Uchida, CC0 dedicated to the public domain | |
# see http://creativecommons.org/publicdomain/zero/1.0/ | |
import sys | |
import os.path | |
import cPickle as pickle | |
BOOKMARK = os.path.expanduser('~/newsbeuter/bookmark.pkl') |
import functools, operator | |
prod = functools.partial(functools.reduce, operator.mul) | |
def ndindex(maxvals): | |
total = prod(maxvals) | |
index = [0] * len(maxvals) | |
for _ in range(total): | |
yield tuple(index) | |
for i, n in enumerate(reversed(maxvals)): | |
index[-i-1] += 1 | |
if index[-i-1] < n: |
# -*- coding:utf8 -*- | |
# Tokyo.Scipy#2 ディスカッション事前アンケート | |
# http://www.surveymonkey.com/s/XJ2KNBW | |
# | |
# 3. nanやInfを含む値の列 | |
# x = numpy.array([[1,0,nan,1,Inf,1,....]]) | |
# が与えられたとき、 | |
# NaNやInf以外のxの要素の合計を計算する方法が直ぐに思い浮かびますか? | |
from numpy import array |
# -*- coding:utf8 -*- | |
# Tokyo.Scipy#2 ディスカッション事前アンケート | |
# http://www.surveymonkey.com/s/XJ2KNBW | |
# | |
# 4. nanを含む4x2行列 | |
# m = numpy.array([[1,nan,-1,0],[0,0,nan,1]]) | |
# が与えられたとき、 | |
# nanを含む行を削除して2x2行列にする方法が直ぐに思い浮かびますか? | |
from numpy import array |
# -*- coding:utf8 -*- | |
# Tokyo.Scipy#2 ディスカッション事前アンケート | |
# http://www.surveymonkey.com/s/XJ2KNBW | |
# | |
# 5. numpy.array([[1,3,2]]) を、1-of-K表記法変換して | |
# numpy.array([[1,0,0],[0,0,1],[0,1,0]]) | |
# にする処理方法が直ぐに思い浮かびますか? | |
from numpy import array, zeros |