com presentations: Added phpDay, IPC and phpsummit talks.: extensions-phpday12.xml mongo-phpsummit.xml profiling-ipc2012s.xml
slides/internals/extensions.dia slides/internals/extensions.dia~ slides/internals/extensions.png slides/internals/functions.xml
slides/internals/overview.xml slides/internals/pecl.xml slides/internals/why-wrapping-libs.xml slides/mongodb/mongougs.xml
slides/profiling/timing-points.xml slides/time/date-parse-from-format2.xm
| From: | Derick Rethans | Date: | Wed, 30 May 2012 21:51:48 +0000 |
| Subject: | com presentations: Added phpDay, IPC and phpsummit talks.: extensions-phpday12.xml mongo-phpsummit.xml profiling-ipc2012s.xml slides/internals/extensions.dia slides/internals/extensions.dia~ slides/internals/extensions.png slides/internals/functions.xml slides/internals/overview.xml slides/internals/pecl.xml slides/internals/why-wrapping-libs.xml slides/mongodb/mongougs.xml slides/profiling/timing-points.xml slides/time/date-parse-from-format2.xm |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1806@lists.php.net to get a copy of this message | ||
Commit: 51933f9f1f91170fc7c1961be8f630fa8941d079
Author: Derick Rethans <github@derickrethans.nl> Wed, 30 May 2012 22:51:48 +0100
Parents: ab4a3e0532a871e32c8f8c224f591c2156274ac8
Branches: master
Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=51933f9f1f91170fc7c1961be8f630fa8941d079
Log:
Added phpDay, IPC and phpsummit talks.
Changed paths:
A extensions-phpday12.xml
A mongo-phpsummit.xml
A profiling-ipc2012s.xml
M slides/internals/extensions.dia
D slides/internals/extensions.dia~
M slides/internals/extensions.png
M slides/internals/functions.xml
M slides/internals/overview.xml
M slides/internals/pecl.xml
M slides/internals/why-wrapping-libs.xml
M slides/mongodb/mongougs.xml
M slides/profiling/timing-points.xml
M slides/time/date-parse-from-format2.xml
M slides/time/date-parse2.xml
M slides/time/default-timezone.xml
M slides/time/improvements-timezones.xml
A slides/time/in-database1.xml
A slides/time/in-database2.xml
A slides/time/in-database3.xml
A slides/time/in-database4.xml
M slides/time/intervals-2.xml
M slides/time/intervals.xml
M slides/time/period-2.xml
M slides/time/timestamps-suck.xml
A slides/time/utc-database1.png
A slides/time/utc-database2.png
A slides/time/utc-point1.png
A slides/time/utc-point2.png
A slides/time/utc-point3.png
M slides/xdebug/trace-tools.xml
M slides/xdebug/why-debugger3.xml
A time-ipc2012s.xml
diff --git a/extensions-phpday12.xml b/extensions-phpday12.xml new file mode 100644 index 0000000..f6cf592 --- /dev/null +++ b/extensions-phpday12.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen.css"> +<topic>Debugging</topic> +<title>PHP Extensions - What and Why</title> +<event>phpDay</event> +<location>Verona, Italy</location> +<date>May 18th, 2012</date> +<speaker>Derick Rethans</speaker> +<email>derick@derickrethans.nl</email> +<twitter>derickr</twitter> +<url>http://derickrethans.nl/talks.html</url> +<joindin>http://joind.in/6376</joindin> +<slide>slides/dbus/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<slide>slides/internals/extension-on-a-slide.xml</slide> + +<!-- +So you've heard that PHP supports extensions. But what are they exactly, what +can you do with them, and what *can't* you do with them? And mostly, why would +you or would you not want to spend time writing them? + +This session will introduce you into what PHP extensions are, and what they can +do for you. It will cover cases of when it makes sense to write extensions and +which things you need to think of when deciding whether you want to put the +effort into writing an extension. + +The talk then proceeds with a small introduction to the request cycle and PHP's +memory management. It mentions which parts of PHP you could override and which +parts you can hook into. It will also cover things that you can not do with +extensions. + +examples +core ext +internal ext +external ext +pecl +zend ext + +functions +classes +ini settings + +hooks +- startup, shutdown + +overloading: +- errors +- compile +- execute +- replacing functions + +stream filters +- phar +- encryption + + + +no syntax change +- british php + +why: +- wrapping libraries +- fast, specific extensions +- replacing PHP functions +--> +<slide>slides/internals/extensions.xml</slide> +<slide>slides/internals/core-extensions.xml</slide> +<slide>slides/internals/internal-extensions.xml</slide> +<slide>slides/internals/external-extensions.xml</slide> +<slide>slides/internals/pecl.xml</slide> +<slide>slides/internals/overview.xml</slide> +<slide>slides/internals/overview2.xml</slide> + +<slide>slides/internals/functions.xml</slide> +<slide>slides/internals/classes-etc.xml</slide> + +<slide>slides/internals/hooks.xml</slide> +<slide>slides/internals/overload.xml</slide> +<slide>slides/internals/opcodes-question.xml</slide> + +<slide>slides/internals/execute5.xml</slide> +<slide>slides/internals/opcode2.xml</slide> +<slide>slides/internals/execute2.xml</slide> +<slide>slides/internals/opcode-cache.xml</slide> + +<slide>slides/internals/opcode-overload2.xml</slide> +<slide>slides/internals/replacing-functions.xml</slide> +<slide>slides/internals/streams.xml</slide> +<slide>slides/internals/syntax-changes.xml</slide> + +<slide>slides/internals/why-wrapping-libs.xml</slide> +<slide>slides/internals/why-fast-specific.xml</slide> +<slide>slides/internals/why-replace-php.xml</slide> +<slide>slides/internals/why-not-possible.xml</slide> + +<slide>slides/internals/questions.xml</slide> +<slide>slides/mongodb/resources.xml</slide> + +</presentation> diff --git a/mongo-phpsummit.xml b/mongo-phpsummit.xml new file mode 100644 index 0000000..55df192 --- /dev/null +++ b/mongo-phpsummit.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen.css"> +<topic>mongoDB</topic> +<title>Using MongoDB</title> +<event>PHP Summit</event> +<location>London, UK</location> +<date>May 8th, 2012</date> +<speaker>Derick Rethans</speaker> +<email>derick@10gen.com</email> +<twitter>derickr</twitter> +<url>http://derickrethans.nl/talks.html</url> +<joindin>e-mail me</joindin> +<slide>slides/mongodb/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<slide>slides/mongodb/mongodb.xml</slide> +<slide>slides/mongodb/benefits.xml</slide> +<slide>slides/mongodb/databasefield.xml</slide> +<slide>slides/mongodb/collections-documents.xml</slide> +<slide>slides/mongodb/document.xml</slide> + +<slide>slides/mongodb/insert.xml</slide> +<slide>slides/mongodb/safe.xml</slide> +<slide>slides/mongodb/safe2.xml</slide> +<slide>slides/mongodb/query.xml</slide> + +Common Patterns + +- RDBMS-normalisation. + +<slide>slides/mongodb/normalisation.xml</slide> +<slide>slides/mongodb/blog.xml</slide> +<slide>slides/mongodb/blog2.xml</slide> + +<slide>slides/mongodb/considerations.xml</slide> + +**OSMify** +<slide>slides/mongodb/inherit.xml</slide> +<slide>slides/mongodb/inherit-rdbms.xml</slide> +<slide>slides/mongodb/inherit-mongo.xml</slide> +<slide>slides/mongodb/inherit-summary.xml</slide> + +<slide>slides/mongodb/one-to-many1.xml</slide> +<slide>slides/mongodb/one-to-many2.xml</slide> +<slide>slides/mongodb/one-to-many3.xml</slide> +<slide>slides/mongodb/one-to-many4.xml</slide> + +<slide>slides/mongodb/many-to-many1.xml</slide> +<slide>slides/mongodb/many-to-many2.xml</slide> +<slide>slides/mongodb/many-to-many3.xml</slide> +<slide>slides/mongodb/many-to-many4.xml</slide> + +<slide>slides/mongodb/embed-vs-link.xml</slide> +<slide>slides/mongodb/tip-array-key.xml</slide> +<slide>slides/mongodb/tip-paged-result.xml</slide> + +<slide>slides/mongodb/mmap.xml</slide> + +<slide>slides/mongodb/indexes.xml</slide> +<slide>slides/mongodb/indexes2.xml</slide> +<slide>slides/mongodb/indexes3.xml</slide> +<slide>slides/mongodb/indexes4.xml</slide> +- ensureIndex +- single +- compound +- sorting +- regexp with ^ + +<slide>slides/mongodb/indexes-geo.xml</slide> +<slide>slides/mongodb/indexes-geo2.xml</slide> +- 2d index +- within: box/circle + +<slide>slides/mongodb/replication.xml</slide> +- setup +- slaveOk +- journal +- write concerns +- tags (mention briefly) +- php connection string + +<slide>slides/mongodb/sharding.xml</slide> +- mongos +- diagram +- transparent + +<slide>slides/mongodb/who-uses.xml</slide> +<slide>slides/mongodb/mongougs.xml</slide> +<slide>slides/mongodb/resources.xml</slide> + +</presentation> diff --git a/profiling-ipc2012s.xml b/profiling-ipc2012s.xml new file mode 100644 index 0000000..07a5819 --- /dev/null +++ b/profiling-ipc2012s.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen.css"> +<topic>Debugging</topic> +<title>Profiling PHP Applications</title> +<event>International PHP Conference</event> +<location>Berlin, Germany</location> +<date>Jun 4th, 2012</date> +<speaker>Derick Rethans</speaker> +<email>derick@derickrethans.nl</email> +<twitter>derickr</twitter> +<url>http://derickrethans.nl/talks.html</url> +<joindin></joindin> +<slide>slides/dbus/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<!-- not everything you read on the internet *matters* --> +<!-- not everything you read on the internet is true --> +<slide>slides/profiling/does-not-matter.xml</slide> +<slide>slides/profiling/does-not-matter2.xml</slide> + +<!-- benchmark --> +<slide>slides/profiling/is-it-slow.xml</slide> +<slide>slides/profiling/find-out-if-it-is-slow.xml</slide> +<slide>slides/profiling/code-or-data.xml</slide> +<slide>slides/profiling/understand-code.xml</slide> +<slide>slides/profiling/timing-points.xml</slide> +<!-- - data or code bound --> +<!-- - code with debugging/benchmarking/timingpoints --> +<!-- - check over time --> + +<!-- understand your code --> +<!-- - inclued --> +<slide>slides/internals/inclued.xml</slide> +<!-- - xdebug tracing --> +<slide>slides/xdebug/why-debugger3.xml</slide> +<slide>slides/xdebug/wtf-happens.xml</slide> +<slide>slides/xdebug/functiontrace-computerized.xml</slide> +<slide>slides/xdebug/trace-tools.xml</slide> +<slide>slides/xdebug/live-demo.xml</slide> + +<slide>slides/xdebug/profile2.xml</slide> + +<slide>slides/profiling/xhprof.xml</slide> + +<slide>slides/xdebug/profiling3.xml</slide> +<slide>slides/xdebug/live-demo.xml</slide> + +<slide>slides/profiling/resources.xml</slide> + +</presentation> diff --git a/slides/internals/extensions.dia b/slides/internals/extensions.dia index b79a144..30dc442 100644 Binary files a/slides/internals/extensions.dia and b/slides/internals/extensions.dia differ diff --git a/slides/internals/extensions.dia~ b/slides/internals/extensions.dia~ deleted file mode 100644 index e6f6323..0000000 Binary files a/slides/internals/extensions.dia~ and /dev/null differ diff --git a/slides/internals/extensions.png b/slides/internals/extensions.png index 51b204b..e9d7341 100644 Binary files a/slides/internals/extensions.png and b/slides/internals/extensions.png differ diff --git a/slides/internals/functions.xml b/slides/internals/functions.xml index a9e409e..f49cdc4 100644 --- a/slides/internals/functions.xml +++ b/slides/internals/functions.xml @@ -10,20 +10,26 @@ <bullet>Configuration (INI) settings</bullet> </list> -<example><![CDATA[zend_module_entry xdebug_module_entry = { +<example><![CDATA[zend_module_entry mongo_module_entry = { +#if ZEND_MODULE_API_NO >= 20010901 STANDARD_MODULE_HEADER, - "xdebug", - xdebug_functions, - PHP_MINIT(xdebug), - PHP_MSHUTDOWN(xdebug), - PHP_RINIT(xdebug), - NULL, // PHP_RSHUTDOWN not in use - PHP_MINFO(xdebug), - XDEBUG_VERSION, -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6 - NO_MODULE_GLOBALS, #endif - ZEND_MODULE_POST_ZEND_DEACTIVATE_N(xdebug), + PHP_MONGO_EXTNAME, + mongo_functions, + PHP_MINIT(mongo), + PHP_MSHUTDOWN(mongo), + PHP_RINIT(mongo), + NULL, // PHP_RSHUTDOWN not in use + PHP_MINFO(mongo), + PHP_MONGO_VERSION, +#if ZEND_MODULE_API_NO >= 20060613 + PHP_MODULE_GLOBALS(mongo), + PHP_GINIT(mongo), + NULL, + NULL, STANDARD_MODULE_PROPERTIES_EX +#else + STANDARD_MODULE_PROPERTIES +#endif };]]></example> </slide> diff --git a/slides/internals/overview.xml b/slides/internals/overview.xml index b2ba6d5..ed64b2c 100644 --- a/slides/internals/overview.xml +++ b/slides/internals/overview.xml @@ -21,7 +21,7 @@ iisfunc imagick ims inclued informix ingres inotify intercept intl iptcdata ixsfunc judy kadm5 kakasi krb5 ktaglib lchash libevent libexif litespeed llvm lua lzf mailparse markdown maxdb mcal mcrypt_filter mcve mdbtools - memcache *memcached* memsession memtrack ming mnogosearch mono mqseries + memcache *memcached* memsession memtrack ming mnogosearch *mongo* mono mqseries msession msql muscat myphp mysqlnd_mc mysqlnd_ms mysqlnd_pscache mysqlnd_qc mysqlnd_sip mysqlnd_uh namazu ncurses Net_Gopher netools newt notes ntuser oauth ocal *oggvorbis* openal opendirectory openssl operator optimizer oracle diff --git a/slides/internals/pecl.xml b/slides/internals/pecl.xml index 263b44e..01ec64b 100644 --- a/slides/internals/pecl.xml +++ b/slides/internals/pecl.xml @@ -9,6 +9,6 @@ <bullet>A whole load of extensions for various interesting (and odd things)</bullet> <bullet>Are installed with the *PECL* tool</bullet> <bullet>Used to be called "Siberia"</bullet> - <bullet>Don't really have to be hosted in PHP's SVN repository, on the PECL website</bullet> + <bullet>Don't really have to be hosted in PHP's SVN repository, like the MongoDB extension which source lives on github.</bullet> </list> </slide> diff --git a/slides/internals/why-wrapping-libs.xml b/slides/internals/why-wrapping-libs.xml index 9623d66..d22abb4 100644 --- a/slides/internals/why-wrapping-libs.xml +++ b/slides/internals/why-wrapping-libs.xml @@ -8,6 +8,6 @@ <bullet>General use libraries: %re2%</bullet> <bullet>Specific use libraries: %cybermut%, %pam%</bullet> <bullet>Libraries that you have written yourself, or your company</bullet> - <bullet>Missing database support, or new webscale things like %mongodb%</bullet> + <bullet>Missing database support, or new awesome things like %mongodb%</bullet> </list> </slide> diff --git a/slides/mongodb/mongougs.xml b/slides/mongodb/mongougs.xml index de2803d..2598c5d 100644 --- a/slides/mongodb/mongougs.xml +++ b/slides/mongodb/mongougs.xml @@ -13,6 +13,6 @@ <list> <bullet>MongoDB London (May 29th): monthly</bullet> <bullet>MongoDB Thames Valley: monthly</bullet> - <bullet>Office Hours (May 2nd): bi-weekly near Old Street</bullet> + <bullet>Office Hours (May 16th): bi-weekly near Old Street</bullet> </list> </slide> diff --git a/slides/profiling/timing-points.xml b/slides/profiling/timing-points.xml index 2d37c30..63ae569 100644 --- a/slides/profiling/timing-points.xml +++ b/slides/profiling/timing-points.xml @@ -18,32 +18,4 @@ <blurb>Symfony:</blurb> <image filename="symfony-time.png" pdf-scale="0.4" y-offset="8.25" x-offset="19" pdf-float="1"/> </div> - -<div effect="fade-in-out"> -<blurb>Zeta Components:</blurb> -<image align="right" filename="zeta-time.png" pdf-scale="0.4" y-offset="13.5" x-offset="19" pdf-float="1"/> -<example><![CDATA[<?php -// Get the one and only instance of the ezcDebug. -$debug = ezcDebug::getInstance(); -// Start the accumulator. -$debug->startTimer( "Program runtime", "Accumulators" ); -$debug->switchTimer( "Start", "Program runtime" ); -// The name of the timer is: "Hello world" and it will be -// placed in the group: "output". -$debug->startTimer ("Hello world", "output" ); -echo "Hello world<br/>"; -$debug->stopTimer( "Hello world" ); -// Replace the "Start" timer for "Half the way". -$debug->switchTimer( "Half the way", "Start" ); -// Measure the time of writing "cruel world". -$debug->startTimer( "Goodbye cruel world", "output" ); -echo "Goodbye cruel world<br/>"; -$debug->stopTimer( "Goodbye cruel world" ); -// Stop the last timer. -$debug->switchTimer( "Stop", "Half the way" ); -$debug->stopTimer( "Stop" ); -// Get HTML output. -$output = $debug->generateOutput(); -?>]]></example> -</div> </slide> diff --git a/slides/time/date-parse-from-format2.xml b/slides/time/date-parse-from-format2.xml index a8ab746..46b79b9 100644 --- a/slides/time/date-parse-from-format2.xml +++ b/slides/time/date-parse-from-format2.xml @@ -6,7 +6,7 @@ <blurb>Creating strings with the ~date_create_from_format()~ function:</blurb> <example result="0"><![CDATA[<?php $date = "06/08/04"; -echo DateTime::createFromFormat( '!d/m/y', $date )->format( DateTime::ISO8601 ), "\n"; +$obj = DateTime::createFromFormat( '!d/m/y', $date )->format( DateTime::ISO8601 ); ?>]]></example> <break/> diff --git a/slides/time/date-parse2.xml b/slides/time/date-parse2.xml index 85e7a5e..d3a79c5 100644 --- a/slides/time/date-parse2.xml +++ b/slides/time/date-parse2.xml @@ -2,21 +2,12 @@ <slide> <title>Parsing Dates</title> -<div effect="fade-out"> - <blurb class='large' align='center'>"22apr2006 8:36:14 #^ Europe/Oslo CEST"</blurb> -</div> -<div effect="fade-in-out"> - <blurb class='large' align='center'>"22apr2006 8:36:14 |cc0000|#^| Europe/Oslo CEST"</blurb> -</div> -<div effect="fade-in-out"> - <blurb class='large' align='center'>"22apr2006 8:36:14 Europe/Oslo CEST"</blurb> -</div> -<div effect="slide"> - <blurb class='large' align='center'>"|a4000000|22||3464a4|apr||f57900|2006| |ad7fa8|8|:|ef2929|36|:|73d216|14| |c4a000|Europe/Oslo| |75507b|CEST|"</blurb> +<div> + <blurb class='large' align='center'>"|a4000000|22||3464a4|apr||f57900|2006| |ad7fa8|8|:|ef2929|36|:|73d216|14| # |c4a000|Europe/Oslo| |75507b|CEST|"</blurb> <blurb>Parsing strings with the ~date_parse()~ function:</blurb> <example result="1"><![CDATA[<?php -$date = "22apr2006 8:36:14.43 #^ Europe/Oslo CEST"; +$date = "22apr2006 8:36:14.43 # Europe/Oslo CEST"; $t = date_parse( $date ); echo $t['year'], '-', $t['month'], '-', $t['day'], " "; diff --git a/slides/time/default-timezone.xml b/slides/time/default-timezone.xml index ff62b5f..dcaca11 100644 --- a/slides/time/default-timezone.xml +++ b/slides/time/default-timezone.xml @@ -20,9 +20,6 @@ <blurb>Default timezone is 'guessed' in the following order:</blurb> <list> <bullet>~date_default_timezone_set()~ value</bullet> - <bullet>|777777|%TZ% environment variable|</bullet> <bullet>php.ini's %date.timezone% setting</bullet> - <bullet>|dd4444|System's rendering of timezone abbreviation|</bullet> </list> - </slide> diff --git a/slides/time/improvements-timezones.xml b/slides/time/improvements-timezones.xml index f8b18cc..c16d891 100644 --- a/slides/time/improvements-timezones.xml +++ b/slides/time/improvements-timezones.xml @@ -3,7 +3,7 @@ <title>Timezone Support</title> <list> - <bullet>Bundled timezone database with 564 zones</bullet> + <bullet>Bundled timezone database with 576 zones</bullet> <bullet>Not dependent on timezone abbreviations</bullet> <bullet>Timezones have the format: Continent/Location or Continent/Location/Sublocation - Like: Europe/Amsterdam, America/Indiana/Knox</bullet> </list> diff --git a/slides/time/in-database1.xml b/slides/time/in-database1.xml new file mode 100644 index 0000000..5a8556e --- /dev/null +++ b/slides/time/in-database1.xml @@ -0,0 +1,16 @@ +<slide> +<title>Storing date/time in a database</title> +<subtitle>Timestamp and UTC offset for in the future</subtitle> + +<image filename="utc-database2.png"/> + +<list> + <bullet>*Goal*: Store date *exactly* 4 months in the future</bullet> + <bullet>Store: ~timestamp~ and ~UTC offset~ (%UTC-4%)</bullet> + <bullet>Current date/time: Jun 1st, 13:00 UTC-4 (%1338570000%)</bullet> + <bullet>Future date/time: Oct 1st, 13:00 UTC-4 (%1349110800%)</bullet> + <bullet>Correct for Montreal, where DST is still in effect.</bullet> + <bullet>Wrong for Santiago, where it DST has kicked in so it's UTC-3.</bullet> + <bullet>*Conclusion*: By storing ~timestamp~ and ~UTC offset~ you can't convert back to local time</bullet> +</list> +</slide> diff --git a/slides/time/in-database2.xml b/slides/time/in-database2.xml new file mode 100644 index 0000000..e5d9a85 --- /dev/null +++ b/slides/time/in-database2.xml @@ -0,0 +1,15 @@ +<slide> +<title>Storing date/time in a database</title> +<subtitle>Timestamp and timezone identifier</subtitle> + +<image filename="utc-point1.png"/> + +<list> + <bullet>*Goal*: Store date *exactly* 4 months in the future</bullet> + <bullet>Store: ~timestamp~ and ~timezone identifier~ (%America/Montreal%)</bullet> + <bullet>Current date/time: Jun 1st, 13:00 EDT (%1338570000%)</bullet> + <bullet>Future date/time: Oct 1st, 13:00 EDT (%1349110800%)</bullet> + <bullet>Local time for Santiago can also be calculated with the ~timestamp~ and its ~timezone identifier~ (%America/Santiago%).</bullet> + <bullet>*Conclusion*: Storing ~timestamp~ and ~timezone identifier~ allows you to convert to local time</bullet> +</list> +</slide> diff --git a/slides/time/in-database3.xml b/slides/time/in-database3.xml new file mode 100644 index 0000000..12b4b40 --- /dev/null +++ b/slides/time/in-database3.xml @@ -0,0 +1,24 @@ +<slide> +<title>Storing date/time in a database</title> +<subtitle>Timestamp and timezone identifier?</subtitle> + +<div effect='fade-out'> +<image filename="utc-point2.png"/> + +<blurb>Then somebody change the timezone database rules:</blurb> +<list> + <bullet>%America/Montreal, 1349110800% → ---Oct 1st, 13:00 EDT---</bullet> + <bullet>%America/Montreal, 1349110800% → *Oct 1st, 12:00 EST* ☹</bullet> +</list> +</div> + +<div effect='fade-in'> +<image filename="utc-point3.png"/> + +<blurb>You can store it as:</blurb> +<list> + <bullet>%America/Montreal, 2012 10 1 13 0 0% → Oct 1st, 13:00 EDT</bullet> + <bullet>That however, changes the original point in time...</bullet> +</list> +</div> +</slide> diff --git a/slides/time/in-database4.xml b/slides/time/in-database4.xml new file mode 100644 index 0000000..df8532d --- /dev/null +++ b/slides/time/in-database4.xml @@ -0,0 +1,26 @@ +<slide> +<title>Storing date/time in a database</title> +<subtitle>Conclusion</subtitle> + +<blurb>If you want to future proof a specific date and time (Oct 1st, +13:00)-ie, storing a time in *local time*:</blurb> +<example><![CDATA[{ + 'title' : 'Giving a talk: Advanced Date/Time handling with PHP', + 'time' : { + 'tz': 'America/Montreal', + 'dt': '2012-10-01 13:00', + } +}]]></example> +<break /> + +<blurb>If you want to store a time for an appointment for a group of people +all in different timezones-ie, store a *specific point in time*:</blurb> +<example><![CDATA[{ + 'title' : 'Meeting about getting rid of Daylight Saving Time', + 'time' : { + 'tz': 'America/Montreal', + 'ts': 1349110800, + }, + 'attendees' : [ 'Arthur David Olson', 'Paul Eggert' ], +}]]></example> +</slide> diff --git a/slides/time/intervals-2.xml b/slides/time/intervals-2.xml index 5239b13..11d6d13 100644 --- a/slides/time/intervals-2.xml +++ b/slides/time/intervals-2.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Intervals (PHP 5.3)</title> + <title>Intervals</title> <subtitle>Applying an interval</subtitle> <example result="0"><![CDATA[<?php -$d = new DateTime( 'August 27th, 2009' ); +$d = new DateTime( 'May 29th, 2012' ); echo $d->format( "l Y-m-d\n" ); $i = DateInterval::createFromDateString( "next weekday" ); diff --git a/slides/time/intervals.xml b/slides/time/intervals.xml index 975891a..649e8f4 100644 --- a/slides/time/intervals.xml +++ b/slides/time/intervals.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Intervals (PHP 5.3)</title> + <title>Intervals</title> <subtitle>Creating an interval</subtitle> <example result="1"><![CDATA[<?php @@ -12,7 +12,7 @@ $i = new DateInterval( 'P3DT6H' ); // from a difference $d1 = new DateTime(); -$d2 = new DateTime( "2010-10-10 10:10 Europe/Amsterdam" ); +$d2 = new DateTime( "2012-05-29 15:26 Europe/Amsterdam" ); $i = $d1->diff( $d2 ); // displaying the difference diff --git a/slides/time/period-2.xml b/slides/time/period-2.xml index 108791b..5df7ea0 100644 --- a/slides/time/period-2.xml +++ b/slides/time/period-2.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Periods (PHP 5.3)</title> + <title>Periods</title> <subtitle>Iterating over a period</subtitle> <example result="1"><![CDATA[<?php diff --git a/slides/time/timestamps-suck.xml b/slides/time/timestamps-suck.xml index 15e65a3..8bd77e0 100644 --- a/slides/time/timestamps-suck.xml +++ b/slides/time/timestamps-suck.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Problems with timestamps and timezones</title> + <title>Unix timestamps and timezones</title> <example result="1"><![CDATA[<?php $date = strtotime( '2010-03-07 20:48:21 America/Toronto' ); @@ -10,14 +10,11 @@ <div effect="hide"> <blurb>Explanation:</blurb> - <blurb effect="fade-out" class='pre'> 2010-03-07 20:48:21 America/Toronto</blurb> - <blurb effect="fade-in-out" class='pre'> |ef2929|1268012901| - - string is turned into a number</blurb> - <blurb effect="fade-in" class='pre'> 2010-03-08 |555753|01:48:21 Europe/London| - - number is converted to a date/time string using - the *default* timezone</blurb> + <blurb class='pre'>$date = strtotime( '2010-03-07 20:48:21 America/Toronto' );</blurb> + <blurb effect="fade-in" class='pre'>$date = |ef2929|1268012901|; // string is turned into a number</blurb> + <blurb effect="fade-in" class='pre'>echo date( 'Y-m-d', 1268012901 ), "\n";</blurb> + <blurb effect="fade-in">Number is converted to a date/time string using the *default* timezone:</blurb> + <blurb effect="fade-in" class='pre'>"2010-03-08" |555753|(01:48:21 Europe/London)|</blurb> </div> </slide> diff --git a/slides/time/utc-database1.png b/slides/time/utc-database1.png new file mode 100644 index 0000000..e0dc39c Binary files /dev/null and b/slides/time/utc-database1.png differ diff --git a/slides/time/utc-database2.png b/slides/time/utc-database2.png new file mode 100644 index 0000000..e5b0c21 Binary files /dev/null and b/slides/time/utc-database2.png differ diff --git a/slides/time/utc-point1.png b/slides/time/utc-point1.png new file mode 100644 index 0000000..b45e318 Binary files /dev/null and b/slides/time/utc-point1.png differ diff --git a/slides/time/utc-point2.png b/slides/time/utc-point2.png new file mode 100644 index 0000000..6c7cded Binary files /dev/null and b/slides/time/utc-point2.png differ diff --git a/slides/time/utc-point3.png b/slides/time/utc-point3.png new file mode 100644 index 0000000..f394870 Binary files /dev/null and b/slides/time/utc-point3.png differ diff --git a/slides/xdebug/trace-tools.xml b/slides/xdebug/trace-tools.xml index 2631360..44cfeaa 100644 --- a/slides/xdebug/trace-tools.xml +++ b/slides/xdebug/trace-tools.xml @@ -8,14 +8,14 @@ php ~/dev/php/xdebug/trunk/contrib/tracefile-analyser.php time-own 5 ... Showing the 5 most costly calls sorted by 'time-own'. - Inclusive Own -function #calls time memory time memory -------------------------------------------------------------------------------------------------- -array_pop 715 1.0252 -139880 1.0252 -139880 -preg_match 2986 0.3718 1016336 0.3718 1016336 -{main} 1 6.4562 7335704 0.3476 -15198832 -next 432 0.2386 0 0.2386 0 -count 3302 0.2132 0 0.2123 0 + Inclusive Own +function #calls time memory time memory +------------------------------------------------------------------------------- +array_pop 715 1.0252 -139880 1.0252 -139880 +preg_match 2986 0.3718 1016336 0.3718 1016336 +{main} 1 6.4562 7335704 0.3476 -15198832 +next 432 0.2386 0 0.2386 0 +count 3302 0.2132 0 0.2123 0 </example> </div> <div effect="fade-in-out"> diff --git a/slides/xdebug/why-debugger3.xml b/slides/xdebug/why-debugger3.xml index 721c41e..fe381a3 100644 --- a/slides/xdebug/why-debugger3.xml +++ b/slides/xdebug/why-debugger3.xml @@ -1,5 +1,5 @@ <slide> - <title>I Do Need a Debugger</title> + <title>Debugger and Profiler</title> <image filename="xdebug-logo.png" pdf-scale="0.6"/> <list> @@ -7,6 +7,6 @@ <bullet>About 10 years old</bullet> <bullet>Works on "every" operating system</bullet> <bullet>PHP 5.1, 5.2, 5.3, 5.4 and trunk</bullet> - <bullet>Version 2.2 about to follow with PHP 5.4</bullet> + <bullet>Version 2.2 just out</bullet> </list> </slide> diff --git a/time-ipc2012s.xml b/time-ipc2012s.xml new file mode 100644 index 0000000..fe9f6fc --- /dev/null +++ b/time-ipc2012s.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen.css"> +<topic>Localization and Internationalization</topic> +<title>Advanced Date/Time Handling</title> +<event>International PHP Conference</event> +<location>Berlin, Germany</location> +<date>Jun 4th, 2010</date> +<speaker>Derick Rethans</speaker> +<email>derick@php.net</email> +<url>http://derickrethans.nl/talks.html</url> +<joindin></joindin> +<twitter>derickr</twitter> + +<slide>slides/mongodb/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<!-- INTRODUCTION --> +<slide>slides/time/problems-condensed.xml</slide> + +<!-- PHP - IMPROVEMENTS --> +<slide>slides/time/improvements-timezones.xml</slide> +<slide>slides/time/improvements-more-on-timezones.xml</slide> +<slide>slides/time/default-timezone.xml</slide> +<slide>slides/time/timestamps-suck.xml</slide> + +<!-- PHP - CODE EXAMPLES --> +<slide>slides/time/basic-parse-time-new.xml</slide> +<slide>slides/time/date-parse2.xml</slide> +<slide>slides/time/date-parse-from-format3.xml</slide> +<slide>slides/time/date-parse-from-format2.xml</slide> + +<!-- DATE EXAMPLES --> +<slide>slides/time/date-modify.xml</slide> +<slide>slides/time/timezone-object-1.xml</slide> +<slide>slides/time/date-timezone.xml</slide> +<slide>slides/time/timezone-utilities-3.xml</slide> + +<!-- INTERVALS and PERIODS --> +<slide>slides/time/intervals.xml</slide> +<slide>slides/time/intervals-2.xml</slide> +<slide>slides/time/relative-month.xml</slide> +<slide>slides/time/relative-month3.xml</slide> +<slide>slides/time/period-2.xml</slide> + +<!-- STORING in DATABASE --> +<slide>slides/time/in-database1.xml</slide> +<slide>slides/time/in-database2.xml</slide> +<slide>slides/time/in-database3.xml</slide> +<slide>slides/time/in-database4.xml</slide> + +<!-- EXIT --> +<slide>slides/time/book.xml</slide> <!-- resources --> +<slide>slides/mongodb/resources.xml</slide> <!-- resources --> + +<slide>slides/dbus/end.xml</slide> +</presentation>
diff --git a/extensions-phpday12.xml b/extensions-phpday12.xml new file mode 100644 index 0000000..f6cf592 --- /dev/null +++ b/extensions-phpday12.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen.css"> +<topic>Debugging</topic> +<title>PHP Extensions - What and Why</title> +<event>phpDay</event> +<location>Verona, Italy</location> +<date>May 18th, 2012</date> +<speaker>Derick Rethans</speaker> +<email>derick@derickrethans.nl</email> +<twitter>derickr</twitter> +<url>http://derickrethans.nl/talks.html</url> +<joindin>http://joind.in/6376</joindin> +<slide>slides/dbus/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<slide>slides/internals/extension-on-a-slide.xml</slide> + +<!-- +So you've heard that PHP supports extensions. But what are they exactly, what +can you do with them, and what *can't* you do with them? And mostly, why would +you or would you not want to spend time writing them? + +This session will introduce you into what PHP extensions are, and what they can +do for you. It will cover cases of when it makes sense to write extensions and +which things you need to think of when deciding whether you want to put the +effort into writing an extension. + +The talk then proceeds with a small introduction to the request cycle and PHP's +memory management. It mentions which parts of PHP you could override and which +parts you can hook into. It will also cover things that you can not do with +extensions. + +examples +core ext +internal ext +external ext +pecl +zend ext + +functions +classes +ini settings + +hooks +- startup, shutdown + +overloading: +- errors +- compile +- execute +- replacing functions + +stream filters +- phar +- encryption + + + +no syntax change +- british php + +why: +- wrapping libraries +- fast, specific extensions +- replacing PHP functions +--> +<slide>slides/internals/extensions.xml</slide> +<slide>slides/internals/core-extensions.xml</slide> +<slide>slides/internals/internal-extensions.xml</slide> +<slide>slides/internals/external-extensions.xml</slide> +<slide>slides/internals/pecl.xml</slide> +<slide>slides/internals/overview.xml</slide> +<slide>slides/internals/overview2.xml</slide> + +<slide>slides/internals/functions.xml</slide> +<slide>slides/internals/classes-etc.xml</slide> + +<slide>slides/internals/hooks.xml</slide> +<slide>slides/internals/overload.xml</slide> +<slide>slides/internals/opcodes-question.xml</slide> + +<slide>slides/internals/execute5.xml</slide> +<slide>slides/internals/opcode2.xml</slide> +<slide>slides/internals/execute2.xml</slide> +<slide>slides/internals/opcode-cache.xml</slide> + +<slide>slides/internals/opcode-overload2.xml</slide> +<slide>slides/internals/replacing-functions.xml</slide> +<slide>slides/internals/streams.xml</slide> +<slide>slides/internals/syntax-changes.xml</slide> + +<slide>slides/internals/why-wrapping-libs.xml</slide> +<slide>slides/internals/why-fast-specific.xml</slide> +<slide>slides/internals/why-replace-php.xml</slide> +<slide>slides/internals/why-not-possible.xml</slide> + +<slide>slides/internals/questions.xml</slide> +<slide>slides/mongodb/resources.xml</slide> + +</presentation> diff --git a/mongo-phpsummit.xml b/mongo-phpsummit.xml new file mode 100644 index 0000000..55df192 --- /dev/null +++ b/mongo-phpsummit.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen.css"> +<topic>mongoDB</topic> +<title>Using MongoDB</title> +<event>PHP Summit</event> +<location>London, UK</location> +<date>May 8th, 2012</date> +<speaker>Derick Rethans</speaker> +<email>derick@10gen.com</email> +<twitter>derickr</twitter> +<url>http://derickrethans.nl/talks.html</url> +<joindin>e-mail me</joindin> +<slide>slides/mongodb/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<slide>slides/mongodb/mongodb.xml</slide> +<slide>slides/mongodb/benefits.xml</slide> +<slide>slides/mongodb/databasefield.xml</slide> +<slide>slides/mongodb/collections-documents.xml</slide> +<slide>slides/mongodb/document.xml</slide> + +<slide>slides/mongodb/insert.xml</slide> +<slide>slides/mongodb/safe.xml</slide> +<slide>slides/mongodb/safe2.xml</slide> +<slide>slides/mongodb/query.xml</slide> + +Common Patterns + +- RDBMS-normalisation. + +<slide>slides/mongodb/normalisation.xml</slide> +<slide>slides/mongodb/blog.xml</slide> +<slide>slides/mongodb/blog2.xml</slide> + +<slide>slides/mongodb/considerations.xml</slide> + +**OSMify** +<slide>slides/mongodb/inherit.xml</slide> +<slide>slides/mongodb/inherit-rdbms.xml</slide> +<slide>slides/mongodb/inherit-mongo.xml</slide> +<slide>slides/mongodb/inherit-summary.xml</slide> + +<slide>slides/mongodb/one-to-many1.xml</slide> +<slide>slides/mongodb/one-to-many2.xml</slide> +<slide>slides/mongodb/one-to-many3.xml</slide> +<slide>slides/mongodb/one-to-many4.xml</slide> + +<slide>slides/mongodb/many-to-many1.xml</slide> +<slide>slides/mongodb/many-to-many2.xml</slide> +<slide>slides/mongodb/many-to-many3.xml</slide> +<slide>slides/mongodb/many-to-many4.xml</slide> + +<slide>slides/mongodb/embed-vs-link.xml</slide> +<slide>slides/mongodb/tip-array-key.xml</slide> +<slide>slides/mongodb/tip-paged-result.xml</slide> + +<slide>slides/mongodb/mmap.xml</slide> + +<slide>slides/mongodb/indexes.xml</slide> +<slide>slides/mongodb/indexes2.xml</slide> +<slide>slides/mongodb/indexes3.xml</slide> +<slide>slides/mongodb/indexes4.xml</slide> +- ensureIndex +- single +- compound +- sorting +- regexp with ^ + +<slide>slides/mongodb/indexes-geo.xml</slide> +<slide>slides/mongodb/indexes-geo2.xml</slide> +- 2d index +- within: box/circle + +<slide>slides/mongodb/replication.xml</slide> +- setup +- slaveOk +- journal +- write concerns +- tags (mention briefly) +- php connection string + +<slide>slides/mongodb/sharding.xml</slide> +- mongos +- diagram +- transparent + +<slide>slides/mongodb/who-uses.xml</slide> +<slide>slides/mongodb/mongougs.xml</slide> +<slide>slides/mongodb/resources.xml</slide> + +</presentation> diff --git a/profiling-ipc2012s.xml b/profiling-ipc2012s.xml new file mode 100644 index 0000000..07a5819 --- /dev/null +++ b/profiling-ipc2012s.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen.css"> +<topic>Debugging</topic> +<title>Profiling PHP Applications</title> +<event>International PHP Conference</event> +<location>Berlin, Germany</location> +<date>Jun 4th, 2012</date> +<speaker>Derick Rethans</speaker> +<email>derick@derickrethans.nl</email> +<twitter>derickr</twitter> +<url>http://derickrethans.nl/talks.html</url> +<joindin></joindin> +<slide>slides/dbus/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<!-- not everything you read on the internet *matters* --> +<!-- not everything you read on the internet is true --> +<slide>slides/profiling/does-not-matter.xml</slide> +<slide>slides/profiling/does-not-matter2.xml</slide> + +<!-- benchmark --> +<slide>slides/profiling/is-it-slow.xml</slide> +<slide>slides/profiling/find-out-if-it-is-slow.xml</slide> +<slide>slides/profiling/code-or-data.xml</slide> +<slide>slides/profiling/understand-code.xml</slide> +<slide>slides/profiling/timing-points.xml</slide> +<!-- - data or code bound --> +<!-- - code with debugging/benchmarking/timingpoints --> +<!-- - check over time --> + +<!-- understand your code --> +<!-- - inclued --> +<slide>slides/internals/inclued.xml</slide> +<!-- - xdebug tracing --> +<slide>slides/xdebug/why-debugger3.xml</slide> +<slide>slides/xdebug/wtf-happens.xml</slide> +<slide>slides/xdebug/functiontrace-computerized.xml</slide> +<slide>slides/xdebug/trace-tools.xml</slide> +<slide>slides/xdebug/live-demo.xml</slide> + +<slide>slides/xdebug/profile2.xml</slide> + +<slide>slides/profiling/xhprof.xml</slide> + +<slide>slides/xdebug/profiling3.xml</slide> +<slide>slides/xdebug/live-demo.xml</slide> + +<slide>slides/profiling/resources.xml</slide> + +</presentation> diff --git a/slides/internals/extensions.dia b/slides/internals/extensions.dia index b79a144..30dc442 100644 Binary files a/slides/internals/extensions.dia and b/slides/internals/extensions.dia differ diff --git a/slides/internals/extensions.dia~ b/slides/internals/extensions.dia~ deleted file mode 100644 index e6f6323..0000000 Binary files a/slides/internals/extensions.dia~ and /dev/null differ diff --git a/slides/internals/extensions.png b/slides/internals/extensions.png index 51b204b..e9d7341 100644 Binary files a/slides/internals/extensions.png and b/slides/internals/extensions.png differ diff --git a/slides/internals/functions.xml b/slides/internals/functions.xml index a9e409e..f49cdc4 100644 --- a/slides/internals/functions.xml +++ b/slides/internals/functions.xml @@ -10,20 +10,26 @@ <bullet>Configuration (INI) settings</bullet> </list> -<example><![CDATA[zend_module_entry xdebug_module_entry = { +<example><![CDATA[zend_module_entry mongo_module_entry = { +#if ZEND_MODULE_API_NO >= 20010901 STANDARD_MODULE_HEADER, - "xdebug", - xdebug_functions, - PHP_MINIT(xdebug), - PHP_MSHUTDOWN(xdebug), - PHP_RINIT(xdebug), - NULL, // PHP_RSHUTDOWN not in use - PHP_MINFO(xdebug), - XDEBUG_VERSION, -#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6 - NO_MODULE_GLOBALS, #endif - ZEND_MODULE_POST_ZEND_DEACTIVATE_N(xdebug), + PHP_MONGO_EXTNAME, + mongo_functions, + PHP_MINIT(mongo), + PHP_MSHUTDOWN(mongo), + PHP_RINIT(mongo), + NULL, // PHP_RSHUTDOWN not in use + PHP_MINFO(mongo), + PHP_MONGO_VERSION, +#if ZEND_MODULE_API_NO >= 20060613 + PHP_MODULE_GLOBALS(mongo), + PHP_GINIT(mongo), + NULL, + NULL, STANDARD_MODULE_PROPERTIES_EX +#else + STANDARD_MODULE_PROPERTIES +#endif };]]></example> </slide> diff --git a/slides/internals/overview.xml b/slides/internals/overview.xml index b2ba6d5..ed64b2c 100644 --- a/slides/internals/overview.xml +++ b/slides/internals/overview.xml @@ -21,7 +21,7 @@ iisfunc imagick ims inclued informix ingres inotify intercept intl iptcdata ixsfunc judy kadm5 kakasi krb5 ktaglib lchash libevent libexif litespeed llvm lua lzf mailparse markdown maxdb mcal mcrypt_filter mcve mdbtools - memcache *memcached* memsession memtrack ming mnogosearch mono mqseries + memcache *memcached* memsession memtrack ming mnogosearch *mongo* mono mqseries msession msql muscat myphp mysqlnd_mc mysqlnd_ms mysqlnd_pscache mysqlnd_qc mysqlnd_sip mysqlnd_uh namazu ncurses Net_Gopher netools newt notes ntuser oauth ocal *oggvorbis* openal opendirectory openssl operator optimizer oracle diff --git a/slides/internals/pecl.xml b/slides/internals/pecl.xml index 263b44e..01ec64b 100644 --- a/slides/internals/pecl.xml +++ b/slides/internals/pecl.xml @@ -9,6 +9,6 @@ <bullet>A whole load of extensions for various interesting (and odd things)</bullet> <bullet>Are installed with the *PECL* tool</bullet> <bullet>Used to be called "Siberia"</bullet> - <bullet>Don't really have to be hosted in PHP's SVN repository, on the PECL website</bullet> + <bullet>Don't really have to be hosted in PHP's SVN repository, like the MongoDB extension which source lives on github.</bullet> </list> </slide> diff --git a/slides/internals/why-wrapping-libs.xml b/slides/internals/why-wrapping-libs.xml index 9623d66..d22abb4 100644 --- a/slides/internals/why-wrapping-libs.xml +++ b/slides/internals/why-wrapping-libs.xml @@ -8,6 +8,6 @@ <bullet>General use libraries: %re2%</bullet> <bullet>Specific use libraries: %cybermut%, %pam%</bullet> <bullet>Libraries that you have written yourself, or your company</bullet> - <bullet>Missing database support, or new webscale things like %mongodb%</bullet> + <bullet>Missing database support, or new awesome things like %mongodb%</bullet> </list> </slide> diff --git a/slides/mongodb/mongougs.xml b/slides/mongodb/mongougs.xml index de2803d..2598c5d 100644 --- a/slides/mongodb/mongougs.xml +++ b/slides/mongodb/mongougs.xml @@ -13,6 +13,6 @@ <list> <bullet>MongoDB London (May 29th): monthly</bullet> <bullet>MongoDB Thames Valley: monthly</bullet> - <bullet>Office Hours (May 2nd): bi-weekly near Old Street</bullet> + <bullet>Office Hours (May 16th): bi-weekly near Old Street</bullet> </list> </slide> diff --git a/slides/profiling/timing-points.xml b/slides/profiling/timing-points.xml index 2d37c30..63ae569 100644 --- a/slides/profiling/timing-points.xml +++ b/slides/profiling/timing-points.xml @@ -18,32 +18,4 @@ <blurb>Symfony:</blurb> <image filename="symfony-time.png" pdf-scale="0.4" y-offset="8.25" x-offset="19" pdf-float="1"/> </div> - -<div effect="fade-in-out"> -<blurb>Zeta Components:</blurb> -<image align="right" filename="zeta-time.png" pdf-scale="0.4" y-offset="13.5" x-offset="19" pdf-float="1"/> -<example><![CDATA[<?php -// Get the one and only instance of the ezcDebug. -$debug = ezcDebug::getInstance(); -// Start the accumulator. -$debug->startTimer( "Program runtime", "Accumulators" ); -$debug->switchTimer( "Start", "Program runtime" ); -// The name of the timer is: "Hello world" and it will be -// placed in the group: "output". -$debug->startTimer ("Hello world", "output" ); -echo "Hello world<br/>"; -$debug->stopTimer( "Hello world" ); -// Replace the "Start" timer for "Half the way". -$debug->switchTimer( "Half the way", "Start" ); -// Measure the time of writing "cruel world". -$debug->startTimer( "Goodbye cruel world", "output" ); -echo "Goodbye cruel world<br/>"; -$debug->stopTimer( "Goodbye cruel world" ); -// Stop the last timer. -$debug->switchTimer( "Stop", "Half the way" ); -$debug->stopTimer( "Stop" ); -// Get HTML output. -$output = $debug->generateOutput(); -?>]]></example> -</div> </slide> diff --git a/slides/time/date-parse-from-format2.xml b/slides/time/date-parse-from-format2.xml index a8ab746..46b79b9 100644 --- a/slides/time/date-parse-from-format2.xml +++ b/slides/time/date-parse-from-format2.xml @@ -6,7 +6,7 @@ <blurb>Creating strings with the ~date_create_from_format()~ function:</blurb> <example result="0"><![CDATA[<?php $date = "06/08/04"; -echo DateTime::createFromFormat( '!d/m/y', $date )->format( DateTime::ISO8601 ), "\n"; +$obj = DateTime::createFromFormat( '!d/m/y', $date )->format( DateTime::ISO8601 ); ?>]]></example> <break/> diff --git a/slides/time/date-parse2.xml b/slides/time/date-parse2.xml index 85e7a5e..d3a79c5 100644 --- a/slides/time/date-parse2.xml +++ b/slides/time/date-parse2.xml @@ -2,21 +2,12 @@ <slide> <title>Parsing Dates</title> -<div effect="fade-out"> - <blurb class='large' align='center'>"22apr2006 8:36:14 #^ Europe/Oslo CEST"</blurb> -</div> -<div effect="fade-in-out"> - <blurb class='large' align='center'>"22apr2006 8:36:14 |cc0000|#^| Europe/Oslo CEST"</blurb> -</div> -<div effect="fade-in-out"> - <blurb class='large' align='center'>"22apr2006 8:36:14 Europe/Oslo CEST"</blurb> -</div> -<div effect="slide"> - <blurb class='large' align='center'>"|a4000000|22||3464a4|apr||f57900|2006| |ad7fa8|8|:|ef2929|36|:|73d216|14| |c4a000|Europe/Oslo| |75507b|CEST|"</blurb> +<div> + <blurb class='large' align='center'>"|a4000000|22||3464a4|apr||f57900|2006| |ad7fa8|8|:|ef2929|36|:|73d216|14| # |c4a000|Europe/Oslo| |75507b|CEST|"</blurb> <blurb>Parsing strings with the ~date_parse()~ function:</blurb> <example result="1"><![CDATA[<?php -$date = "22apr2006 8:36:14.43 #^ Europe/Oslo CEST"; +$date = "22apr2006 8:36:14.43 # Europe/Oslo CEST"; $t = date_parse( $date ); echo $t['year'], '-', $t['month'], '-', $t['day'], " "; diff --git a/slides/time/default-timezone.xml b/slides/time/default-timezone.xml index ff62b5f..dcaca11 100644 --- a/slides/time/default-timezone.xml +++ b/slides/time/default-timezone.xml @@ -20,9 +20,6 @@ <blurb>Default timezone is 'guessed' in the following order:</blurb> <list> <bullet>~date_default_timezone_set()~ value</bullet> - <bullet>|777777|%TZ% environment variable|</bullet> <bullet>php.ini's %date.timezone% setting</bullet> - <bullet>|dd4444|System's rendering of timezone abbreviation|</bullet> </list> - </slide> diff --git a/slides/time/improvements-timezones.xml b/slides/time/improvements-timezones.xml index f8b18cc..c16d891 100644 --- a/slides/time/improvements-timezones.xml +++ b/slides/time/improvements-timezones.xml @@ -3,7 +3,7 @@ <title>Timezone Support</title> <list> - <bullet>Bundled timezone database with 564 zones</bullet> + <bullet>Bundled timezone database with 576 zones</bullet> <bullet>Not dependent on timezone abbreviations</bullet> <bullet>Timezones have the format: Continent/Location or Continent/Location/Sublocation - Like: Europe/Amsterdam, America/Indiana/Knox</bullet> </list> diff --git a/slides/time/in-database1.xml b/slides/time/in-database1.xml new file mode 100644 index 0000000..5a8556e --- /dev/null +++ b/slides/time/in-database1.xml @@ -0,0 +1,16 @@ +<slide> +<title>Storing date/time in a database</title> +<subtitle>Timestamp and UTC offset for in the future</subtitle> + +<image filename="utc-database2.png"/> + +<list> + <bullet>*Goal*: Store date *exactly* 4 months in the future</bullet> + <bullet>Store: ~timestamp~ and ~UTC offset~ (%UTC-4%)</bullet> + <bullet>Current date/time: Jun 1st, 13:00 UTC-4 (%1338570000%)</bullet> + <bullet>Future date/time: Oct 1st, 13:00 UTC-4 (%1349110800%)</bullet> + <bullet>Correct for Montreal, where DST is still in effect.</bullet> + <bullet>Wrong for Santiago, where it DST has kicked in so it's UTC-3.</bullet> + <bullet>*Conclusion*: By storing ~timestamp~ and ~UTC offset~ you can't convert back to local time</bullet> +</list> +</slide> diff --git a/slides/time/in-database2.xml b/slides/time/in-database2.xml new file mode 100644 index 0000000..e5d9a85 --- /dev/null +++ b/slides/time/in-database2.xml @@ -0,0 +1,15 @@ +<slide> +<title>Storing date/time in a database</title> +<subtitle>Timestamp and timezone identifier</subtitle> + +<image filename="utc-point1.png"/> + +<list> + <bullet>*Goal*: Store date *exactly* 4 months in the future</bullet> + <bullet>Store: ~timestamp~ and ~timezone identifier~ (%America/Montreal%)</bullet> + <bullet>Current date/time: Jun 1st, 13:00 EDT (%1338570000%)</bullet> + <bullet>Future date/time: Oct 1st, 13:00 EDT (%1349110800%)</bullet> + <bullet>Local time for Santiago can also be calculated with the ~timestamp~ and its ~timezone identifier~ (%America/Santiago%).</bullet> + <bullet>*Conclusion*: Storing ~timestamp~ and ~timezone identifier~ allows you to convert to local time</bullet> +</list> +</slide> diff --git a/slides/time/in-database3.xml b/slides/time/in-database3.xml new file mode 100644 index 0000000..12b4b40 --- /dev/null +++ b/slides/time/in-database3.xml @@ -0,0 +1,24 @@ +<slide> +<title>Storing date/time in a database</title> +<subtitle>Timestamp and timezone identifier?</subtitle> + +<div effect='fade-out'> +<image filename="utc-point2.png"/> + +<blurb>Then somebody change the timezone database rules:</blurb> +<list> + <bullet>%America/Montreal, 1349110800% → ---Oct 1st, 13:00 EDT---</bullet> + <bullet>%America/Montreal, 1349110800% → *Oct 1st, 12:00 EST* ☹</bullet> +</list> +</div> + +<div effect='fade-in'> +<image filename="utc-point3.png"/> + +<blurb>You can store it as:</blurb> +<list> + <bullet>%America/Montreal, 2012 10 1 13 0 0% → Oct 1st, 13:00 EDT</bullet> + <bullet>That however, changes the original point in time...</bullet> +</list> +</div> +</slide> diff --git a/slides/time/in-database4.xml b/slides/time/in-database4.xml new file mode 100644 index 0000000..df8532d --- /dev/null +++ b/slides/time/in-database4.xml @@ -0,0 +1,26 @@ +<slide> +<title>Storing date/time in a database</title> +<subtitle>Conclusion</subtitle> + +<blurb>If you want to future proof a specific date and time (Oct 1st, +13:00)-ie, storing a time in *local time*:</blurb> +<example><![CDATA[{ + 'title' : 'Giving a talk: Advanced Date/Time handling with PHP', + 'time' : { + 'tz': 'America/Montreal', + 'dt': '2012-10-01 13:00', + } +}]]></example> +<break /> + +<blurb>If you want to store a time for an appointment for a group of people +all in different timezones-ie, store a *specific point in time*:</blurb> +<example><![CDATA[{ + 'title' : 'Meeting about getting rid of Daylight Saving Time', + 'time' : { + 'tz': 'America/Montreal', + 'ts': 1349110800, + }, + 'attendees' : [ 'Arthur David Olson', 'Paul Eggert' ], +}]]></example> +</slide> diff --git a/slides/time/intervals-2.xml b/slides/time/intervals-2.xml index 5239b13..11d6d13 100644 --- a/slides/time/intervals-2.xml +++ b/slides/time/intervals-2.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Intervals (PHP 5.3)</title> + <title>Intervals</title> <subtitle>Applying an interval</subtitle> <example result="0"><![CDATA[<?php -$d = new DateTime( 'August 27th, 2009' ); +$d = new DateTime( 'May 29th, 2012' ); echo $d->format( "l Y-m-d\n" ); $i = DateInterval::createFromDateString( "next weekday" ); diff --git a/slides/time/intervals.xml b/slides/time/intervals.xml index 975891a..649e8f4 100644 --- a/slides/time/intervals.xml +++ b/slides/time/intervals.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Intervals (PHP 5.3)</title> + <title>Intervals</title> <subtitle>Creating an interval</subtitle> <example result="1"><![CDATA[<?php @@ -12,7 +12,7 @@ $i = new DateInterval( 'P3DT6H' ); // from a difference $d1 = new DateTime(); -$d2 = new DateTime( "2010-10-10 10:10 Europe/Amsterdam" ); +$d2 = new DateTime( "2012-05-29 15:26 Europe/Amsterdam" ); $i = $d1->diff( $d2 ); // displaying the difference diff --git a/slides/time/period-2.xml b/slides/time/period-2.xml index 108791b..5df7ea0 100644 --- a/slides/time/period-2.xml +++ b/slides/time/period-2.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Periods (PHP 5.3)</title> + <title>Periods</title> <subtitle>Iterating over a period</subtitle> <example result="1"><![CDATA[<?php diff --git a/slides/time/timestamps-suck.xml b/slides/time/timestamps-suck.xml index 15e65a3..8bd77e0 100644 --- a/slides/time/timestamps-suck.xml +++ b/slides/time/timestamps-suck.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Problems with timestamps and timezones</title> + <title>Unix timestamps and timezones</title> <example result="1"><![CDATA[<?php $date = strtotime( '2010-03-07 20:48:21 America/Toronto' ); @@ -10,14 +10,11 @@ <div effect="hide"> <blurb>Explanation:</blurb> - <blurb effect="fade-out" class='pre'> 2010-03-07 20:48:21 America/Toronto</blurb> - <blurb effect="fade-in-out" class='pre'> |ef2929|1268012901| - - string is turned into a number</blurb> - <blurb effect="fade-in" class='pre'> 2010-03-08 |555753|01:48:21 Europe/London| - - number is converted to a date/time string using - the *default* timezone</blurb> + <blurb class='pre'>$date = strtotime( '2010-03-07 20:48:21 America/Toronto' );</blurb> + <blurb effect="fade-in" class='pre'>$date = |ef2929|1268012901|; // string is turned into a number</blurb> + <blurb effect="fade-in" class='pre'>echo date( 'Y-m-d', 1268012901 ), "\n";</blurb> + <blurb effect="fade-in">Number is converted to a date/time string using the *default* timezone:</blurb> + <blurb effect="fade-in" class='pre'>"2010-03-08" |555753|(01:48:21 Europe/London)|</blurb> </div> </slide> diff --git a/slides/time/utc-database1.png b/slides/time/utc-database1.png new file mode 100644 index 0000000..e0dc39c Binary files /dev/null and b/slides/time/utc-database1.png differ diff --git a/slides/time/utc-database2.png b/slides/time/utc-database2.png new file mode 100644 index 0000000..e5b0c21 Binary files /dev/null and b/slides/time/utc-database2.png differ diff --git a/slides/time/utc-point1.png b/slides/time/utc-point1.png new file mode 100644 index 0000000..b45e318 Binary files /dev/null and b/slides/time/utc-point1.png differ diff --git a/slides/time/utc-point2.png b/slides/time/utc-point2.png new file mode 100644 index 0000000..6c7cded Binary files /dev/null and b/slides/time/utc-point2.png differ diff --git a/slides/time/utc-point3.png b/slides/time/utc-point3.png new file mode 100644 index 0000000..f394870 Binary files /dev/null and b/slides/time/utc-point3.png differ diff --git a/slides/xdebug/trace-tools.xml b/slides/xdebug/trace-tools.xml index 2631360..44cfeaa 100644 --- a/slides/xdebug/trace-tools.xml +++ b/slides/xdebug/trace-tools.xml @@ -8,14 +8,14 @@ php ~/dev/php/xdebug/trunk/contrib/tracefile-analyser.php time-own 5 ... Showing the 5 most costly calls sorted by 'time-own'. - Inclusive Own -function #calls time memory time memory -------------------------------------------------------------------------------------------------- -array_pop 715 1.0252 -139880 1.0252 -139880 -preg_match 2986 0.3718 1016336 0.3718 1016336 -{main} 1 6.4562 7335704 0.3476 -15198832 -next 432 0.2386 0 0.2386 0 -count 3302 0.2132 0 0.2123 0 + Inclusive Own +function #calls time memory time memory +------------------------------------------------------------------------------- +array_pop 715 1.0252 -139880 1.0252 -139880 +preg_match 2986 0.3718 1016336 0.3718 1016336 +{main} 1 6.4562 7335704 0.3476 -15198832 +next 432 0.2386 0 0.2386 0 +count 3302 0.2132 0 0.2123 0 </example> </div> <div effect="fade-in-out"> diff --git a/slides/xdebug/why-debugger3.xml b/slides/xdebug/why-debugger3.xml index 721c41e..fe381a3 100644 --- a/slides/xdebug/why-debugger3.xml +++ b/slides/xdebug/why-debugger3.xml @@ -1,5 +1,5 @@ <slide> - <title>I Do Need a Debugger</title> + <title>Debugger and Profiler</title> <image filename="xdebug-logo.png" pdf-scale="0.6"/> <list> @@ -7,6 +7,6 @@ <bullet>About 10 years old</bullet> <bullet>Works on "every" operating system</bullet> <bullet>PHP 5.1, 5.2, 5.3, 5.4 and trunk</bullet> - <bullet>Version 2.2 about to follow with PHP 5.4</bullet> + <bullet>Version 2.2 just out</bullet> </list> </slide> diff --git a/time-ipc2012s.xml b/time-ipc2012s.xml new file mode 100644 index 0000000..fe9f6fc --- /dev/null +++ b/time-ipc2012s.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen.css"> +<topic>Localization and Internationalization</topic> +<title>Advanced Date/Time Handling</title> +<event>International PHP Conference</event> +<location>Berlin, Germany</location> +<date>Jun 4th, 2010</date> +<speaker>Derick Rethans</speaker> +<email>derick@php.net</email> +<url>http://derickrethans.nl/talks.html</url> +<joindin></joindin> +<twitter>derickr</twitter> + +<slide>slides/mongodb/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<!-- INTRODUCTION --> +<slide>slides/time/problems-condensed.xml</slide> + +<!-- PHP - IMPROVEMENTS --> +<slide>slides/time/improvements-timezones.xml</slide> +<slide>slides/time/improvements-more-on-timezones.xml</slide> +<slide>slides/time/default-timezone.xml</slide> +<slide>slides/time/timestamps-suck.xml</slide> + +<!-- PHP - CODE EXAMPLES --> +<slide>slides/time/basic-parse-time-new.xml</slide> +<slide>slides/time/date-parse2.xml</slide> +<slide>slides/time/date-parse-from-format3.xml</slide> +<slide>slides/time/date-parse-from-format2.xml</slide> + +<!-- DATE EXAMPLES --> +<slide>slides/time/date-modify.xml</slide> +<slide>slides/time/timezone-object-1.xml</slide> +<slide>slides/time/date-timezone.xml</slide> +<slide>slides/time/timezone-utilities-3.xml</slide> + +<!-- INTERVALS and PERIODS --> +<slide>slides/time/intervals.xml</slide> +<slide>slides/time/intervals-2.xml</slide> +<slide>slides/time/relative-month.xml</slide> +<slide>slides/time/relative-month3.xml</slide> +<slide>slides/time/period-2.xml</slide> + +<!-- STORING in DATABASE --> +<slide>slides/time/in-database1.xml</slide> +<slide>slides/time/in-database2.xml</slide> +<slide>slides/time/in-database3.xml</slide> +<slide>slides/time/in-database4.xml</slide> + +<!-- EXIT --> +<slide>slides/time/book.xml</slide> <!-- resources --> +<slide>slides/mongodb/resources.xml</slide> <!-- resources --> + +<slide>slides/dbus/end.xml</slide> +</presentation>