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
#長さ制限つきのQueue | |
class Q | |
attr_accessor :q | |
def initialize(size) | |
@q = [] | |
@size = size | |
end |
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
class String | |
def count_the_number_of_words_in_a_string(word) | |
return self.split(/#{word}/).size - 1 | |
end | |
end |
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
class String | |
def count_the_number_of_words_in_a_string(word, pos = 0, num = 0) | |
pos = self.index(word, pos) | |
return num if pos == nil | |
count_the_number_of_words_in_a_string(word, pos + 1, num + 1) | |
end | |
end |
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 | |
while read -s -n 1 char | |
do | |
echo $char | |
done < $1 | sort | uniq | wc -l | awk '{print $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
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: findNoTextPdf.sh path" | |
exit 1 | |
fi | |
find $1 -type f -name "*.pdf" | while read myfile | |
do | |
pdftotext -l 1 "$myfile" tmp | |
status=`hexdump -ve '1/1 "%.2x"' tmp | head -c 2` |
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
/* | |
This program is free software; you can redistribute it and/or modify it | |
under the terms of the GNU Library General Public License as published | |
by the Free Software Foundation; either version 2, or (at your option) | |
any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
Library General Public License for more details. |
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
void setup() { | |
size(800,400); | |
} | |
void draw() { | |
background(0, 255, 255); | |
float y = 0; | |
for (int i = 1; i <= 5; i++) { | |
y += 24 * (i - 1); | |
drawOutlineText("Hello, Processing World!", 0, y, 24 * i, color(255), color(0)); |
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
void setup() { | |
size(400, 400); | |
stroke(255); | |
noLoop(); | |
} | |
void draw() { | |
background(255); | |
stroke(255, 0, 0); | |
fill(255, 0, 0); |
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
cnt = 1 | |
prev_s = "" | |
while s = gets do | |
s.chomp! | |
if prev_s == "" then | |
prev_s = s | |
next | |
end |
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
data = [] | |
while s = gets | |
data << s.chomp | |
end | |
tmp = {} | |
data.each do |item| | |
if tmp.has_key?(item) then | |
tmp[item] << item | |
else |
OlderNewer