2009-01-01ãã1å¹´éã®è¨äºä¸è¦§
ä¸ã§è°è«ããããã«, ãªã¹ãã®æä½ãç°¡åã«æ¸ãã®ã¯åè¨èª, ç¹ã« LL ã¨å¼ã°ããè¨èªãã¡ã§ãµãã¼ãããã¦ãã¦ãã¾ã. C ã®ç´ç³»ã¨è¨ãã Java ã§ãæ¡å¼µ for æãå°å ¥ããã¾ããã. ä¸æ¦ããã«æ £ãã¦ãã¾ãã¨, ãã C ã® for æã«ã¯æ»ãã¾ãã(è¦ç¬)ããã§, åâ¦
(以ä¸, Python 2.6.4 ã§ãã£ã¦ã¾ã.)python ã«ã¯å å 表è¨ã¨ãã filter, map, reduce ã®ä»£æ¿ãã§ãããããªè¡¨è¨æ¹æ³ãããã¾ã. 詳ããã¯æ¤ç´¢ãã¦ãããã¨ãã¦, ä»åã®ãã¿ã¯ãã®å å 表è¨ã§ flatten ã¨ããé¢æ°ãæ¸ããã¨ãããã®ã§ã.flatten ã¨ããã®ã¯, â¦
ããã¯ã¹ã©ãã·ã¥ãå ¥å ãã¦, ç¡äº CocoaEmacs ãåãããã«ãªã£ãã, ã¾ããã¦ãåé¡ãâ¦â¦. ããã¯ã¹ã©ãã·ã¥ã JIS ãã¼ãã¼ãã§å ¥åã§ããªãâ¦â¦. C ã§æ¹è¡ã³ã¼ããåºåã§ããªãâ¦â¦. ä»ã¾ã§ã¯ "option + \" ã§å ¥åã§ãã¦ããã®ã, option ã Meta ãã¼ã«ãã¤â¦
ãã¦ä»¥åã®æ¥è¨ã§ CocoaEmacs ã®ãã«ããç¡äºã«çµãã£ã訳ã ã, æç« ãæ¸ãã¨ãªã㨠Emacs muse ã欲ãããªãã¾ã. 説æãã¦ããã¨, Emacs muse ã¨ããã®ã¯ wiki ã«ä¼¼ãè¨æ³ã§æç« ãè¨è¿°ã§ã, Emacs ä¸ã§ã¯æç« ãæ´å½¢ããã¦è¡¨ç¤ºããã¾ã. ã¾ã, html, xhtml,â¦
ããã¾ã§ã®æµã 以å CocoaEmacs ãã¤ã³ã¹ãã¼ã«ãããã¨ãã¦å¤±æã, ä¸å ã Aquamacs Emacs ãå ¥ãããã¨ã§åãã§ãã¾ãã. ããã, emacs muse ãã¤ã³ã¹ãã¼ã«ãã段ã«ãªã£ã¦, path ã«ã¹ãã¼ã¹ãå«ã¾ãã¦ãã¾ã£ã¦ãã("Aquamacs" 㨠"Emacs" ã®é)ãã¨ã§ã¤â¦
Snow Leopard ã«ãã¦ãã Carbon Emacs ã使ããå°ã£ã¦ãã. èµ·åãã¦ãããã«çµäºããã, Rosetta ã使ã£ã¦èµ·åãã¦ããã°ããããã¨è½ã¡ã¦ãã¾ã. 俺ã¯ã»ã¨ãã©ã®æç« ã®ä¸æ¸ãã Emacs ä¸ã§ãã£ã¦ããã, Emacs ãç¡ãçæ´»ããã¦ã¿ã¦ãEmacs ã£ã¦èº«ä½ã®ä¸â¦
iPod touch ãè²·ã£ãã, Mac mini ãæ°èª¿ãã¦, Snow Leopard ãå ¥ããã, ä¸ãã£ããã³ã·ã§ã³ã®å¢ã㧠iPhone ã¢ããªã®éçºããããã¨æãã¾ãã.ããããã®å¢ããåããã®ããã«, åãã¦ã®å®æ©ã¸ã®ã¤ã³ã¹ãã¼ã«ã¯æé ãåããã¥ããã£ãã§ã. ããã§èºããâ¦
éã«ã¤ã³ã¹ãã¼ã«ãæè¡ãã¾ãã. SafariStand ã使ããããããã«, Safari 㯠32bit èµ·åã ãã©, ããããåãã¦ã®éªè±¹ããã¯ã¦ãæ¸ãã¦ã¾ã. ãã¦ãã¦, ãããããããªãããããªãä½æ¥ãè²ã ã.
6æã« Mac mini ãæ°ããè²·ã£ãéã«, 980åã§æã«å ¥ããã¢ããã°ã¬ã¼ãçã® Snow Leopard ãéã«å®¶ã«æ¥ã¾ãã!8/28 ã«çãã®ãã¨æã£ã¦ããã, ãã®æ¥å±ããã¡ã¼ã«ã«ã¯ã8/28 çºé 9/2 é éäºå®ãã¨ã®æåãâ¦â¦orz mixi, Twitter, ããã°ãã®ä»ã§èµ·ããåã³ã®â¦
ãã®è¨äºãååã®è©±ãªã©ã§åå¨ã¯ç¥ã£ã¦ãã TopCoder. ä»æ¥, æãç«ã£ã¦ç»é²ãã¦ã¢ã«ã´ãªãºã é¨éã®ã¨ããã2åã»ã©è§£ãã¦ã¿ã. åé¡ã®è²ã¨ãã¦ã¯ Project Euler ã«è¿ãã£ãããããã®ã§, 楽ããããã . ã¾ã è¯ãåãã£ã¦ãªãã¨ããã¨ãã¦ã¯, 以ä¸ã®æã. jaâ¦
ãçã®ç´æ°( ã®ç´æ°ã®ãã¡ ããçã«å°ãããã®)ã®åè¨ã¨å®ç¾©ãã. ãã ã㤠ã§ãã ã®å ´å, 㨠ãåææ°ã¨å¼ã¶.ä¾ãã°, 220 ã®çã®ç´æ°ã¯ 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110 ãªã®ã§ . 284 ã®çã®ç´æ°ã¯ 1, 2, 4, 71, 142 ãªã®ã§ .10000 æªæºã®å ¨ã¦ã®â¦
以ä¸ã®ãããªæ å ±ãããã¾ã. ã¾ã, åèªã§èª¿æ»ãã¦ãè¯ãã§ããã. 1900å¹´1æ1æ¥ã¯æææ¥. å°ã®æã¯9æ, 4æ, 6æ, 11æ. æ®ãã¯2æãé¤ãã¦å¤§ã®æ. 2æã¯é常ã¯28æ¥ã ã, éå¹´ã§ã¯29æ¥. éå¹´ã¯, 4å¹´ã«1度ãã, 100å¹´ã«1度ã¯éå¹´ã§ãªããªã, ããã«400å¹´ã«1â¦
æ°åã®1ãã5ã¾ã§ãåèªã§æ¸ã㨠one, two, three, four, five ã¨ãªã, å ¨é¨ã§3+3+5+4+4=19æå使ã£ã¦ãã¾ã. ã§ã¯, 1ãã1000(one thousand)ã¾ã§ãåèªã§æ¸ãã¨ä½æå使ãã§ãããã?ã¡ã¢: ãã¤ãã³ã空ç½ã¯æ°ã«æ°ãã¾ãã. ä¾ãã°, 342 (three hundred andâ¦
æ£ã®æ´æ°ã®æ°åã以ä¸ã®å復è¦åã§å®ãããã¦ãã. . ä¸è¨ã®ã«ã¼ã«ã使ã£ã¦13ããå§ããã¨, 次ã®æ°åãå¾ããã. . ãã®æ°åã«ã¯(13ãã1ã¾ã§)10åã®æ°åãå«ã¾ãã¦ãã. ããã¯ã¾ã æªè§£æ±ºåé¡(Collatz åé¡)ãªã®ã ã, ã©ã®æ°åããå§ãã¦ã1ã«è¾¿ãçãã¨èâ¦
ãã£ã¹ã, æè¿åé¡ã解ãã¦ãããªãã£ãã, ããã°ãæ¸ãã¦ãªãã£ã(-_-; ã¤ãã¤ãä»äºã«ãã¾ãã¦, ã¨ã³ããªãæ¸ãæ°åãããã¾ããã§ããâ¦â¦.
ãã¼ãã¹ãå¾ ã£ã¦, æ°ãã Mac mini ãè²·ãã¾ãã. ãã¦, æã®ç°å¢ã移è¡ãããæ°ãã«ã¢ããªãå ¥ãããããä½æ¥ããã¾ããã, 次ããã¨ãã«è¿·ããªãããã«åå¿é². ããã¦ãã®è¨å®ãªã©ã¯ã移è¡ã¢ã·ã¹ã¿ã³ããã§ç§»è¡ã§ãã¦ãã®ã§, äºæ³ãã¦ããã楽ã«ç§»è¡ã§ãâ¦
5æ¡ã®æ° ã¯5ä¹æ°ã§ããã. åæ§ã«, 9æ¡ã®æ° ã9ä¹æ°ã§ãã.æ¡ã®æ°ã§ããã, ä¹æ°ã§ãããæ£ã®æ´æ°ã¯ããã¤ããã? http://projecteuler.net/index.php?section=problems&id=63 ããã¯æ°å¦ã§èå¯ãé²ããã ãã§è§£ãã¾ãã. ãã, ãè¨ç®ãã¦, çµäº.
ã§ãã. ã®ä¸10æ¡ãæ±ãã. http://projecteuler.net/index.php?section=problems&id=48 å®è£ èªä½ã¯ç°¡åã ã¨é«ãæ¬ã£ã¦ powMod é¢æ°ãä½ã£ã¦ã¿ãã, æ¡ããµãã«ä¸æã対å¦ã§ãã, çµå± gmp ããã®åãåãããã¨ã«ãã¾ãã. #include <stdio.h> #include <stdlib.h> #include "p</stdlib.h></stdio.h>â¦
ä¸å³ã®ä¸è§å½¢ã«ä¸¦ã¹ãããæ°åã®ä¸çªä¸ããã¹ã¿ã¼ããã¦, 1ã¤ä¸ã®è¡ã®é£æ¥ããæ°åã«ç§»åãã¦ãã£ãã¨ã, éã£ãæ°ã®åè¨ã®æ大å¤ã¯23. ã¤ã¾ã, . (訳注. å®ã¯, ã¨ããã«ã¼ãã§ãè¯ã.)ã§ã¯, 次ã®ä¸è§å½¢ã«ä¸¦ã¹ãããæ°åã®ä¸çªä¸ããä¸çªä¸ã¾ã§ã®åè¨ã®æ大â¦
ä¸è§æ°ãããªãæ°åã¯, èªç¶æ°ã次ã ã¨è¶³ãã¦ãããã¨ã§å¾ããã. 7çªç®ã®ä¸è§æ°ã¯ ã«ãªã. æ°åã®æåã®10é ã¯, ã¨ãªã.ä¸è§æ°ã®æåã®7é ã«ã¤ãã¦ç´æ°ãåæããã¨, ã¨ãªã. ãããã, 28 ãç´æ°ã®æ°ã5ãè¶ããæå°ã®ä¸è§æ°ã ã¨åãã.ã§ã¯, ç´æ°ã®æ°ã 5â¦
ããã¸ã§ã¯ãã»ãªã¤ã©ã¼ã®åé¡ã解ãé²ãã¦ã¯ããã®ã§ãã, ããã°ã«æ¸ãã®ãã¡ãã£ã¨ãµãã£ã¦ã¾ãã(^-^; ã¾ã¨ãã¦ã¨ã³ããªã«æ¸ãã¾ã.ã¡ãªã¿ã«, ãã®4åã解ãããã¨ã§è¨25å解ãããã¨ã«ãªã, ç¡äº Level1 ã«ãªãã¾ãã. ããããããã.
âãã®é ããå¾ ã¡ç¦ããã¦ãã, Safari 4 æ£å¼çãã¤ã³ã¹ãã¼ã«ãã¾ãã. http://d.hatena.ne.jp/cocoatomo/20090225/1235576351 http://d.hatena.ne.jp/cocoatomo/20090224/1235491357åã¿ããã«, Ajax çãªããã°ãã¼ãããã£ããããã¨ã¹ã¯ãã¼ã«ãåºã¾ã£â¦
145 ã¯èå³æ·±ãæ°åã§ãã. ãªããªã, ã¨ãªãããã§ãã. åæ¡ã®æ°åã®éä¹ã®åè¨ãèªèº«ã¨çãããªãæ°ã®åè¨ãæ±ãã. ãã ã, 㨠ã¯å«ã¾ãªã. http://projecteuler.net/index.php?section=problems&id=34 ãåé¡30ã¨åãããã. ããã°ã©ã ããã®ã¾ã¾ä½¿ãâ¦
é©ãã¹ããã¨ã«, åæ¡ã®æ°åã4ä¹ãã¦åè¨ããã¨å ã®æ°åã«ãªãæ°åã¯æ¬¡ã®3ã¤ã ãã§ãã. ãã ã, ã¯å«ã¾ãªã. ãããã®æ°ã®åè¨ã¯, .ã§ã¯, åæ¡ã®æ°åã5ä¹ãã¦åè¨ããã¨å ã®æ°åã«ãªãæ°åã®åè¨ãæ±ãã. http://projecteuler.net/index.php?section=proâ¦
ä»åã®ã¯ brute force (åå°½ã)ã§ãã. åé¡34ã§ã¯å±è¾±çãªãã¹ãç¯ã, å¹ãã§ããã¾ãorz
Fibonacci æ°åã¯å帰çãªé¢ä¿å¼ã«ãã£ã¦å®ç¾©ããã¦ãã. . å¾ã£ã¦, æåã®12åã¯, ã¨ãªã. 12çªç®ã® ãåãã¦3æ¡ã«ãªãæ°åã§ãã.ã§ã¯, åãã¦1000æ¡ã«ãªãã®ã¯ä½çªç®ã? http://projecteuler.net/index.php?section=problems&id=25 以åã®åé¡ (åé¡2æ¹ -â¦
é åã¯é åºãä»ããç©ã®ä¸¦ã¹æ¿ãã®ãã¨ã§ãã. ä¾ãã°, 3124 ã¨ããã®ã¯ 1, 2, 3, 4 ã¨ããæ°åã®é åã®ä¸ã¤ã§ãã. å ¨ã¦ã®é åãæ°åé ãããã¯ã¢ã«ãã¡ãããé ã«ä¸¦ãã§ããã¨ã, ããããè¾æ¸é (lexicographic order)ãã¨å¼ã¶. 0, 1, 2 ã®é åãè¾æ¸é ã«â¦
㯠ã¨ããæå³ã§ãã. ã®åæ¡ã®æ°åã®åè¨ãæ±ãã. http://projecteuler.net/index.php?section=problems&id=20 ãã, ã¾ãã§ãã, ããã§ãã. ãããªã« C ããããããã§ãã?? ãå©ãã¦ã, pari ãããã. Project Euler ãã¤ã¸ãããã. ãã¨åã³ pari/â¦
ã§ãã, ãã®åæ¡ã®æ°åã®åè¨ã¯ . ã§ã¯, ã®åæ¡ã®æ°åã®åè¨ã¯? http://projecteuler.net/index.php?section=problems&id=16 ã¨ã°ã, ã¨ã°ããã!! ã¾ããã¦ã, C ã®è¦æ㪠ULLONG_MAX ãè¶ããæ°ã®æä½ã§ãã!? ããã, ä»åã¯ã©ãèãã¦ãæ°å¦ã使ã£ãåâ¦
ä»åã¯ã©ã¤ãã©ãªãæ°å¦ã使ã£ããã®ãå¤ã, å®è£ èªä½ã¯æ¥½ã§ãã.