全自動クラウド会計ソフトfreeeの開発者向けAPIのドキュメントです。
本APIを利用することで、あなたのアプリやサービスをfreeeと連携させることができます。
################################################################################### | |
# check process aliving (count process number) | |
# return integer 1 (process is running) or 0 (process is dead) or 9 (some error) | |
################################################################################### | |
function is_process_alive() { | |
count=`ps awux | grep -v grep | grep -v "$0" | grep -w "$1" | wc -l` | |
if [[ $count =~ ^[0-9]+$ ]]; then | |
if [ $count != 0 ]; then | |
echo 1 | |
else |
The query was made on https://bigquery.cloud.google.com/table/fh-bigquery:hackernews.comments for fun and profits :D
The source is at the bottom of this page.
You can read the comments on Hacker News.
You can follow me on Twitter twitter.com/bydorian (I try to keep the quality of my tweets high).
I'm currently looking for an internship involving the most beautiful language in the world (Ruby obviously) in San Francisco.
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
.highlight { | |
background-color:#073642; | |
color:#93a1a1; | |
} | |
.highlight .c { | |
color:#586e75 !important; | |
font-style:italic !important; | |
} |
-- 3.1.1 出版年別分布 -- | |
td query -w -d book_crossing_dataset " | |
SELECT year, cnt | |
FROM | |
( | |
SELECT 1975 AS year, COUNT(year_of_publication) AS cnt | |
FROM books | |
WHERE year_of_publication < 1970 | |
UNION ALL |
-- 1.1.1 登録ユーザー数, アクティブユーザー数 -- | |
td query -w -d book_crossing_dataset " | |
SELECT t1.cnt AS all_users, t2.cnt AS active_users, ROUND(t2.cnt/t1.cnt*100) AS active_rate | |
FROM | |
( | |
SELECT COUNT(distinct user_id) as cnt, 1 AS one | |
FROM users | |
) t1 | |
JOIN | |
( |
-- 4.1.1 ユーザーの評価回数平均 -- | |
td query -w -d book_crossing_dataset " | |
SELECT ROUND(AVG(cnt)) AS avg | |
FROM | |
( | |
SELECT user_id, COUNT(book_rating) AS cnt | |
FROM ratings | |
GROUP BY user_id | |
) t1 | |
" |
-- 2.1.1 ユーザーの居住国分布 -- | |
td query -w -d book_crossing_dataset -f csv -o user_dist_of_country.csv " | |
SELECT country, cnt, ROUND(cnt/total_cnt*10000)/100 AS rate | |
FROM | |
( | |
SELECT country, COUNT(*) as cnt, 1 AS one | |
FROM users | |
WHERE country != '' AND country != 'n/a' | |
GROUP BY country | |
ORDER BY cnt DESC |
-- 6.1 共起分析:Simpson係数の高いブックペア上位20 -- | |
td query -w -d book_crossing_dataset " | |
SELECT r2.title AS title1, | |
r2.year_of_publication AS year1, | |
r2.cnt AS cnt1, | |
r3.title AS title2, | |
r3.year_of_publication AS year2, | |
r3.cnt AS cnt2, | |
r1.cnt AS intersection, | |
r1.cnt/IF(r2.cnt<r3.cnt,r2.cnt,r3.cnt)*100 AS simpson |