Introduction to Reinforcement Learning E0397 Lecture Slides by Richard Sutton (With small changes)
Slides changes symfony23
-
Upload
javier-lopez -
Category
Documents
-
view
354 -
download
0
Transcript of Slides changes symfony23
martes 25 de junio de 13
Who am I
martes 25 de junio de 13
I was born in Córdoba
I work in London
Javier López
martes 25 de junio de 13
I’ve workedIPC Media y Sensio Labs UK
I work at
TimeOutI organize
deSymfony
martes 25 de junio de 13
Reasons to upgrade to Symfony 2.3
martes 25 de junio de 13
#1
Stable for products and companies
martes 25 de junio de 13
2012 2013 2014 2015 2016 2017
2.0
2.1
2.2
2.3
2.4
2.5
2.6
2.7StabilisationMaintenance
Development
martes 25 de junio de 13
2012 2013 2014 2015 2016 2017
2.0
2.1
2.2
2.3
2.4
2.5
2.6
2.7EstabilizaciónMantenimiento
Desarrollo
First LTS of the 2.x era
martes 25 de junio de 13
2012 2013 2014 2015 2016 2017
2.0
2.1
2.2
2.3
2.4
2.5
2.6
2.7EstabilizaciónMantenimiento
Desarrollo
Backwards compatibility
First LTS of the 2.x era
martes 25 de junio de 13
#2
Less coupled architecture
martes 25 de junio de 13
BrowserKit
Finder
Locale
Routing
ClassLoader Config Console CssSelector
DI DomCrawler EventDispatcher Filesystem
Form HttpFoundation HttpKernel
Process
Security Serializer Templating
Translation Validator
Yaml
22 components2.0
martes 25 de junio de 13
BrowserKit
Finder
Locale
Routing
ClassLoader Config Console CssSelector
DI DomCrawler EventDispatcher Filesystem
Form HttpFoundation HttpKernel
OptionsResolver Process
Security Serializer Templating
Translation Validator
Yaml
23 components2.12.0
martes 25 de junio de 13
BrowserKit
Finder
Locale
Routing
ClassLoader Config Console CssSelector
DI DomCrawler EventDispatcher Filesystem
Form HttpFoundation HttpKernel
OptionsResolver Process PropertyAccess
Security Serializer Stopwatch Templating
Translation Validator
Yaml
25 components2.22.12.0
martes 25 de junio de 13
BrowserKit
Debug
Finder
Locale
Routing
ClassLoader Config Console CssSelector
DI DomCrawler EventDispatcher Filesystem
Form HttpFoundation HttpKernel Intl
OptionsResolver Process PropertyAccess
Security Serializer Stopwatch Templating
Translation Validator
Yaml
2.3 27 components2.22.12.0
martes 25 de junio de 13
#3
More documentation
martes 25 de junio de 13
2.0
20
109
51
Book
Cookbook
2.1
20
118
58
Components
20
120
63
2.2
20
123
68
2.3
# pages
martes 25 de junio de 13
#4
Easier to debug
martes 25 de junio de 13
More levels of verbosity
$ php app/console foo --verbose=1 # -v $ php app/console foo --verbose=2 # -vv $ php app/console foo --verbose=3 # -vvv
martes 25 de junio de 13
class MyCommand extends Command{ protected function execute($input, $output) { $verbosity = $output->getVerbosity();
if ($verbosity === OutputInterface::VERBOSITY_VERBOSE) { $output->writeln("Information"); }
if ($verbosity === OutputInterface::VERBOSITY_VERY_VERBOSE) { $output->writeln("More information"); }
if ($verbosity === OutputInterface::VERBOSITY_DEBUG) { $output->writeln("Even more information"); }}
martes 25 de junio de 13
configuration parameters
$ console container:debug --parameters
$ console container:debug --parameter=kernel.debug
martes 25 de junio de 13
stack trace en plain text
martes 25 de junio de 13
more information in router:match
$ php app/console router:match /demo/hello/fabienRoute "_demo_hello" matches
[router] Route "_demo_hello"Name _demo_helloPath /demo/hello/{name}Host ANYScheme ANYMethod ANYClass Symfony\Component\Routing\RouteDefaults _controller: Acme\DemoBundle\Controller\DemoController::helloActionRequirements NO CUSTOMOptions compiler_class: Symfony\Component\Routing\RouteCompilerPath-Regex #^/demo/hello/(?P<name>[^/]++)$#s
martes 25 de junio de 13
Debug component
martes 25 de junio de 13
echo $foo
martes 25 de junio de 13
Notice: Undefined variable: foo in index.php on line 1
martes 25 de junio de 13
use Symfony\Component\Debug\Debug;
Debug::$enable();
echo $foo;
martes 25 de junio de 13
PHP Fatal error: Uncaught exception 'Symfony\Component\Debug\Exception\ContextErrorException' with message 'Notice: Undefined variable: foo in index.php line 9' in index.php:9
Stack trace:#0 index.php(9): Symfony\Component\Debug\ErrorHandler->handle(8, 'Undefined varia...', '/Users/loalf/Pr...', 9, Array)#1 {main} thrown in index.php on line 9
martes 25 de junio de 13
martes 25 de junio de 13
#5
A mightier console
martes 25 de junio de 13
Events
martes 25 de junio de 13
martes 25 de junio de 13
$ php app/console fooCommand
martes 25 de junio de 13
console.command
$ php app/console fooCommand
martes 25 de junio de 13
console.command
$ php app/console fooCommand
fooCommand::run()
martes 25 de junio de 13
console.command
$ php app/console fooCommand
fooCommand::run()
console.exception
martes 25 de junio de 13
console.command
$ php app/console fooCommand
fooCommand::run()
console.terminate
console.exception
martes 25 de junio de 13
martes 25 de junio de 13
Listener.php
martes 25 de junio de 13
namespace Acme\DemoBundle;
class Listener{ public function onCommand($event) { // your code }}
Listener.php
martes 25 de junio de 13
namespace Acme\DemoBundle;
class Listener{ public function onCommand($event) { // your code }}
Listener.php
martes 25 de junio de 13
parameters.yml
namespace Acme\DemoBundle;
class Listener{ public function onCommand($event) { // your code }}
Listener.php
martes 25 de junio de 13
services: acme.console.listener: class: Acme\DemoBundle\Listener tags: - name: kernel.event_listener event: console.command method: onCommand
parameters.yml
namespace Acme\DemoBundle;
class Listener{ public function onCommand($event) { // your code }}
Listener.php
martes 25 de junio de 13
tables
martes 25 de junio de 13
+---------------+--------------------------+------------------+| ISBN | Title | Author |+---------------+--------------------------+------------------+| 99921-58-10-7 | Divine Comedy | Dante Alighieri || 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens || 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien || 80-902734-1-6 | And Then There Were None | Agatha Christie |+---------------+--------------------------+------------------+
martes 25 de junio de 13
$table = $app->getHelperSet()->get('table');$table ->setHeaders(array('ISBN', 'Title', 'Author')) ->setRows(array( array('99921-58-10-7', 'Divine Comedy', 'Dante ...'), array('9971-5-0210-0', 'A Tale of Two Cities', '...'), array('960-425-059-0', 'The Lord of the Rings', '...'), array('80-902734-1-6', 'And Then There Were None', '...'), ));$table->render($output);
martes 25 de junio de 13
=============== ========================== ================== ISBN Title Author =============== ========================== ================== 99921-58-10-7 Divine Comedy Dante Alighieri 9971-5-0210-0 A Tale of Two Cities Charles Dickens 960-425-059-0 The Lord of the Rings J. R. R. Tolkien 80-902734-1-6 And Then There Were None Agatha Christie =============== ========================== ==================
martes 25 de junio de 13
$table = $app->getHelperSet()->get('table');$table ->setHeaders(array('ISBN', 'Title', 'Author')) ->setLayout(TableHelper::LAYOUT_BORDERLESS) ->setRows(array( array('99921-58-10-7', 'Divine Comedy', 'Dante ...'), array('9971-5-0210-0', 'A Tale of Two Cities', '...'), array('960-425-059-0', 'The Lord of the Rings', '...'), array('80-902734-1-6', 'And Then There Were None', '...'), ));$table->render($output);
->setLayout(TableHelper::LAYOUT_BORDERLESS)
martes 25 de junio de 13
|···············|··························|··················|| ISBN | Title | Author ||···············|··························|··················|| 99921-58-10-7 | Divine Comedy | Dante Alighieri || 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens || 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien || 80-902734-1-6 | And Then There Were None | Agatha Christie ||···············|··························|··················|
martes 25 de junio de 13
$table = $this->getHelperSet()->get('table');$table ->setHorizontalBorderChar("·") ->setCrossingChar( "<fg=white;bg=red>|</fg=white;bg=red>" ) ->setVerticalBorderChar( "<fg=white;bg=red>|</fg=white;bg=red>" );
martes 25 de junio de 13
#6
Better performance
martes 25 de junio de 13
class HeavyService{
public function __construct() { sleep(10); }
public function doFoo() { echo “foo”; }
}
martes 25 de junio de 13
class LightService{
public function __construct($service) { $this->service = $service; }
public function doFoo() { $this->service->doFoo(); }
public function doBar() { echo “bar”; }
}
martes 25 de junio de 13
services: acme.demo.heavy_service: class: Acme\DemoBundle\HeavyService
acme.demo.light_service: class: Acme\DemoBundle\LightService arguments: [@acme.demo.heavy_service]
martes 25 de junio de 13
class DemoController extends Controller{ $ls = $this->get(‘acme.demo.light_service’); $ls->doBar();}
martes 25 de junio de 13
class DemoController extends Controller{ $ls = $this->get(‘acme.demo.light_service’); $ls->doBar();}
10220ms
martes 25 de junio de 13
services: acme.demo.heavy_service: class: Acme\DemoBundle\HeavyService lazy: true
acme.demo.light_service: class: Acme\DemoBundle\LightService arguments: [@acme.demo.heavy_service]
martes 25 de junio de 13
class DemoController extends Controller{ $ls = $this->get(‘acme.demo.light_service’); $ls->doBar();}
martes 25 de junio de 13
220ms
class DemoController extends Controller{ $ls = $this->get(‘acme.demo.light_service’); $ls->doBar();}
martes 25 de junio de 13
class DemoController extends Controller{ $ls = $this->get(‘acme.demo.light_service’); $ls->doFoo();}
martes 25 de junio de 13
10220ms
class DemoController extends Controller{ $ls = $this->get(‘acme.demo.light_service’); $ls->doFoo();}
martes 25 de junio de 13
composer require ocramius/proxy-manager
martes 25 de junio de 13
#7
More validators
martes 25 de junio de 13
•Currency
•IBAN - International Bank Account Number
Banking
martes 25 de junio de 13
• ISBN - International Standard Book Number
•ISSN - International Standard Serial Number
Publications
martes 25 de junio de 13
•EqualTo
•NotEqualTo
•IdenticalTo
•NotIdenticalTo
Comparison
•LessThan
•LessThanOrEqual
•GreaterThan
•GreaterThanOrEqual
martes 25 de junio de 13
#8
More HTML5 compliant
martes 25 de junio de 13
Message
Name
Surname
Burritos web
Andele. Contactanos.
send
martes 25 de junio de 13
Message
Name
Surname
Burritos web
Andele. Contactanos.
send
<textarea form=my_form>
martes 25 de junio de 13
$form = $crawler->selectButton('send') ->getForm();
$values = $form->getValues(); $keys = array_keys($values)
2.3<sf
martes 25 de junio de 13
$form = $crawler->selectButton('send') ->getForm();
$values = $form->getValues(); $keys = array_keys($values)
2.3<sf
#'name', 'surname', 'email'
martes 25 de junio de 13
$form = $crawler->selectButton('send') ->getForm();
$values = $form->getValues(); $keys = array_keys($values)
2.3=sf
martes 25 de junio de 13
$form = $crawler->selectButton('send') ->getForm();
$values = $form->getValues(); $keys = array_keys($values)
2.3=sf
#'name', 'surname', 'email', 'message'
martes 25 de junio de 13
#9
Easier to use
martes 25 de junio de 13
parameters.yml generation
martes 25 de junio de 13
> composer install
Generating autoload filesCreating the "app/config/parameters.yml" file.Some parameters are missing. Please provide them.database_driver (pdo_mysql):database_host (127.0.0.1):database_port (null):database_name (symfony):database_user (root):database_password (null):mailer_transport (smtp):mailer_host (127.0.0.1):mailer_user (null):mailer_password (null):locale (en):secret (ThisTokenIsNotSoSecretChangeIt):
martes 25 de junio de 13
#*
And even more things
martes 25 de junio de 13
What we will see inSymfony 2.4
martes 25 de junio de 13
Besides the few pull requests that already target 2.4, I have one topic that I want us to work on for 2.4: **performance**
martes 25 de junio de 13
https://groups.google.com/forum/#!topic/symfony-devs/rwN1gwuHEC4
martes 25 de junio de 13
martes 25 de junio de 13
AdminBundle
martes 25 de junio de 13
CacheAdminBundle
martes 25 de junio de 13
Cache
RAD
AdminBundle
martes 25 de junio de 13
Cache
RADREST
AdminBundle
martes 25 de junio de 13
KEEPCALM
AND
UPGRADESYMFONY
martes 25 de junio de 13
Thanks. Questions?FYI, TimeOut is recruiting
http://joind.in/talk/view/8853
@loalf
martes 25 de junio de 13