This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from slackclient import SlackClient | |
slack_token = "xxxxxxxxxxxxxxx" | |
sc = SlackClient(slack_token) | |
result = sc.api_call( | |
"users.list" | |
) |
This file contains hidden or 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 | |
require 'vendor/autoload.php'; | |
use GuzzleHttp\Client; | |
class Qiita | |
{ | |
private $client; | |
private $accessToken; | |
private $headers; |
This file contains hidden or 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 | |
/** | |
* ex: echo perceptron("nand", 0, 1); | |
* @param $type "and" or "nand" or "or" | |
* @param $x1 | |
* @param $x2 | |
* @return int | |
*/ | |
function perceptron(string $type, int $x1, int $x2){ |
This file contains hidden or 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 | |
//echo perceptron_xor(1, 1); | |
/** | |
* Created by PhpStorm. | |
* User: kure | |
* Date: 11/14/17 | |
* Time: 1:37 PM | |
*/ |
This file contains hidden or 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
import numpy as np | |
x = np.array([-1.0, 1.0, 2.0]) | |
print(type(x)) | |
print(x) | |
y = x > 0 | |
print(type(y)) | |
print(y) | |
z = y.astype(np.int) |
This file contains hidden or 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
import numpy as np | |
x = np.arange(-5.0, 5.0, 1.0) | |
print(type(x)) | |
print(x) |
This file contains hidden or 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 | |
function test($t, $s){ | |
echo $t.PHP_EOL; | |
echo $s.PHP_EOL; | |
} | |
call_user_func("test", "2", "3"); |
This file contains hidden or 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 | |
function merge(string $str1 = null, string $str2){ | |
$str = $str1.$str2; | |
return $str; | |
} | |
$arr = array("str1", "str2", "str3", "str4"); |
This file contains hidden or 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 | |
class Test{ | |
private $arr; | |
/** | |
* @param $v1 プロパティの名前 | |
* @param $v2 値 | |
*/ | |
public function __set($v1, $v2){ | |
echo "__set".PHP_EOL; |
This file contains hidden or 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 | |
class Test{ | |
public function __get($name) | |
{ | |
echo $name.PHP_EOL; | |
} | |
} | |
$test = new Test(); | |
$test->hogehoge; |
OlderNewer