2007-09-01ãã1ã¶æéã®è¨äºä¸è¦§
C++ã§ã¯"+"ã"-"ã¨ãã£ãæ¼ç®åã®ãªã¼ãã¼ãã¼ããå¯è½ã§ããããã使ãã¨ä»¥ä¸ã®ãããªãªãã¸ã§ã¯ãå士ã®è¶³ãç®ãå¼ãç®ã®åä½ãè¦å®ãããã¨ãã§ãã¾ãã Kitten *mii = new Kitten(); Kitten *tora = new Kitten(); *mii + tora; // ãªãã¸ã§ã¯ãå士ã足â¦
ãªãã¸ã§ã¯ããåçå¤æ°ã«ãããã¨ãã§ã¾ãã åçå¤æ°ãªã®ã§newæ¼ç®åã使ç¨ãã¾ãã ãnew (å¼æ°..)ãã§ãã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ãåçå¤æ°ã¨ãã¦ä½æããããã®ãã¤ã³ã¿ãè¿ããã¾ãã ãã®ã¨ãã¯ã©ã¹ã®ã³ã³ã¹ãã©ã¯ã¿ãå®è¡ããã¾ãã ä¸è¦ã«ãªã£ãå¤æ°ã¯â¦
ææããããã£ã話ã ãã¹ãã±ã¼ã¹ãä½ãã¨ãã«ãããç®ã«ãªã£ã¦ããçµã¿åãããæ¢ãã¦ã足ãç®ã«ãªãããã«ç´ãã¨ãã¹ããã¿ã¼ã³ãæ¸ãããã¨ãã§ãã¾ãã ä¾ãããç®ã«ãªã£ã¦ããçµã¿åããã 以ä¸ã®æ©è½ãæã¤é¢æ°ãããã¨ãã¾ãã(ã¡ãã£ã¨ç¡çç¢çã£â¦
java.io.SequenceInputStreamã使ãã¨ãè¤æ°ã®ã¹ããªã¼ã ãé£çµãã¦1ã¤ã®ã¹ããªã¼ã ã¨ãã¦æ±ããã¨ãã§ãã¾ãã ã¹ããªã¼ã ãèªã¿ãæå¾ã¾ã§èªã¿è¾¼ãã ã次ã®ã¹ããªã¼ã ãèªã¿ã¾ãã(ãã®ã¨ããèªã¿çµããã¹ããªã¼ã ã¯é 次close()ãããããã§ãã) Sequenceâ¦
Javassistã使ãã¨ãå®è¡æã®ã¯ã©ã¹æ¡å¼µ(ã³ã³ãã¤ã«æ¸ã¿ã®ã¯ã©ã¹ãJavaããã°ã©ã å®è¡æã«æ¹å¤ããã¡ã½ããã«å¦çã追å ãããããã£ã¼ã«ãã追å ããããããã¨ã)ãã§ãã¾ãã以ä¸ã¯ç°¡åãªãµã³ãã«ã¨ã¯ã¾ã£ãã¨ããã«ã¤ãã¦ã®ã¡ã¢ã§ãã ç°¡åãªãµã³ãã« "câ¦
ä»æ¥ã¯ã¾ã£ãã¨ããã Seasar2ã§ã¯ãServletå ã§èµ·åããThreadããSessionã¹ã³ã¼ãã®ã³ã³ãã¼ãã³ããå©ç¨ã§ãã¾ããã(Seasar2.3.22ã§ç¢ºèªã) åå HttpSessionã®åå¾å ã§ããHttpServletRequestãThreadLocalã§ä¿æãã¦ããã®ãåå ãServletãå®è¡ããThâ¦
Canvasã使ã£ã¦åå²ãããç»åãé 延ãã¼ãããã³ã³ããã¼ã«ã試ä½ãã¦ã¿ã¾ãããGoogle Mapã®å°å³è¡¨ç¤ºé¨åã¿ãããªãã¤ã§ãã æ©è½ åå²ãããç»åã®ãã¡ã表示ãããé¨åã®ã¿ããã¦ã³ãã¼ããã¦è¡¨ç¤ºãã¾ããæ®ãã®ç»åã¯ããããå¿ è¦ã«ãªã£ãã¨ãã«ãã¦ã³â¦
Canvasã使ã£ã¦ä½ã£ãã¢ãã¡ã¼ã·ã§ã³ã§ããã¡ãã£ã¨ãã¢ã¤ãè¦ã¦ã¿ãã ä»çµã¿ ã¿ã¤ãã¼ãä»è¾¼ãã§å®æçã«ãã£ã³ãã¹ãæ´æ°ã æ´æ°ãã¨ã«ãã£ã³ãã¹ã¯ã¯ãªã¢ãã¦ã1ããåæç»ãã¦ãã¾ãã(座æ¨ãå¤ãã¦ç»åãå¼µãã ãã ãã©ã) ãã¬ã¼ã ã¬ã¼ãã¯24æ/secãâ¦
newæ¼ç®åã§åçå¤æ°ãçæã§ãã¾ããåçå¤æ°ã使ãã¨ãããã°ã©ã ã§å¿ è¦ã«ãªã£ãæã«åçã«ã¡ã¢ãªã確ä¿ãããã¨ãã§ãã¾ãã(é常ã¯ã¹ã¿ãã¯é åã«ç¢ºä¿ãããã¡ã¢ãªãããã¼ãé åã«ç¢ºä¿ããã¨è§£éã) ãnew ;ãã§ã¡ã¢ãªã確ä¿ãããã®ãã¤ã³ã¿ãè¿ãã â¦
ExplorerCanvasã使ãã¨IEã§Canvasã使ããããã«ãªãã¾ãã(via PHPSPOTéçºæ¥èª-IEã§JavaScriptã®Canvasãå©ç¨ããããã®ã©ã¤ãã©ãªãExplorerCanvasã) excanvas.jsããã¦ã³ãã¼ããã¦ã¤ã³ãã¼ãããã ãã§OKã 注: Canvasã¯ãã¼ã¸ã®ãã¼ãå®äºå¾ã«å¼ã³åºâ¦
FirefoxãSafariã§ä½¿ããã¨ããCanvasè¦ç´ ã使ã£ã¦ãçµµãæãã¾ããã ããã使ãã¨åããæãç·ãããã¸ã§æ²ç·ãããHTMLä¸ã§æããã¨ãã§ãã¾ãããã ãã対å¿ãããã©ã¦ã¶ãéããã¦ãã¦ãã¨ããããIEã§ã¯åããªããããã åºæ¬çãªä½¿ãæ¹ canvasã®åºæ¬â¦
ã ãã¶åã«æ¸ããããªãã¸ã§ã¯ãæ¯è¼ã¦ã¼ãã£ãªãã£ã使ã£ã¦ãã¾ãã以ä¸ã¯ãµã³ãã«ã class Kitten { // ãã£ã¼ã«ã private String name; private int age; private Kitten[] friends; public boolean equals ( Object obj ) { if ( obj == null ) { returâ¦
Servletã«ã¢ã¯ã»ã¹ãã¦ããã¯ã©ã¤ã¢ã³ãã®IPã¢ãã¬ã¹ãå¾ãæ¹æ³ã ãããã·ãä»ããªãå ´å ServletRequest#getRemoteAddr()ã§ãã¢ã¯ã»ã¹ãã¦ããã¯ã©ã¤ã¢ã³ãã®IPã¢ãã¬ã¹ãåå¾ã§ãã¾ãã ServletRequest request = .. çç¥ .. // ã¯ã©ã¤ã¢ã³ãã®IPã¢ãã¬ã¹â¦
å®è£ ãæããªãä»®æ³é¢æ°(ç´ç²ä»®æ³é¢æ°ã¨å¼ã°ãã)ãæã¤ã¯ã©ã¹ããæ½è±¡ã¯ã©ã¹ã«ãªãã¾ãã ç´ç²ä»®æ³é¢æ°ã¯æ´¾çã¯ã©ã¹ã§å¿ ãå®è£ ããªããã°ãªããªãé¢æ°ã§ãã(Javaã®abstracté¢æ°ã¨åã) ä»®æ³é¢æ°ã®ãããã¿ã¤ã宣è¨ã§ã=0;ããã¤ããã¨ãç´ç²ä»®æ³é¢æ°ã«ãªãâ¦
å¤æ æ§(ããªã¢ã¼ãã£ãºã )ã«ã¤ãã¦ãC++ã§ã¯æ¬¡ã®ãããªæé ã«ãªãã¾ãã 親ã¯ã©ã¹ã®ãã¤ã³ã¿ã«æ´¾çã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ã®ãã¤ã³ã¿ãä»£å ¥ã Javaã¨åãã§ããã 親ã¯ã©ã¹ã®ã¡ã½ãããå®è¡âæ´¾çã¯ã©ã¹ã§ãªã¼ãã¼ã©ã¤ãããã¡ã½ãããå®è¡ãããã ãã®ã¨ããâ¦
ç¶æ¿ã®ã¤ã¥ããã¡ã½ããã¨ã³ã³ã¹ãã©ã¯ã¿ã®ãªã¼ãã¼ã©ã¤ãã«ã¤ãã¦ã ã¡ã½ããã®ãªã¼ãã¼ã©ã¤ã æ®éã«ã§ãã¾ããç¹ã«æ¸ããã¨ãªãããªã¼ãã¼ã©ã¤ããã親ã¯ã©ã¹ã®ã¡ã½ãããå¼ã³åºãã«ã¯ã::ããã¤ãã¾ããJavaã®ãsuper.ãã®ãããã®ã #include <iostream> // 親ã¯</iostream>â¦
æã¯ã¾ã£ãç½ ã«ã¤ãã¦ã è¤æ°ã®ã¯ã©ã¹ãã¼ãã¼ã§åãã¯ã©ã¹ãèªã¿è¾¼ãã å ´åã"å¥ã®ã¯ã©ã¹"ã«ãªãã¾ããstaticå¤æ°ãå¥ç©æ±ãããã®ãããã·ã³ã°ã«ãã³ãªã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ãè¤æ°ã§ããããã¾ãã ä¾ ããããã·ã³ã°ã«ãã³ã¯ã©ã¹ãprivateãªstaticå¤æ°ã«â¦
ã¡ã¢ãªãææãã¦OutOfMemoryErrorãã¹ãã¼ãã&ã¹ãã¼ããããç¶æ ãä½ãã¦ã¼ãã£ãªãã£ã§ãããã¹ãç¨ã«ä½ãã¾ããã hold()ã§OutOfMemoryErrorãçºçããã¾ã§ã¡ã¢ãªãææããOutOfMemoryErrorãã¹ãã¼ãã¾ãã ã¹ãã¼ããå¾ãã¡ã¢ãªã¯ææãããç¶æ ã®ã¾â¦
Modelã®æ´æ°ããªã¹ã³ããã§ä½ã£ããªã¹ãç»é²ã¦ã¼ãã¤ãªãã£ãDIã³ã³ããã§ä½¿ããããã«ãã¦ã¿ã¾ããã DIã³ã³ããã«ç»é²ãããé¢é£ã¥ãæ å ±ã«å¾ã£ã¦ãã³ã³ãã¼ãã³ãã«ãªã¹ããè¨å®ãã¾ãã ã¦ã¼ãã£ãªãã£ã¯EagerSingletonãªã®ã§ç»é²ããã ãã§OK 以ä¸ã¯ãµâ¦
以åä½æããJavaScriptã§åãDIã³ã³ããã«ãã£ããæ©è½ã追å ãã¦ããã®ã§å ¬éãã¦ã¿ã¾ãã æ°æ©è½ã¯æ¬¡ã®3ã¤ã§ãã ã³ã³ãã¼ãã³ãå®ç¾©ãåæããAPIã®è¿½å ã é¢æ°å®è¡çµæã®ã¤ã³ã¸ã§ã¯ã·ã§ã³ããµãã¼ãã EagerSingletonã¹ã³ã¼ã ã³ã³ãã¼ãã³ãå®ç¾©ã®åæâ¦
ãã¡ã¤ã«/ãã£ã¬ã¯ããªãå帰çã«åé¤ããé¢æ°ã§ãã File.delete()ã使ã£ã¦åé¤ãã¾ãã åå¨ããã«ããããããFile.delete()ã§åé¤ã§ããªãã£ãå ´åãdeleteOnExit()ãè¨å®ãã¦VMçµäºæã«åé¤ã試ã¿ã¾ãã ãã¤ã¬ã¯ããªã¯ãä¸ã«ãã¡ã¤ã«ãããã¨åé¤ã§ãâ¦
ä»æ¥ã¯ã¯ã©ã¹ã®ç¶æ¿ã§ããç¶æ¿ã®å®£è¨ãããç¶æ¿ããã¡ã½ããã»ãã£ã¼ã«ãã®ã¢ã¯ã»ã¹å¶å¾¡ã¾ã§ã ç¶æ¿ã®å®£è¨ 以ä¸ã®å½¢å¼ã§æ¸ãã¾ãã class <æ´¾çã¯ã©ã¹å> : [<ç¶æ¿ä¿®é£¾å>] <親ã¯ã©ã¹å> { ... }; ç°¡åãªãµã³ãã«ã #include <iostream> // 親ã¯ã©ã¹ class Animal { pr</iostream>â¦
ã¯ã©ã¹ãå®ç¾©ãã¦ã¿ã¾ãã ã¯ã©ã¹ ãclass { .. };ãã®å½¢å¼ã§æ¸ãã¾ãã æ«å°¾ã«";"ãå¿ è¦ãªã®ã§æ³¨æã ã³ã³ã¹ãã©ã¯ã¿ ã¯ã©ã¹åã¨åãååã®publicé¢æ°ãã³ã³ã¹ãã©ã¯ã¿ã«ãªãã¾ãã Javaã¨åããæ»ãå¤ã¯æã¡ã¾ããã ãªã¼ãã¼ãã¼ãå¯è½ã§ãã ãã¹ãã©ã¯â¦
C++ã®æååã¯charã®é åã§ãã ãchar str[] = "hoge";ãã§ç°¡åã«åæåå¯è½ã§ãã æååãå¼æ°ã¨ãã¦æ¸¡ãå ´åããã¤ã³ã¿ãæå®ãã¦åç §æ¸¡ãã¨ãã¾ãã(é åãªã®ã§å½ããåã¨ããã°å½ããåã) ãstd::cout ãã®ããæååé·+1ã®é åã¨ãã¦ãæå¾ã«"\0"ãâ¦
Getter,Setterãå©ç¨ããã¨ãã.ãã§ããããã£ã«ã¢ã¯ã»ã¹ããéã«ãæå®ããé¢æ°ãå®è¡ãããããã«ãªãã¾ãã注æ:ãã ããIEã§ã¯åä½ãã¾ããã function Kitten( name ) { this._name = name; } // Getter, Setterã®è¨å® // ããããã£åã¨é¢æ°ãæå®ãâ¦
é åã®ååã¯ãé åã®å é è¦ç´ ã®ã¢ãã¬ã¹ãæãã¾ããããããã¤ã³ã¿å¤æ°ã«ä»£å ¥ããã¤ã³ã¯ãªã¡ã³ããã¦ãããã¨ã§ãé åã®åæãã§ãã¾ãã #include <iostream> int main() { int array[] = { 100, 200, 300 }; // ãã¤ã³ã¿å¤æ°ã®å®£è¨ int *pointer; // ãã¤ã³ã¿å¤æ°</iostream>â¦
Yahoo! UI Libraryã®Connection Managerã使ãã¨XHRã§éåæãã¡ã¤ã«ã¢ãããã¼ããå¯è½ã§ãã ã¢ãããã¼ããããã¡ã¤ã«ãé¸æãããã©ã¼ã ãç¨æããConnection Managerã«é¢é£ä»ãã¾ãã ãã©ã¼ã ã¯å¿ é ã§ããã¾ããã¢ãããã¼ããããã¡ã¤ã«ã¯ã¦ã¼ã¶ã¼ãâ¦
ãBookmarksãã¯ãã¿ã°ãã°ã«ã¼ãåãã¦æ´çã§ãããã¯ã¦ãªããã¯ãã¼ã¯-ããã³ãã¨ã³ãã§ãã ç¹å¾´ ã¿ã°ã»ããã§ã®ã¿ã°ã®ã°ã«ã¼ãå é¢é£ããã¿ã°ãã°ã«ã¼ãåãã¦ã¿ã°ã»ãããä½æã ã¿ã°ã»ããããã¿ã°ãæ¢ããã¨ã§ãé¢ä¿ã®ãªãã¿ã°ãæé¤ãããå¹çããâ¦
ãã¤ã³ã¿ã¯å¤æ°ã®ãã¢ãã¬ã¹ããè¨é²ããå¤æ°ã§ãã ãã¤ã³ã¿å¤æ°ã«ã¯ããã¡ã¢ãªä¸ã§ã®å¤æ°ã®ä½ç½®(å ´æ)ããæ ¼ç´ããã¾ãã ãã¤ã³ã¿åç §æ¼ç®åã§ããã¤ã³ã¿ããããããæã示ãå¤æ°ã®å¤ããåå¾ã§ãã¾ãã ãããå©ç¨ãã¦ãå¤æ°ã«å¥åãã¤ãããã¨ãã§ãã¾â¦