åå¤å±Scala Hackathonã«è¡ã£ã¦ãã
å®å»éãã«éå§
ç¶ããèªãã®ã¼ã¯ãã¼ã«è¡ã£ã¦ãã
ä»åã¯ï¼JVM ã«ã¤ãã¦èª¿ã¹ã¦ããï¼
- http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html
- http://jasmin.sourceforge.net/ - jasmin (JVM ç¨ã® Assembler)
hello.j
.class public hello
.super java/lang/Object.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method.method public static main([Ljava/lang/String;)V
.limit stack 2
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc "Hello, World!"
invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
return
.end method
ã¡ãã£ã¨çé¢ç®ã«æ¸ãã¨ãããªæã
public class hello extends java.lang.Object { public void hello() { super(); } public static void main(java.lang.String[] args) { java.io.PrintStream p = java.lang.System.out; java.lang.String s = "Hello, World!"; p.println(s); } }ç¶ããèªã
ã®ã¼ã¯ãã¼ã«è¡ã£ã¦ãã
ã¨ãããã¨ã§ï¼pir ã§ãï¼
# parrot hello.pir.sub main
say "Hello, World!"
.end
ãªãã ããï¼ãªãã
ç¶ããèªãåå¤å±ã®ã¼ã¯ãã¼ã«è¡ã£ã¦ãã
麻éåã§ãã
ã¨ããããï¼Perl6 ã®Nagoya.pm ã§ãã£ã¦ãç¶ããããï¼
å¿
è¦ãªæ©è½ã¯ï¼ãã¹ããã調ã¹ãï¼ãã¨ã¯ããã£ãã®ã§
æ®éã®ããã°ã©ãã³ã°ã§å¿
è¦ãªãã¨ãèããï¼
ä»ã¯é ãã®ããªãã¨ããããã®ã§ï¼ãããã¡ã¤ã©ããªï¼ãããï¼
docs/dev/profiling.pod - Profiling Parrot
# Copyright (C) 2001-2005, Parrot Foundation. =head1 NAME docs/dev/profiling.pod - Profiling Parrot =head1 DESCRIPTION ãã®ãã¡ã¤ã«ã¯ï¼Parrot ã®ãããã¡ã¤ãªã³ã°å®è¡é¨åã®ä½¿ç¨æ¹æ³ã«ã¤ãã¦è¨è¿°ãã¦ããï¼ =head2 Summary ãããã¡ã¤ã«å®è¡ç°å¢ã¯ï¼Parrot ã®ä¸é¨ã¨ãã¦ä½ããã¦ããï¼PIRã³ã¼ãã®ããã«ããã¯ãçºè¦ã§ããããã«è¨è¨ããã¦ãã¾ãï¼HLL(ï¼)ãããã¡ã¤ã«ããµãã¼ãããããã«å®è£ ããã¦ãã¾ããï¼ç¾å¨ã§ã¯å¶éãããã¾ãï¼C<parrot>ãã¤ããªã£ã« C<-Rprofiling> ã C<--runcore profiling>ã渡ããã¨ã§ï¼ã³ã¼ãã¯ãããã¡ã¤ãªã³ã°å®è¡ç°å¢ä¸ã§å®è¡ããã¾ãï¼åºåãã¡ã¤ã«ã®ä½ç½®ã¨ãã©ã¼ãããã¯ï¼æ¬¡ã«è¨è¿°ãããããã«ç°å¢å¤æ°ã«ãã£ã¦æ±ºå®ããã¾ãï¼ãããã¡ã¤ãªã³ã°å®è¡ç°å¢ãé¢é£ããç°å¢å¤æ°ãçºè¦ã§ããªãå ´åã¯ï¼æ¬¡ã§æ¸ããããããªããã©ã«ãå¤ã使ãã¾ãï¼ =head2 ç°å¢å¤æ° =over 4 =item C<PARROT_PROFILING_FILENAME> ããããã°ï¼åºåãæ¸ããããã¡ã¤ã«ã®å®å ¨ãªååã決å®ãã¾ãï¼Parrot ã¯ï¼æ¸ãããã«éãåã«ãã¡ã¤ã«åãåå¨ãããã©ããããã§ãã¯ãããï¼ä»¥åã®ãããã¡ã¤ã«ãå«ãæ¢åã®ãã¡ã¤ã«ãå¶ç¶ã«ãä¸æ¸ããã¦ãã¾ãã§ãããï¼ å¤ãè¨å®ããã¦ããªããã°ï¼Parrot ã¯ãã¡ã¤ã«ãC<parrot.pprof.X> ã«æ¸ãåºãã¾ãï¼ããã§ï¼X ã¯Parrot ããã»ã¹ã®PID ã§ãï¼ãããã¡ã¤ãªã³ã°å®è¡é¨åãåå¨ããå ´åï¼ãããã¡ã¤ã«ãæ¸ãããã¨ãã«ã¢ãã¦ã³ã¹ããã¡ãã»ã¼ã¸ãåºåãã¾ãï¼ ãã®å¤æ°ã¯ï¼C<stdout> ã C<stderr> ã¨ããç¹æ®ãªå¤ãæã¤ãã¨ãã§ãã¾ãï¼ãããã®å¤ã®ã©ã¡ããã(大æåå°æåã«é¢ä¿ç¡ã) è¦ã¤ãã£ãå ´åï¼Parrot ã¯ãããã¡ã¤ãªã³ã°ã®çµæãstdout ã stderr ã«åºåãã¾ãï¼ =item C<PARROT_PROFILING_OUTPUT> ããã¯ï¼ãããã¡ã¤ã«ãå«ãåºåã®ã¿ã¤ãã決å®ãã¾ãï¼ç¾å¨ã®ãªãã·ã§ã³ã¯ï¼C<pprof> 㨠C<none>ã§ãï¼C<pprof> ã¯ï¼ããã©ã«ãã§ããï¼ASCII æåã§ããããï¼äººéãèªãããããªå½¢å¼ã§ãï¼ããã¯ï¼tools/dev/pprof2cg.pl ã«ãã£ã¦å¾å¦çãã¦ï¼Callgrind äºæã®ãã©ã¼ãããã«å¤æã§ãã¾ãï¼C<none> ã¯ï¼çµæãã¡ã¤ã«ãæ¸ãåºãã¾ããï¼ããã¯ï¼ä¸»ã«ãããã¡ã¤ãªã³ã°ã®å®è¡é¨åèªèº«ã®ãã¹ããæé©åã«ã¨ã£ã¦æç¨ã§ãï¼ããã¯ï¼PIR ã¨HLL ã³ã¼ãããããã¡ã¤ã«ãããã¦ã¼ã¶ã«ã¨ã£ã¦ãã¾ãæå³ããªããã¨ãæå¾ ããã¦ãã¾ãï¼ =item C<PARROT_PROFILING_ANNOTATIONS> ããã¯ï¼PIR ã¢ããã¼ã·ã§ã³ããããã¡ã¤ã«ã®ä¸é¨ã¨ãã¦è¨é²ãããããã«è¨å®ãã¾ãï¼ã¢ããã¼ã·ã§ã³ã¯ï¼HLL ã³ã¼ãããããã¡ã¤ãªã³ã°ããã®ã«å¿ è¦ã§ããï¼ãããã¡ã¤ãªã³ã°ã®å®è¡é¨åãããé ããã¾ãï¼ããã©ã«ãã§ã¯ï¼ãããã¯ç¡å¹ã§ãï¼ããããæå¹ã«ããããã«ï¼ãã®å¤ãè¨å®ãã¾ãï¼ =item C<PARROT_PROFILING_CANONICAL_OUPUT> ãããè¨å®ããã¦ããå ´åï¼ãããã¡ã¤ãªã³ã°ã®å®è¡é¨åã¯ï¼å ¨ã¦ã®ã¢ãã¬ã¹ã1ã¤ã®å®æ°å¤ã¨ãã¦ï¼å ¨ã¦ã®æå»ã1ã¨ãã¦è¨é²ãã¾ãï¼ãã®ãªãã·ã§ã³ã¯ï¼ä¸ããããã³ã¼ãã®é¨åã常ã«åããããã¡ã¤ã«ãæ£ç¢ºã«çæãããã¨ãä¿è¨¼ããæ¹æ³ãããã¨ä¾¿å©ãªå ´æï¼ä¸»ã«ãã¹ãç¨ã«ä¾¿å©ã§ãï¼ãã®æ©è½ãæå¹ã«ãããå ´åï¼å¤åã©ã³ãã ãªããã·ã¥ã·ã¼ãã«èµ·å ããé決å®çãªæ¯èããé¿ããããã« C<--hash-seed 1324> ã使ã£ã¦Parrot ã«ç¹å®ã®ããã·ã¥ã·ã¼ãã渡ãããã¨æãã§ãããï¼ ãã®å¤æ°ã¯ãã¹ãããããã¡ã¤ãªã³ã°ã®å®è¡é¨åããé¢ãã¦ã¯æç¨ã§ã¯ããã¾ããï¼ããã¦ã¦ã¼ã¶ã®ã³ã¼ãã®ãããã¹ããããè¦ã¤ããããã«æ®ã©ç¢ºå®ã«å©ãã«ããªãã¾ããï¼ =back =cut
ã¤ã¾ãï¼C
ã§ï¼ããè¦ãã¨
$ parrot -Rprofiling <workdir>/rakudo-star-2011.07/install/lib/parrot/3.6.0/languages/perl6/perl6.pbc <scriptname> $ perl <workdir>/rakudo-star-2011.07/install/lib/parrot/3.6.0/tools/dev/pprof2cg.pl parrot.pprof.XX
pprof2cg.pl ã¯ï¼Callgrind-compatible äºæãã¡ã¤ã«ãåºåãããããã®ã§
valgrind ãã¤ã³ã¹ãã¼ã«ãããã©ï¼ããããcallgrind ã®ãã¡ã¤ã«è¦ãã®ã¯ï¼
kcachegrind ã ã£ãâ¦
$ sudo brew install --HEAD valgrind # Lion ã ã¨head ãã対å¿ãã¦ãªãã£ã
$ sudo brew install qt --with-qt3support $ rehash $ wget http://kcachegrind.sourceforge.net/kcachegrind-0.7.0.tar.gz $ tar xf kcachegrind-0.7.0.tar.gz $ cd kcachegrind-0.7.0/qcachegrind $ qmake $ make $ ./qcachegrind.app/Contents/MacOS/qcachegrind
ãã㧠parrot.out.$PID ãã¡ã¤ã«ãèªãã¾ãï¼
ãåè
ã§è¦ã¦ã¿ããã ãã©ï¼
ããã¯ï¼Perl6;Perl6Role;ACCEPTS(Role.pir) ã«æéãããã£ã¦ããã§ãããï¼
次ã¯pir ãèªãæµãï¼
PEG ãè¦ãã¨ãããã¤ããé ãã
- 10/22 valgrand ã®è¾ºã追è¨
DevQuiz åçããã - webgame
åºæ¬ã¹ã©ã¤ãããºã«ãããããã¨ã¯ããã£ã¦ããã©ï¼
ããã¦webgame ã«ãã¦ã¿ãï¼
ç¡é§ã«jQuery ã使ã£ã¦ã¾ãï¼
ããã¯ï¼åçãæ¸ãã¦ããããããã使ã£ãæãã§ãï¼
body ããåããã°request ãæ¸ãã®ã§éããªããããªã
ã¨ãããã¨ã§ï¼èª°ãæãã¦ãã ããï¼
Nagoya.pm #01 ãããã¾ãã
ニューキャストããã¨ãã§ï¼
Nagoya.pm#01 ãéå¬ãã¾ããï¼
ãªãã¹ã質åããããããã«ãããã¨æã£ã¦ãã£ã¦ã¿ããã©
ã©ãã ã£ãããªï¼
- DotCloud ほんのさわり - @issm
- Perl åå¿è åã - @clairvy
- use v6; - @clairvy
- âââ 㧠Perl - @babydaemons
- Windows 㧠Perl - @trinityCRZ
éå¬ãã¦ã¿ãã°ï¼2人ã§ããå±
ãªãããã¨æãããï¼
æå¤ã«ãé æ¹ããæ¥ã¦ãã ããæ¹ããããï¼
æéãä½ã£ã¡ããããããªããã¨æã£ã¦ãã®ã§ããã©ï¼
é£ã³å
¥ãããã£ãããã¦ï¼åå è
ã®ã¿ãªãã¾ã«æè¬ã§ãï¼
ã§ï¼ä»å¾ãªãã§ããã©ï¼11æã«ç¬¬2åãéå¬ãããæãã§ãï¼
ãã¨çºè¡¨è
ãåéä¸ãªã®ã§ï¼ä½ãããã°é£çµ¡ãã¦ãã ããï¼
次åã¯ï¼Apache ã®è¨å®ã®è©±ãããã¨ãï¼Git ã®è©±ãããã¨ãè¨ããã¦ã¾ãï¼
Nagoya.pm ã®ææ¥ã¯ã©ã£ã¡ã ï¼
symfony 1ç³»ã§ã«ãã¬ãã¸ãã ã
ãã®ã¨ã³ããªã¯å¿åé²çãªæãã§ãï¼
æ¬å½ã¯éãã¨ããã®èª¿æ»ããããã£ãã®ã ã£ãï¼
symfony 1ç³»ã§ã¯ï¼ãã¹ãã®ã«ãã¬ãã¸ãåºãã¿ã¹ã¯ããããã ãã©ï¼
Jenkins ã§è¦ãããã©ã¼ããããããªãæãï¼
㧠rsPHPUnitLimePlugin ã£ã¦ã®ããã£ã¦ãããªã«ãã¦ããããããï¼
ã¨ããããå ¥ãã¦ã¿ã*1
$ git submodule add https://github.com/digitalkaoz/rsPHPUnitLimePlugin.git plugins/rsPHPUnitLimePlugin $ vi config/ProjectConfiguration.class.php $ git diff diff --git a/config/ProjectConfiguration.class.php b/config/ProjectConfiguration.class.php index 24e9ec0..d1cf7e5 100644 --- a/config/ProjectConfiguration.class.php +++ b/config/ProjectConfiguration.class.php @@ -8,5 +8,6 @@ class ProjectConfiguration extends sfProjectConfiguration public function setup() { $this->enablePlugins('sfDoctrinePlugin'); + $this->enablePlugins('rsPHPUnitLimePlugin'); } }
PHP_CodeCoverage ãè¦æ±ãããã®ã§å
¥ããï¼
ãã©PHP 5.2.6 ã使ã£ã¦ããé¢åã ã£ãï¼*2
PHP_CodeCoverage ã¨ãã®plugin ã5.2.7 ãè¦æ±ãã¦ããã®ã§
æåã§å
¥ãããã¨ããããåãã¦ãã¿ããï¼
ãã¨class redefine ã¨ãè¨ãããã®ã§ä¿®æ£
$ pear channel-discover pear.phpunit.de $ cd ~/work $ git clone https://github.com/sebastianbergmann/php-code-coverage.git $ git clone https://github.com/sebastianbergmann/php-token-stream.git $ cd /usr/lib/php $ mkdir PHP $ cd PHP $ ln -s ~/work/php-code-coverage/PHP/* . $ ln -s ~/work/php-token-stream/PHP/* . $ pear install phpunit/File_Iterator $ pear install phpunit/PHP_TokenStream $ pear install phpunit/PHPUnit $ pear install phpunit/Text_Template $ cp PHPUnit/Framework.php{,.org} $ vi PHPUnit/Frameworkk.php $ diff PHPUnit/Framework.php{.org,} 61c61 < require 'PHPUnit/Framework/TestListener.php'; --- > require_once 'PHPUnit/Framework/TestListener.php';
ããã§Jenkins ã®CloverPHP plugin ããè¦ããããã«ãªã£ãï¼
ããã ã¨rsPHPUnitLimePlugin ã®coverage ãåºã¡ãã£ã¦é¢ç½ããªãã®ã§ç¡å¹ã«ãããã¨ããï¼
2011-08-13 追è¨
lib/test/LimeCodeCoverage.php ã®$blackList ãç·¨éããã°ãããã ãã©
config ã¨ãã§å®ç¾©ã§ããããã«ãã¦ããããæ°ããããã©ã¾ã ãã£ã¦ãªãæãï¼