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
利用条件とアップルのプライバシーポリシー | |
新しい「アプリケーション内定期購読」に関する項目が利用条件に追加されました。アプリケーション内定期購読の自動更新方法、自動更新を管理およびオフにする方法、およびアイチューンズがお客様にライセンサーに対する個人情報のご提供をお願いする場合のあること(お客様がお断りになった場合も、購入には影響しません)について説明しています。 | |
iTunes Store | |
サービス規約 | |
A. ITUNES STORE、MAC APP STORE、APP STOREおよびIBOOKSTORE販売規約 | |
B. ITUNES STORE利用条件 | |
C. MAC APP STORE、APP STOREおよびIBOOKSTORE利用条件 | |
D. プライバシーポリシー | |
以下は、お客様のiTunes Store、Mac App Store、App Store、ならびにiBookStoreのご利用を規定する各規約です。これらの条件に同意する場合は「同意する」をクリックしてください。これらの条件に同意しない場合は、「同意する」をクリックせず、本サービスをご利用にならないでください。 |
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
def MaxNumber = 100 | |
def NotPrime = [] | |
(1..MaxNumber).each { | |
print it | |
if ((it >1) && (NotPrime[it] != 1 )) { | |
for (def num = it * 2; num <= MaxNumber; num+= it) { | |
NotPrime[num] = 1 | |
} | |
println ":counted!" |
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
1 | |
2:counted! | |
3:counted! | |
4 | |
5:counted! | |
6 | |
7:counted! | |
8 | |
9 | |
10 |
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 org.eiji | |
@Grapes([ | |
@Grab(group='org.slf4j', module='slf4j-log4j12', version='1.6.6'), | |
@Grab(group='ch.qos.logback', module='logback-classic', version='0.9.28') | |
] | |
) | |
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory |
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 ListPut | |
// Case #1 | |
// リストの最初の要素を取得する。 | |
def list = ['a', 'b', 'c'] | |
assert list.first() == 'a' | |
assert list.head() == 'a' | |
assert list[0] == 'a' | |
assert list == ['a', 'b', 'c'] // リスト自体に変化なし。 |
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
// Case #1 | |
// 各要素が文字列であるListからCSV出力する。 | |
def listA = ['A', 'B"', 'C', 4, 3.14] | |
println listA.join(',') | |
// 結果 | |
// A,B",C,4,3.14 | |
// Case #2 |
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
// Case #1 | |
// リストの最初の要素を取得する。 | |
def list = ['a', 'b', 'c'] | |
assert list.first() == 'a' | |
assert list.head() == 'a' | |
assert list[0] == 'a' | |
assert list == ['a', 'b', 'c'] // リスト自体に変化なし。 | |
// Case #2 |
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
// Case #1 | |
// リストの指定した要素で新たなリストを取得する | |
def list = ['a', 'b', 'c', 'd', 'e'] | |
assert list[0, 2, 4] == ['a', 'c', 'e'] | |
// Case #2 | |
// リストの指定した範囲で新たなリストを取得する | |
list = ['a', 'b', 'c', 'd', 'e'] |
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
// Case #1 | |
// リストを任意の値で埋める | |
def list = [255] * 5 | |
assert list == [255, 255, 255, 255, 255 ] | |
// Case #2 | |
// リストをリストの繰り返しで設定する | |
def list2 = [1, 2, 3] * 3 |
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
// Case #1 | |
// リストを結合する。 | |
assert [1] + 2 + [3, 4] == [1, 2, 3, 4] | |
def list = [1] | |
// Case #2 | |
// リストを結合する。 |
OlderNewer