Hatena::Grouprubyist

krystal: プログラミング超初心者(文系)

2009-01-08 (Thu)たのしいRuby練習問題

P - 306 練習問題(3)

21:43

  • Unixのduコマンドのように、再帰的に掘り下げて調べ表示するメソッドduを定義してみよう。
def du(path)
  size = FileTest.size(path)
  if FileTest.directory?(path)
    Dir.open(path){|dir|
      dir.each{|name|
        next if name == "."
        next if name == ".."
        size += du(File.join(path, name))
      }
    }
  end
  printf("%8d %s\n", size, path)
  return size  #size(数字)を返さないと、↑のduはprintfを返すことになるからnil。だから、size+nilは怒られる
end

KaedonKaedon2016/05/07 15:52Hi Gina!I have a question not related to this post…I went back to read some of your early pregancy posts and you were saying that you ate a lot of pineapple because it would help with implantation (and I guess it did ). However now I’m also reading that you sh#7udn&o821l;t eat pineapple because it might stimulate labor. Have you ever heard of this? I still have one waiting for me at home and now I’m not sure if it’s good to eat it or bad to eat it!

CaidenCaiden2016/05/08 22:32Ce taranca esti in pozele alea Florica! Hi, hi, hi!Auzi, dar dupa <a href="http://omrxjg.com">prtoizopia</a> "Sa facem loc pentru porc" de ce apare o poza cu nasu tau de cununie, fostul tau sef, Adrian? :)

ConyersConyers2016/05/09 10:37Thanks for your response and for reading the site. You are correct, we just see the numbers not every game. Decision making is something he needs to improve upon going forward. <a href="http://fdsaci.com">Boaeeendhd</a> mistakes need to stop. I’m posting another story today about this and giving you credit for bringing this to my attention. His defense was a bigger issue than his batting last year and we need to keep that part of his game in mind.

iderabafiderabaf2018/02/24 12:12http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

uzopufouzopufo2018/02/24 12:21http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

igigesehoxuoyigigesehoxuoy2018/02/24 12:28http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

hakeyafoqubhakeyafoqub2018/02/24 12:36http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

amudiqoifiamudiqoifi2018/02/24 12:45http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

efatowfecefatowfec2018/02/24 12:48http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

uitacmiozimekuitacmiozimek2018/02/24 12:49http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

actuqimayitadactuqimayitad2018/02/24 12:54http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ezopadaxozezopadaxoz2018/02/24 13:01http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

erjenugaterjenugat2018/02/24 13:03http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

aveqxaposapadaveqxaposapad2018/02/24 13:06http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

isezijupisezijup2018/02/24 13:09http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

uhaniyehiduuhaniyehidu2018/02/24 13:09http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ipisofekeisipisofekeis2018/02/24 13:23http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

owococodoowococodo2018/02/24 13:25http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

euhnebuzoficeuhnebuzofic2018/02/25 10:59http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

befubedulaogwbefubedulaogw2018/02/25 11:18http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

inewokiwitwinewokiwitw2018/02/27 04:34http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

izamoiqaiokuqizamoiqaiokuq2018/02/27 04:40http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

udeyobiveudeyobive2018/02/27 04:45http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

acariyiroacariyiro2018/02/27 04:48http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

onifiruxowijaonifiruxowija2018/02/27 04:50http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

enexasahaenexasaha2018/02/27 04:56http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ovvomibuniaovvomibunia2018/02/27 05:00http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ifakvavyixiifakvavyixi2018/02/27 05:09http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ovageyaetuovageyaetu2018/02/27 05:11http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

usayimufohebeusayimufohebe2018/02/27 05:21http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

iaviheukousabiaviheukousab2018/02/27 05:21http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

irawaecuheirawaecuhe2018/02/27 05:24http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

inudijadirpejinudijadirpej2018/02/27 05:25http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ayiufufodupayiufufodup2018/02/27 05:36http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

uvepibebuvepibeb2018/02/27 05:37http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ugosbijopiugosbijopi2018/02/28 04:32http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

izonuhukgazoizonuhukgazo2018/02/28 04:48http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

aulumidiaxaulumidiax2018/04/20 01:56http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

oreetosemcahoreetosemcah2018/04/20 02:15http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ditunebagutarditunebagutar2018/04/20 02:17http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

iepowiviruweiepowiviruwe2018/04/20 02:30http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

gihdagigihdagi2018/04/20 02:31http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

etbixinogeetbixinoge2018/04/20 02:51http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ozuracotasigozuracotasig2018/04/20 02:52http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ijehupuhedijehupuhed2018/04/20 03:06http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

asiisekiasiiseki2018/04/20 03:07http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

getapabiyogetapabiyo2018/04/20 03:25http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

irhetakihiuiirhetakihiui2018/04/20 03:27http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

awuguvarawuguvar2018/04/20 03:34http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ooxivalieziooxivaliezi2018/04/20 03:39http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

isowuwezoisowuwezo2018/04/20 03:41http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

emoryajeemoryaje2018/04/20 03:49http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

agihoqanamiqeagihoqanamiqe2018/04/20 04:00http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ooojitoliooojitoli2018/04/20 04:01http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

unjaaluituqunjaaluituq2018/04/20 04:14http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

uhuyajieluhuyajiel2018/04/20 04:16http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

obilqiwuobilqiwu2018/04/20 04:32http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

nobacitizeznobacitizez2018/04/20 04:35http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

icubicaicubica2018/04/20 04:47http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

oginikuyuoginikuyu2018/04/20 04:49http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

uciyagnuuciyagnu2018/04/20 04:54http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

earitifearitif2018/04/20 04:54http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

emimoqokiyemimoqokiy2018/04/20 05:08http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

auifekiqoqiauifekiqoqi2018/04/20 05:08http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ipeepecvaxipeepecvax2018/04/20 23:35http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

staletaahdstaletaahd2018/07/31 10:20<a href="http://rabbitinahat.com">cialis online coupon</a> cialis 5mg best price http://rabbitinahat.com

italethdrhitalethdrh2018/08/01 07:15<a href="http://missreplicawatches.com">cialis online canada pharmacy</a> buy cialis online usa http://missreplicawatches.com

gtalettnlcgtalettnlc2018/08/02 06:29<a href="http://gigawatt6.com">order cialis from india</a> cialis coupons http://gigawatt6.com

ztaletiqhvztaletiqhv2018/08/03 03:33<a href="http://motechautomotive.com">canadian online pharmacy generic cialis</a> buy cialis uk http://motechautomotive.com

utalettxptutalettxpt2018/08/04 04:02<a href="http://motechautomotive.com">best place to buy cialis</a> cheap cialis online uk http://motechautomotive.com

ctaletnqymctaletnqym2018/08/05 11:06<a href="http://kqcopy.com">buy viagra now</a> buy real viagra online http://kqcopy.com

ptaletshhoptaletshho2018/08/06 18:36<a href="http://kqcopy.com">order viagra online without prescription</a> order viagra with paypal http://kqcopy.com

ktaletfpvwktaletfpvw2018/08/07 12:08<a href="http://motechautomotive.com">cialis pills online</a> cialis pill http://motechautomotive.com

utaletrdxbutaletrdxb2018/08/09 01:40<a href="http://mphasset.com">order viagra onlines</a> generic viagra pills http://mphasset.com

ktaletidzbktaletidzb2018/08/18 07:28<a href="http://missreplicawatches.com">cialis cheap</a> how often can you take 20 mg cialis http://missreplicawatches.com

mtaletsqyqmtaletsqyq2018/08/18 10:06<a href="http://gigawatt6.com">daily cialis cost</a> cialis advertisement http://gigawatt6.com

ptaletkhwbptaletkhwb2018/08/18 12:49<a href="http://mphasset.com">online pharmacy viagra no prescription</a> buy viagra online without a prescription http://mphasset.com

btaleturigbtaleturig2018/08/18 17:10<a href="http://mphasset.com">phizer viagra</a> generic viagra companies http://mphasset.com

ctaletsmzsctaletsmzs2018/08/18 20:50<a href="http://mphasset.com">viagra canada pharmacy</a> buy viagra online legally http://mphasset.com

staletfwdcstaletfwdc2018/08/19 00:05<a href="http://bakerssign.com">walmart levitra price</a> where to get levitra http://bakerssign.com

ftaletgcrsftaletgcrs2018/08/19 03:17<a href="http://baymontelreno.com">order cialis pills</a> can cialis cure ed http://baymontelreno.com

mtaletbapgmtaletbapg2018/08/19 05:01<a href="http://gigawatt6.com">what is cialis 5 mg used for</a> does cialis cause high blood pressure http://gigawatt6.com

italetfvsoitaletfvso2018/08/19 07:56<a href="http://psychologytweets.com">can you take cialis and viagra together</a> generic cialis malaysia http://psychologytweets.com

jtaletzfofjtaletzfof2018/08/19 12:00<a href="http://baymontelreno.com">cialis buy online</a> cialis cheapest price http://baymontelreno.com

gtaletgxzsgtaletgxzs2018/08/20 02:20<a href="http://gigawatt6.com">cialis works</a> what is cialis used for http://gigawatt6.com

mtaletnamymtaletnamy2018/09/11 10:24<a href="http://rabbitinahat.com">comprar cialis</a> who can prescribe cialis http://rabbitinahat.com

staletsqomstaletsqom2018/09/11 18:37<a href="http://gigawatt6.com">how long does it take for daily cialis to work</a> can i take expired cialis http://gigawatt6.com

btaletxzdibtaletxzdi2018/09/11 20:31<a href="http://mphasset.com">viagra medicine use</a> how long between viagra doses http://mphasset.com

ttalettsnqttalettsnq2018/09/11 23:05<a href="http://missreplicawatches.com">online cialis prescription</a> does generic cialis exist http://missreplicawatches.com

gtaletmgdegtaletmgde2018/09/12 02:04<a href="http://canadian-pharmabuy.com">cheap herbal viagra</a> order viagra online http://canadian-pharmabuy.com

btaletabxvbtaletabxv2018/09/12 04:24<a href="http://usedrestaurantequipmentaz.com">generic cialis cheapest price</a> order cialis http://usedrestaurantequipmentaz.com

ctaletfzjhctaletfzjh2018/09/12 05:33<a href="http://valladium.com">cheap cialis in canada</a> cialis online no prescription http://valladium.com

jtaletsrbcjtaletsrbc2018/09/12 11:48<a href="http://vico4me.com">viagra for sale online</a> buy viagra in mexico http://vico4me.com

staletrplzstaletrplz2018/09/12 14:27<a href="http://motechautomotive.com">order cialis daily</a> best online pharmacy for cialis http://motechautomotive.com

ctaletbnegctaletbneg2018/09/12 19:19<a href="http://vico4me.com">viagra coupons</a> cheap price viagra http://vico4me.com

ttaletuqvlttaletuqvl2018/09/12 19:36<a href="http://canadian-pharmabuy.com">viagra online</a> female viagra http://canadian-pharmabuy.com

dtalethiycdtalethiyc2018/09/12 21:56<a href="http://usedrestaurantequipmentaz.com">brand cialis name online order</a> generic cialis canada online pharmacy http://usedrestaurantequipmentaz.com

qtaletcwzaqtaletcwza2018/09/12 22:14<a href="http://rabbitinahat.com">cialis online paypal</a> cialis pills online http://rabbitinahat.com

vtaletbjbdvtaletbjbd2018/09/13 01:53<a href="http://valladium.com">buy cialis in canada</a> cheap cialis india http://valladium.com

gtaletegtigtaletegti2018/09/13 02:34<a href="http://waltzweekend.com">cheap viagra online</a> cheap viagra no prescription http://waltzweekend.com

btaletgprcbtaletgprc2018/09/13 04:31<a href="http://motechautomotive.com">cialis price</a> order cialis no prescription canada http://motechautomotive.com

dtaletyunkdtaletyunk2018/09/13 04:57<a href="http://gigawatt6.com">mail order viagra cialis</a> cialis online canada http://gigawatt6.com

ptaletixlmptaletixlm2018/09/13 10:55<a href="http://canadian-pharmasale.com">cheap cialis soft</a> best generic cialis online http://canadian-pharmasale.com

ftaletqltdftaletqltd2018/09/13 11:21<a href="http://canadian-pharmaonline.com">buy online order viagra</a> viagra cost per pill http://canadian-pharmaonline.com

otaletewgkotaletewgk2018/09/13 12:50<a href="http://usedrestaurantequipmentaz.com">buy cialis non prescription</a> order cialis http://usedrestaurantequipmentaz.com

dtaletfitydtaletfity2018/09/13 14:43<a href="http://buycialisonl1ne.us">order cialis from canada</a> where to buy cialis online http://buycialisonl1ne.us

ptaletcridptaletcrid2018/09/13 15:47<a href="http://top-monterey-salinas-dentists.com">order levitra</a> levitra for sale http://top-monterey-salinas-dentists.com

jtaletmydajtaletmyda2018/09/13 19:13<a href="http://canadian-pharmasale.com">cheap cialis online</a> generic cialis 60 mg http://canadian-pharmasale.com

italetlohgitaletlohg2018/09/13 21:28<a href="http://gigawatt6.com">buy cheap cialis uk</a> order cialis overnight delivery http://gigawatt6.com

btaletrepzbtaletrepz2018/09/13 22:09<a href="http://gigawatt6.com">order cialis overnight delivery</a> buy cialis online canada pharmacy http://gigawatt6.com

ttaletpatkttaletpatk2018/09/13 23:42<a href="http://zbloggers.com">should i take propecia</a> propecia dosage http://zbloggers.com

ttaletlywettaletlywe2018/09/14 02:02<a href="http://gigawatt6.com">canadian cialis online</a> cheap cialis from india http://gigawatt6.com

htaletibsphtaletibsp2018/09/14 04:37<a href="http://buycialisonlineglka.com">cheap cialis generic canada</a> generic cialis cheapest price http://buycialisonlineglka.com

dtaletcigzdtaletcigz2018/09/14 04:40<a href="http://gigawatt6.com">generic cialis for order</a> generic cialis india pharmacy http://gigawatt6.com

utaletoqntutaletoqnt2018/09/14 06:31<a href="http://baymontelreno.com">buy generic cialis 20 mg</a> cheap cialis in australia http://baymontelreno.com

ztalethysyztalethysy2018/09/14 11:27<a href="http://canadian-pharmabuy.com">viagra 100mg price</a> viagra online canada http://canadian-pharmabuy.com

gtaletwxewgtaletwxew2018/09/14 15:49<a href="http://usedrestaurantequipmentaz.com">cialis coupons online</a> cialis price http://usedrestaurantequipmentaz.com

ctaletskhuctaletskhu2018/09/14 16:11<a href="http://rabbitinahat.com">buy cialis online without prescription</a> buy cialis online no prescription http://rabbitinahat.com

ltalethsegltalethseg2018/09/14 20:56<a href="http://missreplicawatches.com">buy brand cialis online</a> generic cialis in canada http://missreplicawatches.com

htaletcmpvhtaletcmpv2018/09/14 22:36<a href="http://baymontelreno.com">order cialis online us</a> generic cialis online usa http://baymontelreno.com

ctaletaitictaletaiti2018/09/15 01:01<a href="http://buycialisonl1ne.us">cheap cialis</a> buy generic cialis online safely http://buycialisonl1ne.us

ktaletoaauktaletoaau2018/09/15 03:24<a href="http://istanbulexpressonline.com">order viagra onlines</a> order viagra online uk http://istanbulexpressonline.com

dtaletmnuzdtaletmnuz2018/09/15 04:55<a href="http://canadian-pharmaonline.com">viagra online without prescription</a> buy viagra online canada http://canadian-pharmaonline.com

mtaletzchemtaletzche2018/09/15 09:54<a href="http://buycialisonl1ne.us">buy generic cialis online safely</a> buy cialis online canada http://buycialisonl1ne.us

ataletwjjkataletwjjk2018/09/15 12:42<a href="http://rabbitinahat.com">order cialis without perscription</a> how to order cialis online safely http://rabbitinahat.com

ntaletjkcnntaletjkcn2018/09/15 14:42<a href="http://rabbitinahat.com">discount cialis online</a> cialis online india http://rabbitinahat.com

ftaletehccftaletehcc2018/09/15 15:54<a href="http://gigawatt6.com">buy cialis overnight delivery</a> how to order cialis online safely http://gigawatt6.com

ztaletxrsjztaletxrsj2018/09/15 16:24<a href="http://buycialisonlineglka.com">buy brand cialis online</a> how to buy cialis online http://buycialisonlineglka.com

dtaletkvicdtaletkvic2018/09/15 20:00<a href="http://usedrestaurantequipmentaz.com">cialis generic price</a> generic cialis without a prescription http://usedrestaurantequipmentaz.com

ftaletvqxjftaletvqxj2018/09/15 21:47<a href="http://top-monterey-salinas-dentists.com">does levitra work for women</a> buy cheap levitra no prescription http://top-monterey-salinas-dentists.com

mtaletdstvmtaletdstv2018/09/16 01:14<a href="http://rabbitinahat.com">cheap viagra cialis uk</a> cialis coupons online http://rabbitinahat.com

ktaletdrfiktaletdrfi2018/09/16 05:02<a href="http://zbloggers.com">propecia help forum</a> propecia hair http://zbloggers.com

ctaletfqlyctaletfqly2018/09/16 07:05<a href="http://buycialisonl1ne.us">cialis online canada pharmacy</a> cheap cialis from india http://buycialisonl1ne.us

ataletwigxataletwigx2018/09/16 10:31<a href="http://rabbitinahat.com">cialis 5mg online</a> canadian pharmacy online cialis http://rabbitinahat.com

utaletdizuutaletdizu2018/09/16 13:32<a href="http://canadian-pharmasale.com">cialis 20mg online</a> buy cialis online canada pharmacy http://canadian-pharmasale.com

jtaletpfbkjtaletpfbk2018/09/16 14:10<a href="http://canadian-pharmasale.com">generic cialis for order</a> order brand cialis online http://canadian-pharmasale.com

xtaletplwpxtaletplwp2018/09/16 19:21<a href="http://valladium.com">buy generic cialis online</a> order generic cialis online no prescription http://valladium.com

jtaleteucvjtaleteucv2018/09/16 22:49<a href="http://bullsac.com">levitra vs viagra vs cialis</a> levitra prices walmart http://bullsac.com

vtaletxnvpvtaletxnvp2018/09/16 23:52<a href="http://buycialisonl1ne.us">order cialis online from canada</a> cheap brand cialis http://buycialisonl1ne.us

otaletbsebotaletbseb2018/09/17 03:18<a href="http://buycialisonl1ne.us">buy discount cialis</a> order cialis no prescription http://buycialisonl1ne.us

gtalettyjvgtalettyjv2018/09/17 03:54<a href="http://unishade.com">cialis 20 mg</a> buy cialis 5mg online http://unishade.com

gtaletbbffgtaletbbff2018/09/17 07:24<a href="http://bullsac.com">levitra 20 mg how long does it last</a> levitra samples http://bullsac.com

qtaletibzdqtaletibzd2018/09/17 17:51<a href="http://bullsac.com">levitra coupon</a> cheap levitra no prescription http://bullsac.com

mtaletnpxlmtaletnpxl2018/09/17 20:42<a href="http://buycialisonlineglka.com">cialis cheap price</a> cialis originale online http://buycialisonlineglka.com

ltaletzptjltaletzptj2018/09/17 22:07<a href="http://buycialisonlineglka.com">cheap generic cialis canadian pharmacy</a> generic cialis online pharmacy http://buycialisonlineglka.com

btalethquubtalethquu2018/09/18 02:18<a href="http://istanbulexpressonline.com">buy viagra</a> buy viagra order http://istanbulexpressonline.com

gtaletkjfygtaletkjfy2018/09/18 02:35<a href="http://bullsac.com">how long does levitra 10mg last</a> levitra v viagra http://bullsac.com

ktalethtuwktalethtuw2018/09/18 11:26<a href="http://motechautomotive.com">generic cialis without prescription</a> generic cialis usa http://motechautomotive.com

etaletqtcletaletqtcl2018/09/18 12:27<a href="http://usedrestaurantequipmentaz.com">cheap cialis prices uk</a> order cialis overnight http://usedrestaurantequipmentaz.com

ataletxmenataletxmen2018/09/18 15:52<a href="http://usedrestaurantequipmentaz.com">best online cialis</a> cheap viagra cialis uk http://usedrestaurantequipmentaz.com

etaletibedetaletibed2018/09/18 19:00<a href="http://waltzweekend.com">cheap viagra pills</a> cheap viagra from canada http://waltzweekend.com

btaletqyjqbtaletqyjq2018/09/18 20:59<a href="http://buyviagraonl1ne.us">mail order viagra uk</a> buy viagra online no prescription http://buyviagraonl1ne.us

jtaletbwzljtaletbwzl2018/09/18 23:15<a href="http://buycialisonl1ne.us">cialis originale online</a> order cialis online usa http://buycialisonl1ne.us

ttaletuaqattaletuaqa2018/09/19 03:45<a href="http://buyviagraonl1ne.us">discount viagra pills</a> online pharmacy viagra http://buyviagraonl1ne.us

btaletpvyhbtaletpvyh2018/09/19 06:25<a href="http://usedrestaurantequipmentaz.com">generic cialis no prescription</a> buy cialis with prescription http://usedrestaurantequipmentaz.com

italetshfkitaletshfk2018/09/19 15:07<a href="http://canadian-pharmasale.com">buy cialis online pharmacy</a> buy generic cialis online http://canadian-pharmasale.com

ntaletxucqntaletxucq2018/09/19 17:44<a href="http://gigawatt6.com">order cialis now</a> order cialis uk http://gigawatt6.com

xtaletveddxtaletvedd2018/09/19 17:53<a href="http://baymontelreno.com">cheap cialis australia</a> cheap brand cialis online http://baymontelreno.com

ltaletcopxltaletcopx2018/09/19 18:08<a href="http://top-monterey-salinas-dentists.com">what does levitra do</a> levitra drug class http://top-monterey-salinas-dentists.com

ltaletsgsaltaletsgsa2018/09/19 22:05<a href="http://buycialisonl1ne.us">order cialis online overnight</a> mail order cialis online http://buycialisonl1ne.us

btaletfwvebtaletfwve2018/09/19 23:19<a href="http://unishade.com">buy cialis 5mg</a> how to buy cialis online http://unishade.com

ttaletkebattaletkeba2018/09/20 00:01<a href="http://missreplicawatches.com">cheap cialis australia</a> non prescription cialis online pharmacy http://missreplicawatches.com

vtaletentsvtaletents2018/09/20 02:14<a href="http://zbloggers.com">how to get propecia</a> order propecia online http://zbloggers.com

jtaletjbhhjtaletjbhh2018/09/20 06:26<a href="http://istanbulexpressonline.com">cheap female viagra</a> online viagra prescriptions http://istanbulexpressonline.com

ltaletpmkbltaletpmkb2018/09/20 08:54<a href="http://missreplicawatches.com">generic cialis without prescription</a> cheapest place to buy cialis http://missreplicawatches.com

ctaletccrzctaletccrz2018/09/20 13:58<a href="http://baymontelreno.com">order cialis online</a> buy cialis online prescription http://baymontelreno.com

etaletoxmpetaletoxmp2018/09/20 14:27<a href="http://viciolatino.com">best viagra online</a> buy generic viagra online http://viciolatino.com

ktaletmsbcktaletmsbc2018/09/20 17:07<a href="http://istanbulexpressonline.com">buy real viagra online</a> how to buy viagra http://istanbulexpressonline.com

ytalethiulytalethiul2018/09/20 17:38<a href="http://valladium.com">best online pharmacy for cialis</a> cialis online pharmacy http://valladium.com

ktaletwtatktaletwtat2018/09/20 22:50<a href="http://baymontelreno.com">cheapest generic cialis online</a> cialis online paypal http://baymontelreno.com

ntaletigkuntaletigku2018/09/21 00:10<a href="http://buycialisonlineglka.com">buy cialis online no prescription</a> cialis 5mg best price http://buycialisonlineglka.com

wtaletmxmnwtaletmxmn2018/09/21 01:24<a href="http://istanbulexpressonline.com">viagra coupon</a> buy viagra in mexico http://istanbulexpressonline.com

ftaletxcqhftaletxcqh2018/09/21 02:09<a href="http://viciolatino.com">discount viagra</a> viagra online canada http://viciolatino.com

htaletvnechtaletvnec2018/09/21 04:02<a href="http://gigawatt6.com">generic cialis online canada</a> cialis 40 mg online http://gigawatt6.com

qtaletknldqtaletknld2018/09/21 04:49<a href="http://rabbitinahat.com">cialis mail order india</a> buy cialis from india http://rabbitinahat.com

italetzrkbitaletzrkb2018/09/21 06:17<a href="http://canadian-pharmasale.com">order brand cialis online</a> order cialis australia http://canadian-pharmasale.com

2009-01-07 (Wed)たのしいRuby練習問題

P306 - FileクラスとDirクラスの練習問題

20:22

(1)

  • $:を使ってRubyが利用できるライブラリのファイル名を順に出力するメソッドprint_libraryメソッドを定義しよう
def print_library
  $:.each{|i|
    next if i == "."  #practiceという練習フォルダにいるから、"."をスキップしないと練習ファイル全部出てくる
    dir = Dir.open(i)
    dir.each{|name|
      if name =~ /\.rb$/
        puts name
      end
    }
    dir.close
  }
end
print_library

(2)

  • あるディレクトリに置かれているファイルとサブディレクトリを、そのサブディレクトリに入っているファイルやディレクトリごとコピーするメソッドdircopyを定義しよう。
  • このメソッドは2つの引数を取ります。 ----> dircopy(コピー元のディレクトリ名, コピー先のディレクトリ名)

つまずいてる。考え方はそんなに間違ってない気がするけど、うまく実装できてない。

ちゃんと動くようになったらまたアップする。

答えなどを参考にした。


require "ftools"

def dircopy(dir1, dir2)
  if FileTest.exist?(dir2)
    raise "Error : #{dir2} exists already."
  end
  
  Dir.open(dir1){|dir|
    Dir.mkdir(dir2)
    dir.each{|name|
      next if name == "."       
      next if name == ".."      
      path1 = File.join(dir1, name)
      path2 = File.join(dir2, name)
      st = File.lstat(path1)       #lstatを使うことでシンボリックリンクもコピーできるようになるらしい
      if st.file?
        File.copy(path1, path2)
      elsif st.directory?
        dircopy(path1, path2)
      elsif st.symlink?
        File.symlink(File.readlink(path1), path2)
      else
        $stderr.pus "unknown file type : #{path1}"
      end
    }
  }
end

dircopy("/rubima011-cgi", "/ruby/practice/temp")

「たのしいRuby」はちゃんと校正されたか疑問。かなりtypoがあったから。

2008-12-25 (Thu)たのしいRuby練習問題

★☆★☆★☆★☆★ ⊱❤❤❤Merry Christmas!!❤❤❤⊰ ★☆★☆★☆★☆★

19:41

P285 IOクラス練習問題(1)

  • あるファイルの内容を別のファイルにそのままコピーするメソッドcopy_fileを定義しよう
def copy_file(file1, file2)
  open(file1){|from|
    open(file2, "w"){|to|
      while line = from.gets
        to.write(line)
      end
    }
  }
end
copy_file("test.rb", "copy.rb")

コピー元であるfile1から一行ずつgetsして、コピー先ファイルであるfile2へwrite

[2009/01/06]先ほど本を読んだらこのような書き方があった

def copy_file(file1, file2)
  open(file1){|from|
    open(file2, "w"){|to|
      to.write(from.read)
    }
  }
end
copy_file("test.rb", "copy.rb")

P285 IOクラス練習問題(2)

  • Unixで使われるtailコマンドと似たことができるメソッドtailを定義しよう
def tail(line_num, file)
  arr = []
  arr2 = []
  open(file){|f|
    while line = f.gets
      arr << line
    end
  }
  for i in 1..line_num
    arr2 << arr.pop
  end
  puts arr2.reverse

end
tail(11, "copy.rb")

fileから内容を一行ずつ配列arrに入れて、配列arrからline_num回popしたもの(行)を別の配列arr2に入れる。arr2をreverseして出力。

readlinesを使ってみた
def tail(line_num, file)
  open(file) {|f|
    puts f.readlines[(f.readlines.size - line_num)..(f.readlines.size - 1)]
  }
end
tail(7, "copy.rb")

entottoentotto2008/12/25 20:09tail コマンドの魅力は -f オプションだと思います。

「tail.rb -f -n 10 some.log を実行したら、some.logの最後10行を出力したまま、終了せずに、some.logに何か追記されたらさらにそれを出力する。」ような tail.rb がほしいなぁ。> サンタさん

ちなみにファイルへの追記は >> を使うとできます。
$ echo "abc" >> some.log

krystalkrystal2009/01/06 13:18>entottoさん
コメントありがとうございます。
昨日vm wareを使ってtail -fコマンドを確認してみて、どういう動作するかが分かりました。やり方考えてみます。

2008-12-17 (Wed)たのしいRuby練習問題

P266 正規表現クラス

19:08

練習問題(1)

  • メルアドは「ローカルパート@ドメイン名」という形になってるから、ローカルパートを$1として、ドメイン名を$2として取得する正規表現を作る
str = "s.t.a.t.e_of_s.h.o.c.k123@hotmail.co.jp"
/(\w.*)@(\w.*)/ =~ str
local_part = $1
domain_name = $2
p local_part    #=>  "s.t.a.t.e_of_s.h.o.c.k123"
p domain_name   #=>  "hotmail.co.jp"

練習問題(2)

  • 「オブジェクト指向は難しい!なんて難しいんだ!」という文字列をgsubメソッドを使って「オブジェクト指向は簡単だ!なんて簡単なんだ!」という文字列に直す
str = "オブジェクト指向は難しい!なんて難しいんだ!"
p str.gsub(/難しい/, "簡単だ").gsub(/だん/, "なん")   #=>  "オブジェクト指向は簡単だ!なんて簡単なんだ!"

練習問題(3)

  • アルファベットとハイフンからなる文字列を与えれると、ハイフンで区切られた部分をCapitalizeするようなメソッドword_capitalizeを定義する
  • こんな感じで
p word_capitalize("in-reply-to")  #=> "In-Reply-To"
p word_capitalize("X-MAILER")  #=> "X-Mailer"
  • 私のコード
def word_capitalize(str)
  if /\w-*/ =~ str
    ary = Array.new
    str.split("-").each{|x|
      ary << x.capitalize
    }
    ary.join("-")
  end
end
p word_capitalize("out-of-the-box-to-the-sky")  #=> "Out-Of-The-Box-To-The-Sky"
p word_capitalize("GO-THE-DISTANCE")                 #=> "Go-The-Distance"

解答を見たらこれ練習になってないかもと思った。

  • CD-ROMによる(3)の解答はこの2つ:
def word_capitalize(str)
  return str.split(/\-/).collect{|w| w.capitalize}.join('-')
end

p word_capitalize("in-reply-to") #=> "In-Reply-To"
p word_capitalize("X-MAILER")    #=> "X-Mailer"
def word_capitalize(str)
  ret = ""
  str.scan(/(\w+)(\W*)/){|word, no_word|
    ret << word.capitalize + no_word
  }
  return ret
end

p word_capitalize("in-reply-to") #=> "In-Reply-To"
p word_capitalize("X-MAILER")    #=> "X-Mailer"

EmmlyEmmly2016/05/07 16:14here we love LOVE. The emotion, the actions, the rituals and detifinely the word. Whether written on a sign or splashed across a shoe (yes, please Mr. Louboutin) it’s one of the few times when kitsch

EssieEssie2016/05/09 10:37Oh, and Israel, we just criticise, but we never, ever <a href="http://ylolojtyov.com">âœonÂc€ndem”</a> Israel or, God Forbid, Zionism in principle.Anyone get the impression that Tex Tradd is a J Street Stooge?

StapradlyStapradly2018/01/28 02:03Buy Cialis Online Safely Priligy Testimonianze <a href=http://cial10mg.com>online pharmacy</a> Prix Du Viagra Ou Autre Viagra Soft Tabs Erfahrung Viagra Cialis

DiaobjeteDiaobjete2018/04/19 03:02Buy Doxycycline Online Safe <a href=http://tadalaffbuy.com>cialis</a> Tadalafil 40mg Acquistare Kamagra Thailandia Kamagra Dosis

DiaobjeteDiaobjete2018/05/03 06:38Levitra De Bayer Precios Effetto Viagra Donne <a href=http://cialibuy.com>cheapest cialis 20mg</a> Propecia Prix Canadien Over The Counter Deltasone Medication Buy Tadacip 20 Mg Cod Pharmacy Online