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 | |
$retries = 0; | |
function fetch() { | |
global $retries; | |
echo "Retry " . $retries . " | "; | |
$opts = array( |
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 | |
namespace AppBundle\Utils; | |
use JMS\Serializer\Construction\DoctrineObjectConstructor; | |
use JMS\Serializer\Construction\ObjectConstructorInterface; | |
use JMS\Serializer\Construction\UnserializeObjectConstructor; | |
use JMS\Serializer\DeserializationContext; |
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
@echo off | |
setlocal ENABLEEXTENSIONS | |
echo Starting troubleshooting script. It may take a while. Please wait. | |
( | |
@echo on | |
date /t | |
time /t |
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
#!/bin/bash | |
SERVER_DIRECTORY="/opt/maniaplanet-server/" | |
SERVER_TIMEOUT="298h" #298h ~= 12.4d | |
if [ "$(groups | grep games)" ]; | |
then | |
cd $SERVER_DIRECTORY | |
while true; do | |
timeout --foreground $SERVER_TIMEOUT ./ManiaPlanetServer "$@" | |
RETVAL=$? |
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
class MazeSolver: | |
def __init__(self): | |
self.points = [Point()] | |
def findCheese(self, maze): | |
maze.initialize() | |
while(True): | |
currentPoint = self.points[-1] | |
if maze.testAndMove(maze, currentPoint) == False: | |
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 | |
/** | |
* Maniaplanet Web Services SDK for PHP | |
* | |
* @see http://code.google.com/p/maniaplanet-ws-sdk/ | |
* @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com) | |
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 | |
* @author $Author$: | |
* @version $Revision$: | |
* @date $Date$: |
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 | |
/** | |
* ManiaLib - Lightweight PHP framework for Manialinks | |
* | |
* @see http://code.google.com/p/manialib/ | |
* @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com) | |
* @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 | |
* @version $Revision: 749 $: | |
* @author $Author: baptiste33 $: | |
* @date $Date: 2012-08-23 14:58:11 +0200 (jeu., 23 août 2012) $: |
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
function parseArguments() | |
{ | |
array_shift($argv); | |
$out = array(); | |
foreach($argv as $arg) | |
{ | |
if(substr($arg, 0, 2) == '--') | |
{ | |
$eqPos = strpos($arg, '='); | |
if($eqPos === false) |
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
public int setMessage(int type, Serializable data) throws IOException { | |
ByteArrayOutputStream bo = new ByteArrayOutputStream(); | |
ObjectOutputStream oo = new ObjectOutputStream(bo); | |
oo.writeObject(data); | |
oo.close(); | |
bo.close(); | |
this.messSize = bo.size(); | |
this.message = new byte[bo.size()]; | |
this.message = bo.toByteArray(); |