Upcoming SlideShare
×

# The small things

1,611 views
1,539 views

Published on

4 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
1,611
On SlideShare
0
From Embeds
0
Number of Embeds
121
Actions
Shares
0
35
0
Likes
4
Embeds 0
No embeds

No notes for slide

### The small things

1. 1. The small things Augusto PascuttiMonday, August 22, 2011
2. 2. “Na teoria, teoria e prática são a mesma coisa. Na prática, não! Yoggi BerraMonday, August 22, 2011
3. 3. Existem 10 tipos de pessoas ... Piada (infame) nerdMonday, August 22, 2011
4. 4. 1 <?php2 echo (int) ( (0.1+0.7) * 10 );3Monday, August 22, 2011
5. 5. 1 <?php2 echo (int) ( (0.1+0.7) * 10 );3 // Output: 7Monday, August 22, 2011
6. 6. 1 <?php2 \$foo = 5 + "10 patos";3 var_dump(\$foo);4Monday, August 22, 2011
7. 7. 1 <?php2 \$foo = 5 + "10 patos";3 var_dump(\$foo);4 // Output: int(15)Monday, August 22, 2011
8. 8. 1 <?php2 \$foo = "5 galinhas" + "10 patos";3 var_dump(\$foo);4 // Output: int(15)Monday, August 22, 2011
9. 9. 1 <?php2 \$foo = "5 galinhas" + 10;3 var_dump(\$foo);4 // Output: int(15)Monday, August 22, 2011
10. 10. 1 <?php2 \$s = barra;3 \$s[0] = f;4 echo \$s;5 // output: farraMonday, August 22, 2011
11. 11. 1 <?php2 \$a = 010;3 \$b = 1;4 \$x = \$a + \$b;5 var_dump(\$x);6Monday, August 22, 2011
12. 12. 1 <?php2 \$a = 010;3 \$b = 1;4 \$x = \$a + \$b;5 var_dump(\$x);6 // Output: int(9)Monday, August 22, 2011
13. 13. 1 <?php2 \$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. 14. 1 <?php2 \$a = array(1, 2);3 \$a[] = 3;4 \$a[0.1] = 4;5 print_r(\$a);6 // Array7 // (8 // [0] => 49 // [1] => 210 // [2] => 311 // )Monday, August 22, 2011
15. 15. 1 <?php2 \$a = array(1, 2);3 \$a[] = 3;4 \$a[0.1] = 4;5 \$a[0.1] = 5;6 print_r(\$a);7 // Array8 // (9 // [0] => 410 // [1] => 211 // [2] => 312 // [0.1] => 513 // )Monday, August 22, 2011
16. 16. 1 <?php2 echo round(-0.4); // -03 echo round(-0.5); // -14 echo round(0.4); // 05 echo round(0.5); // 1Monday, August 22, 2011
17. 17. 1 <?php2 echo number_format(-0.4, 0); // -03 echo number_format(-0.5, 0); // -14 echo number_format(0.4, 0); // 05 echo number_format(0.5, 0); // 1Monday, August 22, 2011
18. 18. 1 <?php2 \$s = "é";3 echo strlen(\$s);4Monday, August 22, 2011
19. 19. 1 <?php2 \$s = "é";3 echo strlen(\$s);4 // Output: 2Monday, August 22, 2011
20. 20. 1 <?php2 echo HELLO;3 // Output HELLOMonday, August 22, 2011
21. 21. 1 <?php2 error_reporting(E_ALL & E_STRICT);Monday, August 22, 2011
22. 22. 1 \$z = America/Sao_Paulo;2 date_default_timezone_set(\$z);3 \$s = date(c);4 // \$s=2011-07-08T23:29:56-03:005 \$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/2011Monday, August 22, 2011
23. 23. 1 <?php2 \$s = Rails -> Fails;3 echo htmlentities(\$s);4 // Output: Rails -&gt; FailsMonday, August 22, 2011
24. 24. 1 <?php2 // PHP >= 53 \$a = new StdClass();4 \$a->name = Cleo;5 \$b = \$a;6 \$b->name = Patra;7 echo \$a->name;8 // Output: PatraMonday, August 22, 2011
25. 25. 1 <?php2 function up(\$o) {3 \$n = strtoupper(\$o->name);4 \$o->name = \$n;5 }67 \$a = new StdClass();8 \$a->name = Cleo;9 up(\$a);10 echo \$a->name;11 // Output: CLEOMonday, August 22, 2011
26. 26. “Cursos de computação produzem bons programadores tanto quanto estudar pincéis e pigmentação produzem bons pintores” Eric RaymondMonday, August 22, 2011
27. 27. Leia (Tire suas próprias conclusões)Monday, August 22, 2011
28. 28. Pratique (Open Source)Monday, August 22, 2011
29. 29. “Você nunca vai saber que um programador está fazendo merda até ser tarde demais.” Seymour CrayMonday, August 22, 2011
30. 30. Métodos ágeis (Entregue pouco, muitas vezes)Monday, August 22, 2011
31. 31. Dúvidas? Slides, comentários e brinders: http://joind.in/3650Monday, August 22, 2011