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
#!/usr/bin/env ruby | |
HOSTS = [] # 対象ホスト名を配列で指定 | |
TIME_SIZE = 19 | |
SIZE = 15 | |
num = 0 | |
loop do | |
if num == 0 then | |
print "|" + (" " * TIME_SIZE) | |
print "|" |
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
pattern: "*.m4a" | |
input_dir: | |
- "/path/to/Yoichi Suzuki/DUO 3.0_Kiso [Disc 1]" | |
- "/path/to/Yoichi Suzuki/DUO 3.0_Kiso [Disc 2]" | |
- "/path/to/Yoichi Suzuki/DUO 3.0_Kiso [Disc 3]" | |
- "/path/to/Yoichi Suzuki/DUO 3.0_Kiso [Disc 4]" | |
- "/path/to/Yoichi Suzuki/Duo 3.0_Kiso [Disc 5]" | |
output_dir: "./out" |
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
$ ruby kwarg1.rb | |
"BAR" |
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
# | |
# Cookbook Name:: base_packages | |
# Recipe:: default | |
# | |
%w{gcc make git libreadline-dev libreadline5 language-pack-ja-base language-pack-ja nkf}.each do |pkg| | |
package pkg do | |
action :install | |
end.run_action(:install) | |
end |
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
MS4wMzd8fDEzODMzNzQyMzcwMDh8MDAxMTAwfDQwNzA1Njc1MzYxODA5LjkzOzEyODI1MzUzMjQ1MTI0Mi40MjsxNDA1ODs1NzU7MTE2OTY1MDUyMTU1ODIuNzEzOzQzMDQ7LTE7LTE7NTgyMjMyMzg4NDg1OTYxMTswOzc7MzI0Nzk7MDstMXwxNTAsMTUyLDcyNjQ1MTUzMzU1LDA7MTUwLDE1MCw1MDU5Njg2NTczNjEsMDsxMDAsMTAwLDEwNTA2MTI4MiwwOzEwMCwxMDAsNTU4NjYxNTU4LDE7MTAwLDEwMCwxOTkxODA4MDkzLDA7MTAwLDEwMCw1MTAxOTcxMzU4LDA7MTAwLDEwMCwxODE2NzI3MzYyMCwwOzgwLDgwLDIyMDY0MDc4NTgyNCwwOzU5LDU5LDE5ODYzMjQ5MzA1MDIsMDs1MCw1MCw1NTg0NTg3OTY4NTUxLDA7fDQ1MDM1OTk2MjczNzA0OTU7NDUwMzE4NzMxMDUxMDA3OTs0NTAzNTk5NjI3MzcwNDk1OzM5NDA2NTI1MDE0NjU1OTk7Njk5MzI3fDQ1MDM1OTg1NTM2Mjg2NzE7MzI1Nzc0OTMzNDkxNzExOQ%3D%3D%21END%21 |
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
SET | |
@DATETIME = NOW(); | |
SELECT | |
DATE(@DATETIME) AS `date`, | |
DATE_FORMAT(@DATETIME, '%X-W%V') AS `week`, | |
DATE_ADD(DATE_ADD(DATE(CONCAT(YEAR(@DATETIME), '-01-01')), INTERVAL (6 - WEEKDAY(DATE(CONCAT(YEAR(@DATETIME), '-01-01')))) DAY), INTERVAL ((WEEK(@DATETIME) - 1) * 7) DAY) AS `first_day_of_the_week`, | |
DATE_ADD(DATE_ADD(DATE(CONCAT(YEAR(@DATETIME), '-01-01')), INTERVAL (6 - WEEKDAY(DATE(CONCAT(YEAR(@DATETIME), '-01-01')))) DAY), INTERVAL (((WEEK(@DATETIME) - 1) * 7) + 6) DAY) AS `last_day_of_the_week` |
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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
type ErrNegativeSqrt float64 | |
func (e ErrNegativeSqrt) Error() string { |
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
package main | |
import ( | |
"code.google.com/p/go-tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
m := make(map[string]int) | |
words := strings.Fields(s) |
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
package main | |
import ( | |
"fmt" | |
) | |
func Sqrt(x float64) float64 { | |
x64 := float64(x) | |
xn := float64(0) |