[git] presentations.git branch master updated. b6e89c2

From: Date: Thu, 23 Feb 2012 21:53:59 +0000
Subject: [git] presentations.git branch master updated. b6e89c2
Groups: php.pres 
Request: Send a blank email to pres+get-1778@lists.php.net to get a copy of this message
The branch, master on presentations.git has been updated via b6e89c21a63bbb713946c931ea89abcc0507fa07 (commit) from 7f5d9d5ddb33d57a8ed490d0706cbc6cc10020b2 (commit) http://git.php.net/?p=presentations.git;a=log;h=b6e89c21a63bbb713946c931ea89abcc0507fa07;hp=7f5d9d5ddb33d57a8ed490d0706cbc6cc10020b2 Summary of changes: phpuk2012.xml | 24 +++---------- slides/intro/2012.xml | 2 +- slides/intro/2012_title.xml | 4 ++ slides/intro/api_yql3.xml | 2 +- slides/intro/ecosystem.xml | 7 ++-- slides/intro/hashdos2.xml | 51 ++++++++++++++------------ slides/intro/hashdos3.xml | 21 ++++++++--- slides/intro/{hashdos2.xml => hashdos4.xml} | 6 +-- slides/intro/{hashdos3.xml => hashdos5.xml} | 0 slides/intro/php54_arraywarn.xml | 28 +++++++++++++++ slides/intro/php54_misc.xml | 5 ++- slides/intro/svm.xml | 11 ++++++ 12 files changed, 102 insertions(+), 59 deletions(-) create mode 100644 slides/intro/2012_title.xml copy slides/intro/{hashdos2.xml => hashdos4.xml} (87%) copy slides/intro/{hashdos3.xml => hashdos5.xml} (100%) create mode 100644 slides/intro/svm.xml -- Log ---------------------------------------- commit b6e89c21a63bbb713946c931ea89abcc0507fa07 Author: Rasmus Lerdorf <rasmus@php.net> Date: Thu Feb 23 21:45:03 2012 +0000 Tweaks and new slides diff --git a/phpuk2012.xml b/phpuk2012.xml index 835fbfe..423062b 100644 --- a/phpuk2012.xml +++ b/phpuk2012.xml @@ -39,29 +39,15 @@ Performance <slide>slides/intro/api_yql3.xml</slide> <slide>slides/intro/api_yql4.xml</slide> -<slide>slides/intro/2012.xml</slide> +<slide>slides/intro/2012_title.xml</slide> <slide>slides/intro/hashdos1.xml</slide> <slide>slides/intro/hashdos2.xml</slide> <slide>slides/intro/hashdos3.xml</slide> +<slide>slides/intro/hashdos4.xml</slide> +<slide>slides/intro/hashdos5.xml</slide> +<slide>slides/intro/eventmq.xml</slide> +<slide>slides/intro/svm.xml</slide> -<slide>slides/intro/php53_title.xml</slide> -<slide>slides/intro/php53_perf.xml</slide> -<slide>slides/intro/php53_closures1.xml</slide> -<slide>slides/intro/php53_closures2.xml</slide> -<slide>slides/intro/php53_closures3.xml</slide> -<slide>slides/intro/php53_closures4.xml</slide> -<slide>slides/intro/php53_namespaces.xml</slide> -<slide>slides/intro/php53_lsb.xml</slide> -<slide>slides/intro/php53_gc.xml</slide> -<slide>slides/intro/php53_nowdoc.xml</slide> -<slide>slides/intro/php53_goto.xml</slide> -<slide>slides/intro/php53_tern.xml</slide> -<slide>slides/intro/php53_dir.xml</slide> -<slide>slides/intro/php53_callstatic.xml</slide> -<slide>slides/intro/php53_dynamicstatic.xml</slide> -<slide>slides/intro/php53_date.xml</slide> -<slide>slides/intro/php53_spl.xml</slide> -<slide>slides/intro/php53_fpm.xml</slide> <slide>slides/intro/php54_title.xml</slide> <slide>slides/intro/php54_perf.xml</slide> <slide>slides/intro/php54_removed.xml</slide> diff --git a/slides/intro/2012.xml b/slides/intro/2012.xml index d57a01f..405e927 100644 --- a/slides/intro/2012.xml +++ b/slides/intro/2012.xml @@ -6,7 +6,7 @@ <item fontsize="2.5em">PHP 5.4</item> <item fontsize="2.5em">0 Failed tests</item> <item fontsize="2.5em">Gearman worker management support in PHP-FPM</item> -<item fontsize="2.5em">SVM</item> +<item fontsize="2.5em">Support Vector Machine (SVM)</item> <item fontsize="2.5em">PHP libevent</item> <item fontsize="2.5em">ZeroMQ</item> </list> diff --git a/slides/intro/2012_title.xml b/slides/intro/2012_title.xml new file mode 100644 index 0000000..8886137 --- /dev/null +++ b/slides/intro/2012_title.xml @@ -0,0 +1,4 @@ +<slide title=""> +<break lines="12"/> +<blurb fontsize="20em" align="center">2012</blurb> +</slide> diff --git a/slides/intro/api_yql3.xml b/slides/intro/api_yql3.xml index 9e0a006..6ca92bb 100644 --- a/slides/intro/api_yql3.xml +++ b/slides/intro/api_yql3.xml @@ -3,7 +3,7 @@ <example result="0" hide="0" fontsize="1.4em"><![CDATA[<?php include 'yql.php'; -$q = "SELECT * FROM flickr.photos.search(100) WHERE tags='$loc' +$q = "SELECT * FROM flickr.photos.search(100) WHERE tags=':-:location:-:' AND sort='interestingness-desc' AND api_key='$api_key'"; foreach(yql($q)->results->photo as $p) echo '<img src="'.furl($p,'m').'">';]]></example> diff --git a/slides/intro/ecosystem.xml b/slides/intro/ecosystem.xml index bb01345..21bead9 100644 --- a/slides/intro/ecosystem.xml +++ b/slides/intro/ecosystem.xml @@ -9,10 +9,11 @@ <break lines="1"/> -<blurb fontsize="6em">Scale down</blurb> +<blurb fontsize="6em">Scale</blurb> <list> -<bullet fontsize="3em" marginleft="2em" type="none">Scaling up is easy</bullet> -<bullet fontsize="3em" marginleft="2em" type="none">Scaling down is hard</bullet> +<bullet fontsize="3em" marginleft="2em" type="none">Scaling up is expected</bullet> +<bullet fontsize="3em" marginleft="2em" type="none">Scaling down is surprisingly hard</bullet> +<bullet fontsize="3em" marginleft="2em" type="none">Doing both is rocket science</bullet> </list> </slide> diff --git a/slides/intro/hashdos2.xml b/slides/intro/hashdos2.xml index 23fdd6e..6e7dc45 100644 --- a/slides/intro/hashdos2.xml +++ b/slides/intro/hashdos2.xml @@ -1,28 +1,31 @@ -<slide title="HashDoS"> +<slide title="DJBX33A"> -<blurb fontsize="4em">Creating Hash Collisions</blurb> +<example result="0" hide="0" type="C" fontsize="1.4em"><![CDATA[static inline ulong zend_inline_hash_func(const char *arKey, uint nKeyLength) +{ + register ulong hash = 5381; -<example fontsize="2em" result='0' title=""><![CDATA[ -POST http://example.com/ HTTP/1.0 + /* variant with the hash unrolled eight times */ + for (; nKeyLength >= 8; nKeyLength -= 8) { + hash = ((hash << 5) + hash) + *arKey++; + hash = ((hash << 5) + hash) + *arKey++; + hash = ((hash << 5) + hash) + *arKey++; + hash = ((hash << 5) + hash) + *arKey++; + hash = ((hash << 5) + hash) + *arKey++; + hash = ((hash << 5) + hash) + *arKey++; + hash = ((hash << 5) + hash) + *arKey++; + hash = ((hash << 5) + hash) + *arKey++; + } + switch (nKeyLength) { + case 7: hash = ((hash << 5) + hash) + *arKey++; + case 6: hash = ((hash << 5) + hash) + *arKey++; + case 5: hash = ((hash << 5) + hash) + *arKey++; + case 4: hash = ((hash << 5) + hash) + *arKey++; + case 3: hash = ((hash << 5) + hash) + *arKey++; + case 2: hash = ((hash << 5) + hash) + *arKey++; + case 1: hash = ((hash << 5) + hash) + *arKey++; break; + case 0: break; + } + return hash; +}]]></example> -1024=&2048=&3072=&4096=&5120=&6144=&7168=&8192= -&9216=&10240=&11264=&12288=&13312=&14336=&15360= -&16384=&17408=&18432=&19456=&20480=&21504=&22528= -&23552=&24576=&25600=&26624=&27648=&28672=&29696= -&30720=&31744=&32768=&33792=&34816=&35840=&36864= -&37888=&38912=&39936=&40960=&41984=&43008=&44032= -&45056=&46080=&47104=&48128=&49152=&50176=&51200= -&52224=&53248=&54272=&55296=&56320=&57344=&58368= -&59392=&60416=&61440=&62464=&63488=&64512=&65536= -&66560=&67584=&68608=&69632=&70656=&71680=&72704= -&73728=&74752=&75776=&76800=&77824=&78848=&79872= -&80896=&81920=&82944=&83968=&84992=&86016=&87040= -&88064=&89088=&90112=&91136=&92160=&93184=&94208= -&95232=&96256=&97280=&98304=&99328=&100352=&101376= -... -]]></example> - -<image filename="hash_coll.png" align="left" marginleft="6em" clear="left"/> - -<break lines="1"/> </slide> diff --git a/slides/intro/hashdos3.xml b/slides/intro/hashdos3.xml index 8282463..3648bb1 100644 --- a/slides/intro/hashdos3.xml +++ b/slides/intro/hashdos3.xml @@ -1,10 +1,19 @@ <slide title="HashDoS"> -<blurb fontsize="4em">Prevention</blurb> -<blurb>Randomized hashing, but there are complications</blurb> -<blurb>For now, limit the damage</blurb> -<break lines="1" /> +<blurb fontsize="4em">Creating Hash Collisions</blurb> + +<example result="1" hide="0" fontsize="1.4em"><![CDATA[<?php +function djbx33a($key, $len) { + $hash = 5381; + for($i=0; $i < $len; $i++) { + $hash = $hash * 33 + chr($key[$i]); + } + return $hash . "<br>\n"; +} + +echo djbx33a('1024',4); +echo djbx33a('2048',4); +echo djbx33a('3072',4); +]]></example> -<blurb>In PHP 5.3.10 and higher we have:</blurb> -<example fontsize="2em" result='0' title=""><![CDATA[max_input_vars=1000]]></example> </slide> diff --git a/slides/intro/hashdos2.xml b/slides/intro/hashdos4.xml similarity index 87% copy from slides/intro/hashdos2.xml copy to slides/intro/hashdos4.xml index 23fdd6e..83a9810 100644 --- a/slides/intro/hashdos2.xml +++ b/slides/intro/hashdos4.xml @@ -1,8 +1,6 @@ <slide title="HashDoS"> -<blurb fontsize="4em">Creating Hash Collisions</blurb> - -<example fontsize="2em" result='0' title=""><![CDATA[ +<example fontsize="2em" result='0' title="The Denial of Service attack"><![CDATA[ POST http://example.com/ HTTP/1.0 1024=&2048=&3072=&4096=&5120=&6144=&7168=&8192= @@ -24,5 +22,5 @@ POST http://example.com/ HTTP/1.0 <image filename="hash_coll.png" align="left" marginleft="6em" clear="left"/> -<break lines="1"/> +<break lines="2"/> </slide> diff --git a/slides/intro/hashdos3.xml b/slides/intro/hashdos5.xml similarity index 100% copy from slides/intro/hashdos3.xml copy to slides/intro/hashdos5.xml diff --git a/slides/intro/php54_arraywarn.xml b/slides/intro/php54_arraywarn.xml index bd293c1..a3d4ac0 100644 --- a/slides/intro/php54_arraywarn.xml +++ b/slides/intro/php54_arraywarn.xml @@ -6,4 +6,32 @@ error_reporting(-1); $a = [1,2,3]; echo $a;]]></example> +<break lines="1"/> + +<example fontsize="2em" result='1' title="Careful"><![CDATA[<?php +$a = [1,2,3]; +$b = [3,4,5]; +print_r(array_intersect($a,$b));]]></example> + +<break lines="1"/> + +<example fontsize="2em" result='1' title=""><![CDATA[<?php +$a = [1,2,[3]]; +$b = [[3],4,5]; +print_r(array_intersect($a,$b));]]></example> + +<break lines="1"/> + +<example fontsize="2em" result='1' title=""><![CDATA[<?php +$a = [1,2,[3]]; +$b = [[999],4,5]; +print_r(array_intersect($a,$b));]]></example> + +<break lines="1"/> + +<example fontsize="2em" result='1' title=""><![CDATA[<?php +$a = [1,2,[3]]; +$b = ['Array',4,5]; +print_r(array_intersect($a,$b));]]></example> + </slide> diff --git a/slides/intro/php54_misc.xml b/slides/intro/php54_misc.xml index 88e3c08..8a976a3 100644 --- a/slides/intro/php54_misc.xml +++ b/slides/intro/php54_misc.xml @@ -1,6 +1,9 @@ <slide title="Miscellaneous"> -<break lines="2"/> +<break lines="2" /> +<blurb fontsize="4em">PHP 5.4: The new bits Davey Shafik Friday 12:00 - 13:00</blurb> + +<break lines="1"/> <blurb fontsize="4em">New Output API (internal code cleanup)</blurb> <break lines="1" /> diff --git a/slides/intro/svm.xml b/slides/intro/svm.xml new file mode 100644 index 0000000..0186978 --- /dev/null +++ b/slides/intro/svm.xml @@ -0,0 +1,11 @@ +<slide title="Support Vector Machine (SVM)"> + +<blurb fontsize="4em">Fast Machine Learning - http://php.net/svm</blurb> + +<example result="0" hide="0" fontsize="1.4em"><![CDATA[<?php +$svm = new svm(); +$model = $svm->train('./data.scale'); +echo $model->predict($vectors); +]]></example> + +</slide> Thank you for your contribution.

« previous php.pres (#1778) next »