id:cho45 ããã§ãã£ã¨æ¸ããã³ã¼ãã話é¡ã«ãªã£ã¦ãã å¬éãã«æ¶ãè¡ãå¶æã¬ã¼ã«ã¯â夢ç©èªã«ãªã¢ã«ãæ±ããªãã - subtech ãã®ãããªæ¸ãæ¹ã¯ãèªåããã¾ã«ããã ã¨ããããã§ããã®æ¸ãæ¹ãããå©ç¹ã以ä¸ã®é ã«è§£èª¬ãã¦è¦ãã åç´ãª for æã®åé¡ç¹ with æã使ã£ã解決æ¹æ³ã¨ããã®å¾®å¦ãªåé¡ç¹ ç¡åé¢æ°ã使ã£ã解決æ¹æ³ åç´ãª for æã®åé¡ç¹ ã¾ãã¯ã以ä¸ã® HTML ã«å¯¾ã㦠<ul> <li>hoge</li> <li>fuga</li> <li>piyo</li> </ul> 以ä¸ã® JavaScript ãå®è¡ã㦠var list = document.querySelectorAll('ul > li'); for (var i = 0, len = list.length; i < len; i++) { var node = list[i]; v
é¢æ°å ããã°ãã¼ãã«å¤æ°ãè¨å®ãããå ´åã var global; (function(){ global = 42; })(); ã¨ããäºãã§ããã ãã ããã°ãã¼ãã«ä»¥å¤ã«ãåãååã®ç©ãããã¨ä½¿ããªãã var $; (function(){ $ = $; function $(id){ return document.getElementById(id); } })(); jQueryã®å ´åãã°ãã¼ãã«å¤æ°ããwindowã®ããããã£ã«ãªããã¨ãå©ç¨ãã¦ã (function(){ window.$ = $; function $(id){ return document.getElementById(id); } })(); ã®ããã«ãã¦ããã ãã®å ´åãGreasemonkeyãªã©ã®ããã«windowãã°ãã¼ãã«ã§ãªãå ´åãã¾ãåããªãã ä¾ãã°ãjQueryãGreasemo
ç©ãèªãã¦ãã£ãããµã¤ãã®Haskellããã°ã©ãã³ã° ãµã¤ãã®ããã°ã©ãã®ããã®é¢æ°åè¨èªå ¥éããèªãã ãã ãã©ã ãã®ä¸ã«ãã¤ã³ãããªã¼ã¹ã¿ã¤ã«ã¨ããã®ãæ¸ãã¦ãã£ãã®ã§ã åããããªäºãJavaScriptã§ãã§ããªãã試ãã¦ã¿ãã æ¬æ¸ã«ããã¨ããã¤ã³ãããªã¼ã¹ã¿ã¤ã«ã£ã¦ããã®ã¯é¢æ°ã§é¢æ°ã å®ç¾©ããªããããã°ã©ãã³ã°ãããã³ã¼ãã£ã³ã°ã¹ã¿ã¤ã«ã®äºã ããã ã è¦ã¯é¢æ°åæãå¼æ°ã®é¨åé©ç¨ãªã©ã«ããé«éé¢æ°ãè¿ããããªé¢æ°ãå®ç¾©ãã ãããå¼ã³åããªããããã°ã©ã ãæ¸ããã£ã¦ãã¨ã JavaScriptã¯é«éé¢æ°ãæ±ããã®ã§è¿ãäºã¯ã§ãããã ã å¼æ°ã®é¨åé©ç¨ ã¾ãã¯é¢æ°ãå¼æ°ã®é¨åé©ç¨ãã§ããããã«ãããã¤ã¾ãã«ãªã¼åã ãããããcurryé¢æ°ã«é¢æ°ã¨å¼æ°ã渡ãäºã§é¨åé©ç¨ãããé¢æ°ãè¿ãã¨ããæ¹æ³ã 㨠å度ãé¨åé©ç¨ããæã«ä½åº¦ãcurryé¢æ°ãå¼ã³åºãå¿ è¦ãããã ãããªé¢¨ã«
追è¨ï¼ã³ã¡ã³ããå ã«ã__proto__ã使ã£ãthisã®ã¨ãã¥ã¬ã¼ãããã£ã¦ã¿ããçµæ§ã·ã³ãã«ã§ããã åèï¼JavaScript ã®ã³ã³ã¹ãã©ã¯ã¿é¢æ° - å¬éãã«æ¶ãè¡ãå¶æã¬ã¼ã«ã¯â夢ç©èªã«ãªã¢ã«ãæ±ããªãã - subtech function defer(){ if(!(this instanceof defer)) return defer.apply({__proto__:defer.prototype},arguments); this.task=Array.slice(arguments); this.next(); return this; } defer.prototype.next=function(){ var self=this; this.arg=this.task.shift().call(this, function() self.next.call(s
MySQL UDFs offer a powerful way to extend the functionality of your MySQL database. The UDFs on this site are all free: free to use, free to distribute, free to modify and free of charge. Even for commercial projects. The UDF Repository for MySQL Welcome to the UDF Repository for MySQL! The UDF repository for MySQL is a community project that aims to offer an organized collection of open source My
è¿½è¨ â»ä»æ§ãå¤æ´ãã¾ããã JavaScriptã§å å 表è¨ãNewãã¼ã¸ã§ã³ haskellãErlangã«ãããããªãªã¹ãå å 表è¨ãç解ããçºã«ãã ã¾ã便å©ã£ã½ãã®ã§JavaScriptã§ã使ããããå®è£ ãã¦ã¿ãäºã«ããã å®è£ åã«æ¤ç´¢ãããã¦ã¿ãã¨æ¢ã«ããããäºãã£ã¦ã人ã¯ããã¿ããã ã JavaScriptã§ãªã¹ãã®å å 表è¨(ã®çä¼¼) | æ±äº¬å«å¦¬ ã¾ãç解ããçºã«ã¯å®è£ ãã¦ã¿ãã®ãä¸çªã£ã¦äºã§ãè»è¼ªã®åçºæãªãã¦æ°ã«ããªãã ããã«æ¢ã«éä¸ã¾ã§ãã£ã¦ããããã§ã¯ãã£ã¦ã¿ãã¼ã ã¤ã³ã¿ã¼ãã§ã¼ã¹ãã©ãããï¼ ã¾ãå å 表è¨ã®å解ããã [x | x <- [1,2,3,4,5,6], x < 4] ãããªæãã®è¨æ³ã§ã[1,2,3]ã¨ãããªã¹ãã¨ç価ã«ãªãã ãã®æ¸ãæ¹ã¯å ã ãæ°å¦ã®éåã®å®ç¾©ã表ç¾ããè¨æ³ã«ç±æ¥ãã¦ãããããã x <- [1,2,3,4,5,6]ã£ã¦ã®ã¯æ°å¦ã®å ´
All Things Pythonic Python main() functions by Guido van van Rossum May 16, 2003 Summary For Python programmers, I've got some suggestions on how to write a main() function that's easy to invoke in other contexts, e.g. from the interactive Python prompt when you feel like experimenting. I've written a few main() functions in my time. They usually have a structure roughly like this: """Module docst
以åããJavaScript ã§å¼æ°æç¸ãã«ããã¦é¢æ°ã®ã«ãªã¼åã試ã¿ã¾ãããããããããã§ã«ãªã¼åãããé¢æ°ã¯ããã®ã¾ã¾ã§ã¯ä¸åº¦ããé¨åé©ç¨ãã§ãããã¾ããæåã®é¢æ°å¼ã³åºãã¯å¿ ãé¨åé©ç¨ã¨ãã¦æ±ããã¦ãã¾ããã function mean3(a, b, c) { return (a + b + c) / 3; } // ãJavaScript ã§å¼æ°æç¸ãã«ããã curry é¢æ°ã var curriedMean3 = curry(mean3); curriedMean3(1)(2, 3); // => 2 curriedMean3(1)(2)(3); // => TypeError: curriedMean3(1)(2) is not a function // ãã®ã¾ã¾ã§ã¯é¨åé©ç¨ã 2 å以ä¸è¡ããªãã // curry(curriedMean3(1))(2)(3) ãªã大ä¸å¤«
Partially applying a function is a, particularly, interesting technique in which you can pre-fill-in arguments to a function before it is ever executed. In effect, partially applying a function returns a new function which you can call. This is best understood through an example: String.prototype.csv = String.prototype.split.partial(/,\s*/); var results = "John, Resig, Boston".csv(); alert( (resul
é©ãã¾ãããLLãéãã°æåãéãããã§ããªãã ãã¹ãã¹ã³ã¼ãã®å¤æ°ã«å¯¾ãã¦ä»£å ¥ã»åé¤ããæ©è½ã¯åå¨ããªã Effective Python ããã¼ãï¼ è©¦ãã¦ã¿ããæ¬å½ã«é§ç®ã§ããã def countfunc(): i = 0 def retfunc(): i += 1 return i return retfunc f = countfunc() print f() print f() print f() Traceback (most recent call last): File "???.py", line ?, in <module> print f() File "???.py", line ?, in retfunc i += 1 UnboundLocalError: local variable 'i' referenced before assignmentãããã¾
å¼ãç¶ãKanasan.JSã§åºã話é¡ã ECMAä»æ§ã®ææ³ãçºãã¦ã¿ã¦æ°ã¥ãããã¨ãæ¸ãã¦ã¿ã¾ãã ä»ã¾ã§ãæãæ¸ããæèã§ã¯æã«ãªããå¼ããæ¸ããªãæèã§ã¯å¼ã«ãªããã¨ãåæã«æã£ã¦ããã®ã§ãããã²ã©ã誤解ã§ããã function ãå¼ãæãã©ããã¯ï¼ãã®åãæã®ããããã©ããã§å¤æ ã¨ããã®ãå¾®å¦ã«éãã¾ãã ã¾ãéè¦ãªãã¨ãã²ã¨ã¤ã (ECMAScriptã®)ææ³ä¸ã¯ãfunctionæãªãã¦ãã®ã¯ç¡ãã§ãã*1 æ(statement)ã®å®ç¾©ãããããæ¸ãã¦ããã¾ããããã®ä¸ã«é¢æ°å®ç¾©ãè¡ãæã¯ããã¾ããã ãããé¢æ°å®ç¾©ã¯ã©ãå®ãããã¦ãããã¨ããã¨ããããã¬ãã«ãè¦ã㨠ããã°ã©ã = SourceElementã®ãªã¹ã SourceElement = æ(Statement) or é¢æ°å®£è¨(FunctionDeclaration) ã¨ãªã£ã¦ãã¾ãããã¨é¢æ°ã®bodyãã
ãããªãµãã«æ¸ããããã«ãªãã ãã® tz.$F_list ã使ã£ã¦ãä¾ãã° var Sequence= tz.$F_list.$struct({ _call_next: function(obj,next,args){ var self= this; setTimeout( function(){ // é¢æ°ãå®è¡ãã¦ãæ»ãå¤ãã次ãã«æ¸¡ã // next(obj.apply(this,args)); ã§ãåã self.$super._call_next(obj,next,args); },this.interval()); }, interval: function(){ return 500; } }); ã®ãããªãªãã¸ã§ã¯ããç¨æãã¦ããã°ã var $n=111; var fn= Sequence.from( function f1(i){ console.log(i); //
ç¡åé¢æ°ãããªã使ãããããªãã¾ãããé«éé¢æ°ã®ãããªè¨è¿°ãã§ãã¾ãã ãã¨ãã°ãããã®çµæ㯠<?php function($func){ $func('Hello, Anonymous World!'); }(function(){ return function($str){ echo $str, PHP_EOL; }; }()); ãããªãã¾ãã Hello, Anonymous World!æ¿ãã使ããã®ã§ãè±èªã®å£ãä¹ãè¶ãã¦php.internalsã«æããããªã£ã¦ãã¾ããã ãã¹ã¦ã®å¤æ´ç¹ã¯ä»¥ä¸ã®éãã§ãã åãç¡åé¢æ°ãè¿ãã¹ãã¼ãã¡ã³ããè¤æ°åå®è¡ã§ããªãåé¡ãä¿®æ£ã ç¡åé¢æ°ã®çæã¯ã³ã³ãã¤ã«æã®1åã ããªã®ã§ã«ã¼ãä¸ã«æ¸ãã¦ãcreate_functionã®ããã«ã¡ã¢ãªã浪費ããªãã ç¡åé¢æ°ãç´æ¥ã³ã¼ã«ã§ããããã«æ¹è¯ã JavaScriptã®ç¡åé¢æ°ã®ããã«ä½¿ã
Opera 9.5 ã§ã¯ getter setter ã使ããããã«ãªãã¾ãã http://my.opera.com/desktopteam/blog/kestrel-is-coming 㧠Safari 3 ã§ã使ããã試ãã¦ã¿ããã»ã»ã» alert({ get x() { return 'ok' } }.x); // ok ã¤ã使ããï¼ Firefox ã§ã ããªãåãã getter setter ã使ãã ã¨ããäºã¯ã»ã»ã» IE 以å¤ã§ getter setter ã使ããã®ã¯ããããã ï¼ï¼ï¼ IE ã«ãããªãããããã£ãä»ã®ãã©ã¦ã¶ã§å®è£ ãããã¨ãã§ããããã«ãªãï¼ï¼ ãã¨ãã°ããããªæãï¼ // âæ¡ä»¶ä»ãã³ã³ãã¤ã« /*@cc_on @if (@_jscript) @else @*/ if (!('returnValue' in Event.prototype)) { Ev
Pythonæ¨æºããã¥ã¡ã³ãã®ãemail.Utils éç¨ã¦ã¼ãã£ãªãã£ããçºãã¦ãã¦ããããã便å©ãªé¢æ°ããããã¨ã«æ°ãä»ãã¾ããã parseaddrã¡ã¼ã«ã¢ãã¬ã¹ã®å®åé¨åã¨ã¡ã¼ã«ã¢ãã¬ã¹é¨åãåãåºãé¢æ°ã >>> from email.Utils import parseaddr >>> parseaddr('spam ') ('spam', '[email protected]') åããã¨ãããé¢æ°ãèªåã§æ¸ãã¦ããã®ã§ãä»å¾ã¯ãã¡ãã使ãããã¨ããã§ãã formatdateRFC 2822å½¢å¼ã®æ¥ä»ãæååã§è¿ãé¢æ°ããªãã·ã§ã³ã®å¼æ°usegmt=Trueã使ãã¨ãã¿ã¤ã ã¾ã¼ã³ã-0000ã®å½¢å¼ã§ã¯ãªããGMTã§è¿ãã®ã§ãHTTPãããã¼ã§ä½¿ãã®ã«ä¾¿å©ããã§ãã >>> from email.Utils import formatdate >>> formatdate()
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}