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
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; | |
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
/** | |
* 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 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 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 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_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 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 | |
$procList = array(); | |
$newProcList = array(); | |
$limitProcs = array(); | |
while (true) { | |
$count = 0; | |
$newProcList = getProc(); | |
foreach ($newProcList as $pid) { |
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
#!/bin/bash | |
## Validate arguments | |
if [ "$#" -ne 2 ]; then | |
echo "Fetches latest Spigot patch and applies it." | |
echo | |
echo "Usage: <spigot-1649-jar-path> <output-file>" | |
exit 1 | |
fi |
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
#!/bin/bash | |
ITER=5 | |
## | |
function usage { | |
echo "Usage: resolve [options] hostname" | |
echo | |
echo -e " -t #\t\tSpecify number of lookups (default 5)" | |
exit |
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
var fs = require('fs'), | |
https = require('https'), | |
async = require('async'), | |
yaml = require('js-yaml'); | |
var TIMESTAMP = 1422921600; | |
var data = fs.readFileSync('permissions.yml'); | |
var doc = yaml.safeLoad(data); | |
// |
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
package justinhead.se3345; | |
import java.util.Arrays; | |
import java.util.Enumeration; | |
import java.util.HashMap; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Stack; |
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
#!/bin/bash | |
if [ $# -lt 1 ]; then | |
echo "Usage: ./dedupe.sh [path]" | |
exit 1 | |
fi | |
BASE=$1 | |
MAX_SIZE="25M" | |
FILTER='\.(mca|log|gz)$' |
OlderNewer