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_once("_api/init.php"); | |
global $MCApi, $DB; | |
$result = $MCApi->listServers(); | |
if ($result['success'] != 1) die('Unable to fetch server list.'); | |
$servers = $result['data']['Servers']; | |
foreach ($servers as $id => $serverName) { | |
if (strpos($serverName, "InstantMC - ") !== 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 | |
function pingNetwork($hostname, $port = 25565) { | |
$packet = "\xFE\x01"; | |
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
try { | |
$sConnectStatus = @socket_connect($socket, $hostname, $port); | |
if (!$sConnectStatus) return false; | |
$sWriteStatus = @socket_write($socket, $packet, strlen($packet)); |
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
/** | |
* Multi-threaded matrix multiplication. | |
* @param a a matrix | |
* @param b another matrix | |
* @return The resulting matrix-multiplied matrix | |
*/ | |
public static int[][] multiplyMatrix(final int[][] a, final int[][] b) { | |
ExecutorService exec = Executors.newFixedThreadPool(9); | |
List<Callable<Object>> tasks = new LinkedList<>(); | |
final int[][] result = new int[3][3]; |
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
package echo.client.gl; | |
import echo.core.geom.Vector; | |
import lombok.Getter; | |
import lombok.Setter; | |
public class VertexVector extends Vector implements VertexAttribute { | |
public static final int ELEMENT_SIZE = 4; | |
NewerOlder