This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
items = ["2", "4", "8"] | |
for r in map(int, items): | |
print(isinstance(r, int)) | |
""" | |
output | |
True | |
True | |
True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
$content = fopen($argv[1], "r"); | |
while (($line = fgets($content)) !== false) { | |
$ary = preg_split("/[\s]/", $line); | |
$str = $ary[1]; | |
$pattern = preg_split("/[\\+\-]/", $ary[1]); | |
foreach (str_split($pattern[0]) as $val) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($ary as $val) { | |
$val[0] = strtoupper($val[0]); | |
.... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = array(); | |
$data[] = 'hoge'; | |
$data[] = 'foo'; | |
// この間50行くらい | |
// あ、$dataは配列なのか、と想定してコード読める | |
function typeHinting(array $data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait Access | |
{ | |
public function destination($to_where) | |
{ | |
echo $to_where; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class Working | |
{ | |
abstract protected function where(); | |
abstract protected function why(); | |
abstract protected function how(); | |
public function work() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class Working | |
{ | |
abstract protected function where(); | |
abstract protected function why(); | |
abstract protected function how(); | |
public function work() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Access { | |
function howTo() { | |
echo "HowTo"; | |
} | |
} | |
class Company { | |
use Access; | |
} | |
$access = new Company(); | |
$access->howTo(); // HowTo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main | |
$("#hoge").click(function () { | |
console.log("function main start"); | |
// 適当なメソッド | |
console.log("method animate start"); | |
var value; | |
$("#foo").animate({ | |
right: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i=0; i < 10; i++) | |
{ | |
console.log(hoge); | |
// returnで無理矢理処理を終わらせる | |
return; | |
// ここら辺でエラーでる | |
if (hoge < 10) return true; | |
} |
OlderNewer