2009-02-01ãã1ã¶æéã®è¨äºä¸è¦§
ã¡ã³ããã³ã¹ä¸ã®å ´åãã¨ã©ã¼ãã¹ãã¼ããããã«ä¿®æ£ãã¾ããã ãã¨ãã¦ã¼ã¶ã¼å/ãã¹ã¯ã¼ãã®åç §å ããµã³ãã«å ã§å®ç¾©ãã¦ããå®æ°ã«ãªã£ã¦ããã®ã§ãããä¿®æ£ãã¦ãã¾ããorz. âGithub - unageanu / clickclient_scrapä¼æ¥ã«ããä½ããªãã®ã«åææ¥ãé«â¦
çºæ³¨æ©è½ãå®è£ ãããã¨ãã¦ããã¯ãHttpClinetã§POSTããããWWW::Mechanizeã使ã£ãã»ãã楽ããã ãªã¨ããçµè«ã«è³ã£ããããå ¨é¢çã«WWW::Mechanizeã使ã£ã¦æ¸ãç´ãã¾ãããâGithub - unageanu / clickclient_scrapæ¢åã®æ©è½ã¯åä½ããã¯ãã§ãã $: <â¦
ããã°ã©ã ã«ãã¹ã¯ã¼ãã渡ãã¦ãããå¿ è¦ãããå ´åãå¼æ°ã§æå®ããã®ã¯å±éºã ãããã¨ãããã¨ã§å¯¾è©±å¼ã§ãã¹ã¯ã¼ããè¨å®ã§ããããã«ããããæ¹ã調æ»ãHighlineã¨ããã©ã¤ãã©ãªã使ãã¨ç°¡åã¿ãããâHatena Question - Rubyã§ã¦ã¼ã¶ã¼ããã®ãã¹ã¯ã¼â¦
Sprite#hitAreaã§ãã¹ãã©ã¤ãã®ãããå¤å®ã§ä½¿ãé åãæå®ã§ãã¾ãã é åã¯å¥ã®ã¹ãã©ã¤ãã§æå®ãã¾ãã hitAreaã¨ããã¹ãã©ã¤ãã¯é表示ã§ãOK package { import flash.display.*; import flash.events.MouseEvent; import flash.text.*; // å¥ã®ã¹ãâ¦
Power Shellã§ãæ£è¦è¡¨ç¾ã使ãã¾ãã æ£è¦è¡¨ç¾ã«ããããããè©ä¾¡ããã ã-matchãæ¼ç®åã使ãã¾ãã PS C:\> "abc" -match "^a" True PS C:\> "xbc" -match "^a" False å¾æ¹åç § å¾æ¹åç §ç¨ã®æååã¯ãèªåå¤æ°ã$Matchesãã«æ ¼ç´ããã¾ããã$Matches[â¦
Javaã§ã§ããçã¯ãªãã¨ããªãã¦ããã£ã¦ãã¾ãããã´ã¡ã³ããµã¤ãåçãã¦ã¾ãã System.out.println( "KuroShiroTora".replaceAll( "([A-Z][a-z]+)", "$1," ) ); System.out.println( "KuroShiroTora".replaceFirst( "([A-Z][a-z]+)", "$1," ) ); å®è¡çµæâ¦
[Eclipseã®gitãã©ã°ã¤ã³ãegitãã§ãã¦ã¼ã¶ã¼ãã¼ã ã®ã.gitconfigããã¡ããã¨èªã¿è¾¼ãã§ããã¾ãã Vistaã ã¨ä»¥ä¸ã®ãã¹ãªãã¾ãã \Users\<ã¦ã¼ã¶ã¼å>\.gitconfig Gitã®ã¦ã¼ã¶ã¼åãã¡ã¼ã«ã¢ãã¬ã¹ãæ¸ãã¦ããã¨ã³ãããæã«ã¡ããã¨åæ ãã¦ããã¾ãâ¦
ã¬ã¼ãä¸è¦§ã®åå¾ãå®è£ ãã¾ããã âGithub - unageanu / clickclient_scrap åééãã¢ã®bidã¬ã¼ããaskã¬ã¼ããããã³ã¹ã¯ãããåå¾å¯è½ã§ãã APIã¯ClickClientã¨ãããã¦ãã¾ããããã¡ãã®ã¬ã¼ãä¸è¦§ã§åå¾ã§ãã¦ããbid_highãbid_lowãªã©ã¯åå¾ã§ãâ¦
以ä¸ã®ã³ãã³ãã®çµæãã¿ã¦ãããã¼ã«ã«å¤æ°ã¯ã¹ã¯ãªãããããã¯å ã§ãã¢ã¯ã»ã¹å¯è½ãªãã ãªãã¨èªèãã¦ããã®ã§ããã PS C:\> function call( $proc ) { &$proc } PS C:\> $a = 100 PS C:\> call { echo $a } 100$aã«å¤ãä»£å ¥ããã¨ãæå¾ ã¨ç°ãªãçµæâ¦
æ¨æ¥æ¸ããInjectã§Mapãããã¨ãããã§ããã PS C:\> Inject 1,2,3 @() { $args[0] += $args[1]*2; $args[0] } 12é åã渡ããã¯ããªã®ã«ããªããIntã«å¤æããã¨ã!ã©ã£ãã§æé»ã®åå¤æãè¡ãªããã¦ããã£ã½ããªã¼ãã¨æã£ã¦åãåºåããã³ã¼ãã追å ã â¦
rubyã§ãã使ãInjecté¢æ°ãæ¸ãã¦ã¿ã¾ãããé åã®ã¡ã½ããã§ã¯ãªãããã ã®é¢æ°ã§ããã function Inject( $enumerable, $init, $proc ) { foreach ($i in $enumerable ) { $init = &$proc $init $i } return $init }å®è¡çµæã§ãã PS C:\> Inject 1,2,3 â¦
Power Shellã®é¢æ°ãå¼ã³åºãå ´åãå¼æ°ã®ã()ãã¯ä¸è¦(æ£ç¢ºã«ã¯ä½¿ãããã©è§£æã¢ã¼ãåæ¿ã®æå³ã«ãªã)ã§ããã PS C:\> function Pow( $x, $y ) { [System.Math]::Pow($x,$y) } PS C:\> Pow 2 5 32 PS C:\> Pow 2, 5 "Pow" ã®å¼æ° "0" (å¤ "System.Object[â¦
ã-borãæ¼ç®åã使ãã¾ããã|ããããªãã®ã§æ³¨æãª! PS C:\> $a = 0x001 PS C:\> $a = $a -bor 0x002 PS C:\> echo $a 3以ä¸ã¯å ¨ã¦å¤ãã§ãã PS C:\> $a = 0x001 PS C:\> echo $a 1 PS C:\> $a |= 0x002 ç¨èª '=' ã¯ãã³ãã³ãã¬ãããé¢æ°ãæä½å¯è½ãªãâ¦
ã¹ã¯ã¬ã¤ãã³ã°ã§ã®ãã°ã¤ã³ã»ãã°ã¢ã¦ãã¾ã§å®è£ ãã½ã¼ã¹ã¯ä»¥ä¸ãâGithub - unageanu / clickclient_scrap Githubã«ç½®ãã¦ã¿ã¾ãããgemspecã¯ã¾ã ã¡ããã¨æ¸ãã¦ãªãã®ã§gemçµç±ã§ã®ã¤ã³ã¹ãã¼ã«ã¯ã§ãã¾ããã ãµã³ãã« ãã°ã¤ã³/ãã°ã¢ã¦ãã®ãµã³ãã«ã³â¦
egitã¨ããEclipseã§ä½¿ããGitãã©ã°ã¤ã³ããããã¨ãããã¨ã§ã¤ã³ã¹ãã¼ã«ãã¦ã¿ã¾ãããã½ã¼ã¹ãåå¾ãã¦ã³ã³ãã¤ã«ãå¿ è¦ã§ãã¡ãã£ã¨ããã©ããããã§ãããazlab éçºMemo - Eclipseãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ããã®æé ã«å¾ã£ã¦ç¹ã«åé¡ãªãã¤ã³ã¹ãã¼â¦
Arrays#deepEquals()ã§é åè¦ç´ ã®å帰çãªæ¯è¼ãã§ãã¾ãã Object a = new Object(); Object b = new Object(); Object c = new Object(); // é å System.out.println( Arrays.deepEquals( new Object[] {a,b}, new Object[] {a,b} )); // true System.outâ¦
@IT - .NET TIPS CSVãã¡ã¤ã«ãèªã¿è¾¼ãã«ã¯ï¼ãåèã«ãPowerShellã§CSVãã¡ã¤ã«ã解æããé¢æ°ãæ¸ãã¾ããã å¼æ°ã®ãã¡ã¤ã«ããMicrosoft.VisualBasic.FileIO.TextFieldParserãã§è§£æãã¦ã åè¡ãã¹ã¯ãªãããããã¯(proc)ã«ã³ã¼ã«ããã¯ãã¾ãã [Sysâ¦
ã¹ã¯ã¬ã¤ãã³ã°ã§ãã°ã¤ã³ã¾ã§ã¯ä½ã¨ãã§ããã£ã½ããå æ¥ãã©ã¤ãã¦ä¸æããã£ã¦ããªãã£ãåå ã¯ããsubmitãã¿ã³ã«nameã¨valueãããå ´åããã®å¤ããµã¼ãã¼ã«éä»ããããã¨ããã®ãç¥ãããã¹ã«ã¼ãã¦ããããã§ãããsubmitãªãã¦å ¨é¨åãã ã¨æã£ã¦ãâ¦
ãSystem.Environmentãã®å¤ãåç §ããã°OK PS C:\>[System.Environment]::MachineName | echo foo.comããã«ãã¦ãããã¾ã ã« PS C:\>echo [System.Environment]::MachineName [System.Environment]::MachineNameã¨ããã£ã¦ãã¾ãããªããªãæ £ããªãã
æ£è¦è¡¨ç¾ã使ãã¨ããã"ax" =~ /([a-z])x/ãã®ããã«æååã左辺ãæ£è¦è¡¨ç¾ãå³è¾ºã«ãã¦ããã®ã ãã©ãéã«ãã¦ãåããªãã ãªããã¨ãæ£è¦è¡¨ç¾ã左辺ã®å ´åãã===ãã§ããããã³ã°ããã§ãã¯ã§ããã # æååã左辺ã puts "ax" =~ /([a-z])x/ puts $1 â¦
HttpClient#debug_devã«STDOUTãªã©ãè¨å®ãã¦ããã¨ãéä¿¡å 容ãåºåãã¦ããã¾ãã require 'rubygems' require 'httpclient' client = HTTPClient.new client.debug_dev=STDOUT #ãããã¯ãã¼ã¿ã®åºåå ã¨ãã¦ãSTDOUTããè¨å® client.get_content( "http:â¦
ã¯ãªãã¯è¨¼å¸Webãµã¼ãã¹ãæä¾çµäºã«ãªã£ãããã§ãã âã¯ãªãã¯è¨¼å¸ Webãµã¼ãã¹ãããã§ClickClientãæµ·ã®è»å±ã«ã»ã»ã»ããµã³ãã«ã³ã¼ãããã£ã±ãæ¸ããã®ã«ã¼ã(ã¾ãããã¢ãã¬ã¼ãã®æ¹ã§ã¯ã¾ã 使ããã¿ããã§ããã»ã»ã»)ã¬ã¼ãã®åå¾ããåãå¼ãã¾ã§â¦
çµã¿è¾¼ã¿é¢æ°ãcallerãã®çµæã解æããã°å¯è½ã§ãã # å¼ã³åºããã¨ã®é¢æ°åãåå¾ããé¢æ° def function_name # æ£è¦è¡¨ç¾ã¯ãRubyã®ãªãã¡ã¬ã³ã¹ã®ãã®ãæåãã¦ã¾ãã if /^(.+?):(\d+)(?::in `(.*)')?/ =~ caller.first return $3 end end # ãã¹ãç¨â¦
Power Shellã§ã¯ãã{}ãã§æ¬ã£ãä¸é£ã®å¦çããã¹ã¯ãªãããããã¯ãã¨ãã¦ãå¤æ°ã«æ ¼ç´ãããã¨ãã§ãã¾ããæ ¼ç´ããå¦çã¯ãã&ãã¨ãã¦ãä»»æã®ã¿ã¤ãã³ã¯ã§å¼ã³åºããã¨ãå¯è½ã§ãã PS C:\> $proc = { echo "aaa" } # ã¹ã¯ãªãããããã¯ãä½æãã¦å¤â¦
ä»æ¥ã®ã¸ã¾ã PS C:\> function Join( $str1, $str2 ) { return "${str1}:${str2}" } PS C:\> Join( "aaa", "bbb" ) | echo aaa bbb: # ãã? "aaa:bbb"ã«ãªãããºãªãã ã? PS C:\> Join "aaa", "bbb" | echo aaa bbb: # ãã?Power Shellã§ã¯ãã«ã³ãã§åºâ¦
Power Shellã§ã¯ãã"ãã§æ¬ãããæååå ã®å¤æ°ã¯ãèªåçã«å±éããã¾ãã PS F:\> $name = "foo" PS F:\> echo "My Name is $name" My Name is fooæ©è½çã«ã¯ããRubyã¿ããã«"#{}"ã§å²ãå¿ è¦ãªããã ã¼ãã¸ã¼ããã¨ããã ããªãã§ãããããã«ã¡ãã£ã¨â¦
Power Shellã®ã¹ã¯ãªãã解æã«ã¯ããã³ãã³ãã¢ã¼ããã¨ãå¼ã¢ã¼ãããããã¾ãã å¼ã¢ã¼ã ã¹ã¯ãªããããæä¸ä½ã¬ãã«è¨èªã¨ãã¦è§£æããã¾ãã ã2+2ããã"aaa"ããªã©ã¯å¼ã¨ãã¦(ä¸è¬çãªæè¦ãããã¦æ®éã«)è©ä¾¡ããã¾ãã ã³ãã³ãã¢ã¼ã ã·ã§ã«å ã§â¦
ClickClientã使ã£ã¦ç´å®çµæã®ä¸è¦§ãåå¾ãããµã³ãã«ã§ãã ãæ°è¦æ³¨æã,ã決æ¸æ³¨æãã®ç´å®çµæãããããåå¾ã§ãã¾ãã çµè¾¼ã¿æ¡ä»¶ã¨ãã¦ä»¥ä¸ãæå®å¯è½ã§ãã ã決æ¸æ¥ã ããã¬ã¼ã種å¥ã .. æ°è¦(ClickClient::FX::TRADE_TYPE_NEW) or 決æ¸(ClickClâ¦