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 | |
use pocketmine\network\mcpe\protocol\AnimateEntityPacket; | |
$pk = AnimateEntityPacket::create("animation.idle_back_1", "none", "query.any_animation_finished", "", 2.0, [$player->getId()]); | |
$player->dataPacket($pk); |
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 | |
const N = 100000000; | |
$para_count = 12; | |
$parallel = new ParallelFor(function(int $c){ | |
$x = mt_rand() / mt_getrandmax(); | |
$y = mt_rand() / mt_getrandmax(); | |
if(($x**2 + $y**2)**2 < 1) $c++; | |
return $c; |
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 | |
//montecarlo | |
const N = 1000000000; | |
/*$counter = 0; | |
for($i=0;$i<N;$i++){ | |
$x = mt_rand() / mt_getrandmax(); | |
$y = mt_rand() / mt_getrandmax(); | |
if(($x**2 + $y**2)**2 < 1) $counter++; | |
} |
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 | |
use pocketmine\event\player\PlayerJoinEvent; | |
use bossbarapi\bossbar\BossBar; | |
class api_usage { | |
function onJoin(PlayerJoinEvent $ev){ | |
$player = $ev->getPlayer(); | |
$bossBar = BossBar::create($player); | |
$bossBar->setTitle("Sample"); |
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 | |
// Your code here! | |
class Switcher { | |
public static $calls = []; | |
public static function register($case, Closure $callback){ | |
self::$calls[$case] = new Executor($callback); | |
} | |
public static function onCase($case){ |
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
<html> | |
<head> | |
<title>TEST</title> | |
</head> | |
<body> | |
<div id="editor" style="height: 600px" oninput="input(this)" onkeyup="input(this)"></div> | |
<script> | |
function GetQueryString() { | |
var result = {}; | |
if (1 < window.location.search.length) { |
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 | |
class Switcher { | |
public static $calls = []; | |
public static function register($case, Closure $callback){ | |
self::$calls[$case] = new Executor($callback); | |
} |
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
$player = $ev->getPlayer(); | |
$pk = new \pocketmine\network\mcpe\protocol\PlaySoundPacket(); | |
$pk->soundName = "music.mymusic"; // mymusic.ogg の場合 | |
$pk->x = $player->x; | |
$pk->y = $player->y; | |
$pk->z = $player->z; | |
$pk->volume = 0.5; | |
$pk->pitch = 1.0; | |
$player->dataPacket($pk); | |
$player->sendMessage("Send"); |
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 | |
require './vendor/autoload.php'; | |
use Ramsey\Uuid\Uuid; | |
const WORKING_SPACE_DIR = "./music_working_space/"; | |
var_dump($_FILES); |
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 | |
// https://paiza.io/projects/szvtfJnxiwMhun_ndDxs6w | |
$a = [4,8,16,32,64,900]; | |
for($i=0;$i<count($a);$i++){ | |
$h = 1 / $a[$i]; | |
$y0 = y(0); | |
$yn = y(1); | |
$x = 0; | |
$y = 0; |
NewerOlder