Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby08

 Ruby08

Ruby講義 第8回 各種演習
2013.6.6
ニフティ株式会社寄附講義 社会科学における情報技術とコンテンツ作成Ⅲ

Kuniaki IGARASHI

May 26, 2013
Tweet

More Decks by Kuniaki IGARASHI

Other Decks in Technology

Transcript

  1. BCD ࣮ߦલ ΦϒδΣΫτ "#$ BCDVQDBTF BCDVQDBTF ࣮ߦޙ ΦϒδΣΫτ VQDBTF ΦϒδΣΫτ

    ͕ม਎͢Δ BCD ࣮ߦલ ΦϒδΣΫτ "#$ ࣮ߦޙ ৽ΦϒδΣΫτ VQDBTF BCD چΦϒδΣΫτ ม׵ͨ͠ ৽͍͠ ΦϒδΣΫτ ͕ෳ੡͞ΕΔ 
  2. BCD ࣮ߦલ ΦϒδΣΫτ "#$ BCDVQDBTF ࣮ߦޙ ΦϒδΣΫτ VQDBTF ΦϒδΣΫτ ͕ม਎͢Δ

    VQDBTFͷ࢖͍ํ BBCD BCD B "#$ B  BVQDBTF ม਺B͕ࢦ͢ΦϒδΣΫτ͕BCD͔Β"#$ʹม਎ ม਺BΛͦͷ··࢖͏
  3. VQDBTFͷ࢖͍ํ BBCD BCD "#$ C BCDVQDBTF BCD ࣮ߦલ ΦϒδΣΫτ "#$

    ࣮ߦޙ VQDBTF ม׵ͨ͠ ৽͍͠ ΦϒδΣΫτ ͕ෳ੡͞ΕΔ BCD چΦϒδΣΫτ B BCD B ৽ΦϒδΣΫτ  CBVQDBTF ෳ੡͞ΕͨΦϒδΣΫτΛผͷม਺ ͜͜Ͱ͸C ʹೖΕΔ
  4. BCD ࣮ߦલ ΦϒδΣΫτ "#$ BCDVQDBTF ࣮ߦޙ ΦϒδΣΫτ VQDBTF ΦϒδΣΫτ ͕ม਎͢Δ

    ഁյతϝιου VQDBTFͷΑ͏ʹΦϒδΣΫτͷ಺༰Λ มߋ͢Δ΋ͷΛʮഁյతϝιουʯͱݴ͍·͢ ϝιου໊຤ඌʹ͕͍ͭͨ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໨Λ ҎԼͷίʔυͰࠩ͠ସ͍͑ͯͩ͘͞ɻDQ͸จࣈίʔυͷҰछͰ͢ɻ pMFOBNFKBUYU wσʔλϑΝΠϧ͸ͭ༻ҙ͍ͯ͠·͢ɻ ɹ·ͣ͸খ͍͞ํͰίʔυ͕͏·͘ಈ͘͜ͱΛ֬ೝͯ͠Έ·͠ΐ͏ɻ ɹ[JQܗࣜͰѹॖͯ͋͠ΔͷͰɺղౚͯ͠ར༻͍ͯͩ͘͠͞ɻ ɹɹ 8JO͸ϑΝΠϧબ୒ͯ͠ӈΫϦοΫϝχϡʔ͔Βʮ͢΂ͯల։ʯɺ.BD͸ϑΝΠϧΛμϒϧΫϦοΫ ɹKBUYU ɹɹɹ࿅श༻ͷখ͍͞σʔλ IUUQCJUMZXQEBUBNJOJ ɹQBHFDPVOUT ɹɹɹ%-Ͱ͖Δ࣮ࡍͷσʔλ IUUQCJUMZXQEBUB 
  8. ԋश໰୊ "SSBZΦϒδΣΫτͷཁૉ͕ح਺ͷ߲໨Λશͯ଍͢ ίʔυΛॻ͍͍ͯͩ͘͞ɻ ྫ͑͹BSSBZ<    >ͷ৔߹ɺ  

      ͕දࣔ͞ΕΕ͹0,Ͱ͢ɻ ώϯτɿح਺͔Ͳ͏͔ௐ΂Δͷ͸'JYOVNPEE ϝιου ͪͳΈʹۮ਺͔ௐ΂Δͷ͸'JYOVNFWFO ϝιουͰ͢ɻ PEE USVF PEE GBMTF 
  9. ԋश໰୊ BMJDF CPC DBSPMͷࢼݧͷ఺਺͕࣍ͷΑ͏ʹ)BTIʹ֨ೲ͞Ε͍ͯ ·͢ɻ BMJDF\FOHMJTI NBUI IJTUPSZ^ CPC\FOHMJTI NBUI

    IJTUPSZ^ DBSPM\FOHMJTI NBUI IJTUPSZ^ ֤Պ໨ͷฏۉ఺Λग़ྗ͍ͯͩ͘͠͞ 
  10. ԋश໰୊ "SSBZΦϒδΣΫτͷཁૉ͕ح਺ͷ߲໨Λશͯ଍͢ίʔυΛॻ͍͍ͯͩ͘͞ɻ ྫ͑͹BSSBZ<    >ͷ৔߹ɺ   ͕දࣔ͞ΕΕ͹

    0,Ͱ͢ɻ ώϯτɿح਺͔Ͳ͏͔ௐ΂Δͷ͸'JYOVNPEE ϝιου ͪͳΈʹۮ਺͔ௐ΂Δͷ͸'JYOVNFWFO ϝιουͰ͢ɻ BSSBZ<    > TVN BSSBZFBDIEPcJc TVN JJGJPEE FOE QTVN ߦͰ͔ͬ͜Α͘ॻ͘͜ͱ΋Ͱ͖·͢ɻ ্ڃऀ޲͚ <    >TFMFDU\cJcJPEE ^JOKFDU  PEE USVF PEE GBMTF 
  11. ԋश໰୊ <\UJUMFB QSJDF^ \UJUMFC QSJDF^ \UJUMFD QSJDF^> ͱ͍͏ΦϒδΣΫτ͔ΒɺҎԼͷΑ͏ͳΦϒδΣΫτΛ࡞ΔίʔυΛॻ͍͍ͯͩ͘͞ɻ <\UJUMFB QSJDF

    TQFDJBM-PXQSJDF^ \UJUMFC QSJDF^ \UJUMFD QSJDF TQFDJBM-PXQSJDF^> JUFNT<\UJUMFB QSJDF^ \UJUMFC QSJDF^ \UJUMFD QSJDF^> JUFNTFBDIEPcJUFNc JUFN<TQFDJBM>-PXQSJDFJGJUFN<QSJDF> FOE QJUFNT <\UJUMFB QSJDF TQFDJBM-PXQSJDF^ \UJUMFC QSJDF^ \UJUMFD QSJDF TQFDJBM-PXQSJDF^> ࣮ߦ݁Ռ 
  12. ԋश໰୊ ͋Δ"SSBZΦϒδΣΫτ͕༩͑ΒΕͨͱ͖ɺ ྫ ͑͹<  > ͦͷதͰҎԼͷ਺ࣈ͕͍ͭ͋͘ Δ͔දࣔ͢ΔίʔυΛॻ͍͍ͯͩ͘͞ɻ BSSBZ< 

    > DPVOU BSSBZFBDIEPcJc DPVOU JGJ FOE QDPVOU BSSBZ<  > QBSSBZDPVOU\cJcJ^ ผղɹDPVOUϝιουʹϒϩοΫΛ౉͢͜ͱͰΧ΢ϯτͰ͖·͢ɻ ϒϩοΫ͸EPFOEͷมΘΓʹ\^Ͱॻ͘͜ͱ΋Ͱ͖·͢ɻ 
  13. ԋश໰୊ )BTIͷ஋ͷதʹͱ͍͏จࣈؚ͕·ΕΔͱ͖ʹɺͦͷ஋Λେจࣈ ʹม׵ͨ͠)BTIΛ࡞ΔίʔυΛॻ͍͍ͯͩ͘͞ɻ ྫ͑͹ɺ \BMJDFZFBI CPCZP MJOEBXPX^ ˢͱ͍͏)BTIΛˣʹͰ͖Ε͹0,Ͱ͢ɻ \BMJDFZFBI CPC:0

    MJOEB808^ I\BMJDFZFBI CPCZP MJOEBXPX^ IFBDIEPcLFZ WBMVFc I<LFZ>WBMVFVQDBTFJGWBMVFd FOE QI \BMJDFZFBI CPC:0 MJOEB808^ 
  14. ԋश໰୊ EFGQSJOU@UFYU I QVUT5IJTPCKFDUEPFTOPUIBWFUFYULFZVOMFTTI<UFYU> FOE QSJOU@UFYU \UFYUUIF3VCZCPPL^ ग़ྗͳ͠ QSJOU@UFYU \GPPCBS^

    5IJTPCKFDUEPFTOPUIBWFUFYULFZ Ҿ਺ʹϋογϡΛड͚औΔϝιουΛॻ͍͍ͯͩ͘͞ɻͦͷϝιουͷதͰɺҾ਺Ͱड͚औͬͨ ϋογϡʹΩʔUFYU͕ͳ͔ͬͨͱ͖ɺ5IJTPCKFDUEPFTOPUIBWFUFYULFZͱग़ ྗ͢ΔίʔυΛॻ͍͍ͯͩ͘͞ɻ ʢྫ͑͹ɺϝιου໊ΛQSJOU@UFYUͱͯ͠ɺϝιουݺͼग़͠ଆ͸ҎԼͷΑ͏ʹͳΓ·͢ɻʣ QSJOU@UFYU \UJUMFzUIF3VCZCPPLz^ 
  15. ԋश໰୊ BMJDF CPC DBSPMͷࢼݧͷ఺਺͕࣍ͷΑ͏ʹ)BTIʹ֨ೲ͞Ε͍ͯ·͢ɻ BMJDF\FOHMJTI NBUI IJTUPSZ^ CPC\FOHMJTI NBUI IJTUPSZ^

    DBSPM\FOHMJTI NBUI IJTUPSZ^ ֤Պ໨ͷฏۉ఺Λग़ྗ͍ͯͩ͘͠͞ BMJDF\FOHMJTI NBUI IJTUPSZ^ CPC\FOHMJTI NBUI IJTUPSZ^ DBSPM\FOHMJTI NBUI IJTUPSZ^ QVUTFOHMJTIBWFSBHF  BMJDF<FOHMJTI> CPC<FOHMJTI> DBSPM<FOHMJTI>  QVUTNBUIBWFSBHF  BMJDF<NBUI> CPC<NBUI> DBSPM<NBUI>  QVUTIJTUPSZBWFSBHF  BMJDF<IJTUPSZ> CPC<IJTUPSZ> DBSPM<IJTUPSZ>  
  16. ԋश໰୊ʲ্ڃʳ4ղ ͋ΔςΩετϑΝΠϧ͔ΒɺBͱ͍͏จࣈྻΛؚΉߦͩ ͚Λநग़ͨ͠ผͷςΩετϑΝΠϧΛ࡞͍ͬͯͩ͘͞ɻ ྫɿ BMJDF CPC DBSPM BMJDF DBSPM ϑΝΠϧ͔ΒಡΈࠐΈ

    JODMVEFE<>ग़ྗ༻σʔλΛ֨ೲ͢Δ"SSBZ JO@pMFOBNFJOUYU 'JMFPQFO JO@pMFOBNF S65' EPcJO@pMFc XIJMFUFYUJO@pMFHFUT JODMVEFEUFYUJGUFYUdB FOE FOE ϑΝΠϧ΁ॻ͖ࠐΈ PVU@pMFOBNFPVUUYU 'JMFPQFO PVU@pMFOBNF X65' EPcPVU@pMFc JODMVEFEFBDIEPcJc PVU@pMFQVUTJ FOE FOE ͭͷϑΝΠϧΛPQFO͠·͢ɻ ग़ྗଆ͸X65' ॻ͖ࠐΈ Ͱ͢ɻ ·ͨɺ'JMFPQFOʹϒϩοΫΛ ౉͢ͱϒϩοΫ׬ྃ࣌ʹࣗಈͰ DMPTF͠·͢ 
  17. ԋश໰୊ʲ্ڃʳ4ղ ͋ΔςΩετϑΝΠϧ͔ΒɺBͱ͍͏จࣈྻΛؚΉߦͩ ͚Λநग़ͨ͠ผͷςΩετϑΝΠϧΛ࡞͍ͬͯͩ͘͞ɻ ྫɿ BMJDF CPC DBSPM BMJDF DBSPM JO@pMFOBNFJOUYU

    PVU@pMFOBNFPVUUYU 'JMFPQFO JO@pMFOBNF S65' EPcJO@pMFc 'JMFPQFO PVU@pMFOBNF X65' EPcPVU@pMFc XIJMFUFYUJO@pMFHFUT PVU@pMFQVUTUFYUJGUFYUdB FOE FOE FOE JOͱPVUΛಉ࣌ʹ։͘ॻ͖ํͰ͢ɻ݁Ռ֨ೲ༻ͷ"SSBZ͕ෆཁʹͳΔͷͰ εοΩϦͰ͢ɻ