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
UPDATE class_A SET sex_code =1; | |
SELECT * FROM class_A; | |
UPDATE class_A SET sex_code = 2 WHERE id IN (3,4); | |
-- sex_codeをわかりやすく出力する | |
SELECT name, | |
CASE sex_code | |
WHEN 1 THEN 'Male' |
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
ascii = [] | |
0x61.upto(0x7a){|a| ascii.push(a.chr) } | |
0.upto(9) {|num| ascii.push(num.to_s) } | |
list = [] | |
ascii.each do |chr1| | |
ascii.each do |chr2| | |
ascii.each do |chr3| | |
list.push(chr1 + chr2 + chr3) | |
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
# encoding: utf-8 | |
class PascalsTriangle | |
@@count= 10 | |
@@list = [] | |
def create(list) | |
sum = [] | |
i = 1 | |
while i < list.size |
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/sh | |
while true; do | |
read -p "Do you wish to install this program? [y/n]" yn | |
case $yn in | |
[Yy] ) echo "Install!"; break;; | |
[Nn] ) exit;; | |
* ) echo "Please answer y or n.";; | |
esac | |
done |
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
/* | |
* 単純挿入法で配列の値を昇順にソートする | |
*/ | |
var list = [8, 1, 3, 4, 9, 5], | |
i = 1, | |
j, | |
tmp; | |
for (i; i < list.length; i++) { |
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
#encoding: utf-8 | |
# | |
# 単純挿入法で配列の値を昇順にソートする | |
# | |
list = [8, 1, 3, 4, 9, 5] | |
i = 1 | |
while i < list.size do | |
j = i |
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
<?php | |
/* | |
* 単純挿入法で配列の値を昇順にソートする | |
*/ | |
$list = array(8, 1, 3, 4, 9, 5); | |
for ($i = 1; $i < count($list); $i++) { | |
$j = $i; |
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
/* | |
* バブルソートで配列の値を昇順にソートする | |
* | |
*/ | |
var list = [8, 1, 3, 4, 9, 5], | |
j = 1, | |
i, | |
tmp; | |
for (j; j < list.length; j++) { |
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
# encoding: utf-8 | |
# | |
# バブルソートで配列の値を昇順にソートする | |
# | |
list = [8, 1, 3, 4, 9, 5] | |
j = 1 | |
while j < list.size | |
i = j |
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
<?php | |
/* | |
* バブルソートで配列の値を昇順にソートする | |
* | |
*/ | |
$list = array(8, 1, 3, 4, 9, 5); | |
for ($j = 1; $j < count($list);$j++) { | |
for ($i = $j; $i < count($list); $i++) { |