2006å¹´05æ11æ¥13:45 ã«ãã´ãªLightweight Languages perl - åæã«æ·»å - Storable ã¨ããããã§ãã²ãããã¶ãã®åæã«æ·»åã®ã³ã¼ãã¼ã§ããä»åã¯ãStorableã«é¢ãã¦ã [ã] Perl ã® Storable ã¢ã¸ã¥ã¼ã«ã®ã¡ã¢ store [ $first->{uhyo}, $first->{hogera} ], "a.dat"; codingãã®ãã®ã«åé¡ã¯ããã¾ããããdamianæ¬ã«ãè¼ã£ã¦ããªãbest practiceãããã§ä¸ã¤ç´¹ä»ãã¾ãããã Always use nstore and nfreeze instead of store and freeze. 常ã«nstoreã¨nfreezeã使ãäºãstoreã¨freezeã§ã¯ãªãã çç±ã¯ããã®æ¹ããã£ã¨ã¤ã¶ããå©ãããã§ããé ã«nãã¤ããã ãã§ãplatformä¾åã
第3åãActiveRecordã使ã£ãã½ã¼ã¹ã³ã¼ããèªãã å貫 義人 æ¾æ ç« å¼ TISæ ªå¼ä¼ç¤¾ SonicGarden 2009/1/28 åªããããã°ã©ãã¯ã³ã¼ããæ¸ãã®ã¨åãããããã³ã¼ããèªã¿ããªããªãã¦ã¯ãªããªããåªããã³ã¼ããèªããã¨ã§ãèªèº«ã®ã¹ãã«ãä¸éããã®ã ï¼ç·¨éé¨ï¼ ããã¾ã§ã®2åã®è¨äºã§ãRailsã¢ããªã±ã¼ã·ã§ã³ã®åºæ¬çãªæ§æã¨ããã¹ãã£ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã§ããRSpecã使ã£ãã½ã¼ã¹ã³ã¼ãã®ã³ã¼ããªã¼ãã£ã³ã°ãè¡ã£ã¦ãã¾ãããä»åã¯ãRailsã®ãã¢ã§ãããDBã¢ã¯ã»ã¹å¦çã®é¨åãæ±ãActiveRecordãæ·±ãæãä¸ãã¦ã³ã¼ããªã¼ãã£ã³ã°ãè¡ãã¾ãã ActiveRecordã¨ã¯ãã¾ãããååã®âActive Recordâã¨ããDBã¢ã¯ã»ã¹ã«é¢ãããã¶ã¤ã³ãã¿ã¼ã³ãå®è£ ããã©ã¤ãã©ãªã§ãããã¼ã¿ãã¼ã¹ã®ãã¼ãã«ãã¯ã©ã¹ã¨ãã¦ãã¸ãã¹ãã¸ãã¯ãæããããã¼
ä½æãããé åãªãã¸ã§ã¯ãããããã·ã¥ãªãã¸ã§ã¯ããä½æãããã¨ãã§ãã¾ããç¹å¥ãªã¡ã½ãããç¨æããã¦ããããã§ã¯ãªãã®ã§ãå¥ã®ç¨éã®ã¡ã½ãããçµã¿åããããã¨ã§é åããããã·ã¥ãä½æãã¾ããããã§ã¯ Ruby ã§é åããããã·ã¥ãä½æããæé ã«ã¤ãã¦è§£èª¬ãã¾ãã
ããªã¤ã«ã®ç¼å£²ã¨ä¸è¯çã ããªã¤ã«ããããè¦ãããããã«ãªãã¾ããããçãç°ã§ãæ³³ãã§ãããã®ãä¸æ¯è³¼å ¥ãã¾ãã ç«æ´¾ãªå¤§ããªå¢¨è¢ãèã¯å·åä¿åã㦠æãããªèº«ã¯å£ç¯ã®ãè±ããéèã¨åããã¦ä¸è¯ã®çããã®ã«ãæ°é®®ãªã«ãã«ãã®èã¯å»ã¿ãé¦ãé«ãé£æ¬²ããããã¾ãã ä¸è¶³ã¯ãã³ãã«ãâ¦
ããã«ã¡ã¯ djangoæ´¾é¥ã¨railsæ´¾é¥ã®äºããæ¿ããæè¿ã®ã¦ãã¦ã§ããã¡ãªã¿ã«è¥å¹²railsãåªå¢ã§ãã require 'openssl' def encrypt(aaa, solt = 'solt') enc = OpenSSL::Cipher::Cipher.new('aes256') enc.encrypt enc.pkcs5_keyivgen(solt) ((enc.update(aaa) + enc.final).unpack("H*")).to_s rescue false end def decrypt(bbb, solt = 'solt') dec = OpenSSL::Cipher::Cipher.new('aes256') dec.decrypt dec.pkcs5_keyivgen(solt) (dec.update(Array.new([bbb]).pa
ããªãã ãããããããã®ã§ä»åº¦èª¿ã¹ãã¨æ¸ããã¨ããã«ã¤ãã¦ã CSRFã®å¯¾å¿ã«ã¤ãã¦ãrails使ããç¥ã£ã¦ããã¹ãã㨠- ããããWEBãµã¼ãã¹éçºæ¥è¨ ã¾ãã¯ããã¼ã¨ã»ãã·ã§ã³ã®éããããèªåã®èªèã¯ãããªæã ã¯ããã¼ãã»ãã·ã§ã³ãããã©ã¦ã¶ã«ãã¼ã¿ãä¿åãããä»çµã¿ã ã¯ããã¼ã¯ãã¼ã¿ããã®ã¾ã¾ãã©ã¦ã¶ã«ä¿åãããã ã»ãã·ã§ã³ã¯ã»ãã·ã§ã³IDããã©ã¦ã¶ã«ä¿åããããã¼ã¿ã¯ãµã¼ãå´ãä¿æããããµã¼ãã¯ã»ãã·ã§ã³IDããã¼ã«ãã¦ãã¼ã¿ãåãåºãã railsã§ã¯ããã¼ãè¨å®ããã«ã¯ railsã§ã¯ãã¯ããã¼ã¯åºæ¬çã«ä½¿ããªãã¨æã£ã¦ã¾ãããä¸å¿ä½¿ãæ¹ãã¡ã¢ã cookies[:hoge] = { :value => "value", :expires => "30.days.from_now", :path => "/store", :domain => "www.example.
Rubyã§ä½¿ããããã·ã¥é¢æ°ã®æ§è½ã測ã£ã¦ã¿ãã Rubyã®ã¡ãã»ã¼ã¸ãã¤ã¸ã§ã¹ãã©ã¤ãã©ãªã§ä½¿ããããã·ã¥é¢æ°+String#hashã®å¦çæéãè¨æ¸¬ åå¦çã10000åå®è¡ãã¦åè¨å¦çæéãåºãã çµæã¯ä»¥ä¸ã ããã·ã¥é¢æ° æè¦æé(ç§) sha1 0.913 sha256 1.572 sha384 3.039 sha512 3.024 md5 0.86 rmd160 1.1 hash 0.797 (ä½ãå®è¡ããªã:æ¯è¼ç¨) 0.692 sha2ç³»ã¯ãã¯ãéãã sha1,md5,hashã¯ã»ã¼åãã§é«éã è¨æ¸¬ç°å¢ã¯ä»¥ä¸ã CPU : Intel Core 2 Duo 2.19GHz ã¡ã¢ãª : 1.99 GB è¨æ¸¬ã«ä½¿ç¨ããã¹ã¯ãªããã¯æ¬¡ã®éãã require 'digest/sha1' require 'digest/sha2' require 'digest/md5' r
2009å¹´06æ12æ¥02:30 ã«ãã´ãªLightweight LanguagesBlogosphere perl - ç¾ä»£ç㪠Perl ãåç¿å¾ããæ¹æ³ã¯ TopHatenarã§perlä¸ä½ã®ç§ãæ¥ã¾ãããã ç¾ä»£ç㪠Perl ãåç¿å¾ããæ¹æ³ã¯ï¼ - ã¹ã©ãã·ã¥ãããã»ã¸ã£ãã³ ç¾ä»£ç㪠Perl ãç¿å¾ããããã«ã¯ãã©ã®ãããªã¹ããããè¸ãã®ãè¯ãã ããã ? ã¾ããå§ãã®æ¸ç±ãªã©ãã£ããæãã¦æ¬²ããã ã¢ãã³Perlã«éãããããã°ã©ãã³ã°ãå?ç¿å¾ããã®ã«æé©ãªæ¹æ³ãããã¯.... ããã°ã«æ¸ãã¤ã¥ããã㨠ã§ããä»ã®ã©ããªææ³ãããã«åããã¨ã¯ãªãã¨å¼¾è¨ãã¾ãããã 以ä¸ããã®ä¸ã¤ã®çç±ã 1. èªç¶ã«ã¢ã¦ãããããåºæ¥ã ããã°ã©ã ã¯ãè¨èªã§æ¸ãã¾ãã æ¸ããã®ã§ãã以ä¸ãæ¸ããªããã°è¦ãããã¾ããã ãããããã½ã¼ã¹ã³ã¼ããèªãã§ããæ¸ããªããã°èªåã®ãã®ã«ã¯ãªãã¾ã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}