ݺߣ

ݺߣShare a Scribd company logo
The small things
                               Augusto Pascutti
Monday, August 22, 2011
“Na teoria, teoria e prática são a
           mesma coisa. Na prática, não!



                                    Yoggi Berra


Monday, August 22, 2011
Existem 10 tipos de pessoas ...



                                 Piada (infame) nerd


Monday, August 22, 2011
1 <?php
2 echo (int) ( (0.1+0.7) * 10 );
3




Monday, August 22, 2011
1 <?php
2 echo (int) ( (0.1+0.7) * 10 );
3 // Output: 7




Monday, August 22, 2011
1 <?php
2 $foo = 5 + "10 patos";
3 var_dump($foo);
4




Monday, August 22, 2011
1      <?php
2      $foo = 5 + "10 patos";
3      var_dump($foo);
4      // Output: int(15)




Monday, August 22, 2011
1      <?php
2      $foo = "5 galinhas" + "10 patos";
3      var_dump($foo);
4      // Output: int(15)




Monday, August 22, 2011
1      <?php
2      $foo = "5 galinhas" + 10;
3      var_dump($foo);
4      // Output: int(15)




Monday, August 22, 2011
1         <?php
2         $s    = 'barra';
3         $s[0] = 'f';
4         echo $s;
5         // output: farra



Monday, August 22, 2011
1         <?php
2         $a = 010;
3         $b = 1;
4         $x = $a + $b;
5         var_dump($x);
6


Monday, August 22, 2011
1         <?php
2         $a = 010;
3         $b = 1;
4         $x = $a + $b;
5         var_dump($x);
6         // Output: int(9)


Monday, August 22, 2011
1 <?php
2 $a = 010;
3 $b = 1;
4 $x = $a + $b;
5 var_dump($a, $b);
6 /**
7 * Output:
8 * int(8)
9 * int(1)
10 */
Monday, August 22, 2011
1 <?php
2 $a      = array('1', '2');
3 $a[]    = 3;
4 $a[0.1] = 4;
5 print_r($a);
6 // Array
7 // (
8 //      [0] => 4
9 //      [1] => 2
10 //     [2] => 3
11 // )


Monday, August 22, 2011
1 <?php
2 $a        = array('1', '2');
3 $a[]      = 3;
4 $a[0.1]   = 4;
5 $a['0.1'] = 5;
6 print_r($a);
7 // Array
8 // (
9 //      [0]    => 4
10 //     [1]    => 2
11 //     [2]    => 3
12 //     [0.1] => 5
13 // )

Monday, August 22, 2011
1      <?php
2      echo round(-0.4);   //   -0
3      echo round(-0.5);   //   -1
4      echo round(0.4);    //   0
5      echo round(0.5);    //   1




Monday, August 22, 2011
1      <?php
2      echo number_format(-0.4,   0);   //   -0
3      echo number_format(-0.5,   0);   //   -1
4      echo number_format(0.4,    0);   //   0
5      echo number_format(0.5,    0);   //   1




Monday, August 22, 2011
1 <?php
2 $s = "é";
3 echo strlen($s);
4




Monday, August 22, 2011
1      <?php
2      $s = "é";
3      echo strlen($s);
4      // Output: 2




Monday, August 22, 2011
1 <?php
2 echo HELLO;
3 // Output HELLO




Monday, August 22, 2011
1 <?php
2 error_reporting(E_ALL & E_STRICT);




Monday, August 22, 2011
1 $z = 'America/Sao_Paulo';
2 date_default_timezone_set($z);

3      $s        = date('c');
4      //        $s='2011-07-08T23:29:56-03:00'
5      $t        = strtotime($s);
6      //        $t=1310178596;

7 $d = strtotime('+8 HOUR', $t);
8 // $d=1310207396;
9 echo date('d/m/Y', $d);
10 // Output: 09/07/2011

Monday, August 22, 2011
1      <?php
2      $s = 'Rails -> Fails';
3      echo htmlentities($s);
4      // Output: Rails -&gt; Fails




Monday, August 22, 2011
1      <?php
2      // PHP >= 5
3      $a = new StdClass();
4      $a->name = 'Cleo';
5      $b = $a;
6      $b->name = 'Patra';
7      echo $a->name;
8      // Output: Patra




Monday, August 22, 2011
1 <?php
2 function up($o) {
3     $n = strtoupper($o->name);
4     $o->name = $n;
5 }
6
7 $a = new StdClass();
8 $a->name = 'Cleo';
9 up($a);
10 echo $a->name;
11 // Output: CLEO


Monday, August 22, 2011
“Cursos de computação produzem
      bons programadores tanto quanto
        estudar pincéis e pigmentação
          produzem bons pintores”

                            Eric Raymond


Monday, August 22, 2011
Leia
            (Tire suas próprias conclusões)




Monday, August 22, 2011
Pratique
                          (Open Source)




Monday, August 22, 2011
“Você nunca vai saber que um
         programador está fazendo merda
              até ser tarde demais.”

                              Seymour Cray


Monday, August 22, 2011
Métodos ágeis
             (Entregue pouco, muitas vezes)




Monday, August 22, 2011
ú岹?




                          ݺߣs, comentários e brinders: http://joind.in/3650
Monday, August 22, 2011

More Related Content

The small things

  • 1. The small things Augusto Pascutti Monday, August 22, 2011
  • 2. “Na teoria, teoria e prática são a mesma coisa. Na prática, não! Yoggi Berra Monday, August 22, 2011
  • 3. Existem 10 tipos de pessoas ... Piada (infame) nerd Monday, August 22, 2011
  • 4. 1 <?php 2 echo (int) ( (0.1+0.7) * 10 ); 3 Monday, August 22, 2011
  • 5. 1 <?php 2 echo (int) ( (0.1+0.7) * 10 ); 3 // Output: 7 Monday, August 22, 2011
  • 6. 1 <?php 2 $foo = 5 + "10 patos"; 3 var_dump($foo); 4 Monday, August 22, 2011
  • 7. 1 <?php 2 $foo = 5 + "10 patos"; 3 var_dump($foo); 4 // Output: int(15) Monday, August 22, 2011
  • 8. 1 <?php 2 $foo = "5 galinhas" + "10 patos"; 3 var_dump($foo); 4 // Output: int(15) Monday, August 22, 2011
  • 9. 1 <?php 2 $foo = "5 galinhas" + 10; 3 var_dump($foo); 4 // Output: int(15) Monday, August 22, 2011
  • 10. 1 <?php 2 $s = 'barra'; 3 $s[0] = 'f'; 4 echo $s; 5 // output: farra Monday, August 22, 2011
  • 11. 1 <?php 2 $a = 010; 3 $b = 1; 4 $x = $a + $b; 5 var_dump($x); 6 Monday, August 22, 2011
  • 12. 1 <?php 2 $a = 010; 3 $b = 1; 4 $x = $a + $b; 5 var_dump($x); 6 // Output: int(9) Monday, August 22, 2011
  • 13. 1 <?php 2 $a = 010; 3 $b = 1; 4 $x = $a + $b; 5 var_dump($a, $b); 6 /** 7 * Output: 8 * int(8) 9 * int(1) 10 */ Monday, August 22, 2011
  • 14. 1 <?php 2 $a = array('1', '2'); 3 $a[] = 3; 4 $a[0.1] = 4; 5 print_r($a); 6 // Array 7 // ( 8 // [0] => 4 9 // [1] => 2 10 // [2] => 3 11 // ) Monday, August 22, 2011
  • 15. 1 <?php 2 $a = array('1', '2'); 3 $a[] = 3; 4 $a[0.1] = 4; 5 $a['0.1'] = 5; 6 print_r($a); 7 // Array 8 // ( 9 // [0] => 4 10 // [1] => 2 11 // [2] => 3 12 // [0.1] => 5 13 // ) Monday, August 22, 2011
  • 16. 1 <?php 2 echo round(-0.4); // -0 3 echo round(-0.5); // -1 4 echo round(0.4); // 0 5 echo round(0.5); // 1 Monday, August 22, 2011
  • 17. 1 <?php 2 echo number_format(-0.4, 0); // -0 3 echo number_format(-0.5, 0); // -1 4 echo number_format(0.4, 0); // 0 5 echo number_format(0.5, 0); // 1 Monday, August 22, 2011
  • 18. 1 <?php 2 $s = "é"; 3 echo strlen($s); 4 Monday, August 22, 2011
  • 19. 1 <?php 2 $s = "é"; 3 echo strlen($s); 4 // Output: 2 Monday, August 22, 2011
  • 20. 1 <?php 2 echo HELLO; 3 // Output HELLO Monday, August 22, 2011
  • 21. 1 <?php 2 error_reporting(E_ALL & E_STRICT); Monday, August 22, 2011
  • 22. 1 $z = 'America/Sao_Paulo'; 2 date_default_timezone_set($z); 3 $s = date('c'); 4 // $s='2011-07-08T23:29:56-03:00' 5 $t = strtotime($s); 6 // $t=1310178596; 7 $d = strtotime('+8 HOUR', $t); 8 // $d=1310207396; 9 echo date('d/m/Y', $d); 10 // Output: 09/07/2011 Monday, August 22, 2011
  • 23. 1 <?php 2 $s = 'Rails -> Fails'; 3 echo htmlentities($s); 4 // Output: Rails -&gt; Fails Monday, August 22, 2011
  • 24. 1 <?php 2 // PHP >= 5 3 $a = new StdClass(); 4 $a->name = 'Cleo'; 5 $b = $a; 6 $b->name = 'Patra'; 7 echo $a->name; 8 // Output: Patra Monday, August 22, 2011
  • 25. 1 <?php 2 function up($o) { 3 $n = strtoupper($o->name); 4 $o->name = $n; 5 } 6 7 $a = new StdClass(); 8 $a->name = 'Cleo'; 9 up($a); 10 echo $a->name; 11 // Output: CLEO Monday, August 22, 2011
  • 26. “Cursos de computação produzem bons programadores tanto quanto estudar pincéis e pigmentação produzem bons pintores” Eric Raymond Monday, August 22, 2011
  • 27. Leia (Tire suas próprias conclusões) Monday, August 22, 2011
  • 28. Pratique (Open Source) Monday, August 22, 2011
  • 29. “Você nunca vai saber que um programador está fazendo merda até ser tarde demais.” Seymour Cray Monday, August 22, 2011
  • 30. Métodos ágeis (Entregue pouco, muitas vezes) Monday, August 22, 2011
  • 31. ú岹? ݺߣs, comentários e brinders: http://joind.in/3650 Monday, August 22, 2011