<?php
php
foreach (glob('*.' .$argv[1]) as $file) {
if (FALSE !== filesize($file) && filesize($file) < $argv[2]) {
unlink($file);
}
}
?>
cd x:\path\to\pictures
x:\path\to\php.exe -f "x:\path\to\scriptfile.php" jpg 8192
<?php
// windows systemtimeasfiletime to unix timestamp
// wstft_to_unixtime(byte[8])
function wstft_to_unixtime($bytes)
{
$time_hi = array_shift( // grab first element of array returned by unpack
unpack('I', substr($bytes, 4)) // skip first 4 bytes, unpack last 4 bytes as unsigned integer
);
// $time_hi is now equal to the original 64-bit integer bitshifted 32 steps to the right (/= 2^32)
// 100ns * (2^32) = 429.4967296 seconds
// thus $time_hi now consists of the number of 429.4967296-second intervals between 1601 and 1970
// there are 116444736000000000 100-nanosecond intervals between jan1 1601 and jan1 1970
$time_hi -= 27111902.8; // remove 1601-1970 time difference (also shifted 32 steps to the right)
$time_hi *= 429.4967296; // turn into seconds
return $time_hi;
}
?>
struct IS_MSO // MSg Out - system messages and user messages
{
byte Size; // 136
byte Type; // ISP_MSO
byte ReqI; // 0
byte Zero;
byte UCID; // connection's unique id (0 = host)
byte PLID; // player's unique id (if zero, use UCID)
byte UserType; // set if typed by a user (see User Values below)
[B]byte TextStart; // first character of the actual text (after player name)[/B]
char Msg[128];
};
substr(MSO.Msg, MSO.TextStart);
<?php
echo mysql_fetch_object(mysql_query($sql))->total;
?>
<?php
require 'lfsworldsdk.php';
$SDK = new LFSWorldSDK('idkey goes here');
function some_function_name($SDK, $racers) {
static $charts = array();
$ret = $sort = array();
foreach ($racers as $racername => $combo) {
$c = &$charts[$combo['track']][$combo['car']];
if (FALSE == isset($c)) {
sleep(5);
$c = $SDK->get_ch(array($combo['track']), array($combo['car']));
}
foreach ($c[$combo['track']][$combo['car']] as $key => $item) {
if ($item['racername'] == $racername) {
$ret[] = array_merge($item, $combo);
$sort[] = $item['time'];
}
}
}
array_multisort($sort, SORT_ASC, $ret);
return $ret;
}
function disptime($t) {
return date('i:s', ((int) $t / 1000)) . '.' . $t % 1000;
}
$drivers = array
(
'Atti Honyi (SK)' => array('track' => '000', 'car' => 'FXO'),
'Megin' => array('track' => '000', 'car' => 'FXO'),
'Sisolak' => array('track' => '000', 'car' => 'RB4'),
'eraser_svk' => array('track' => '000', 'car' => 'RB4'),
'Ghost_CZ' => array('track' => '000', 'car' => 'XRT'),
'BIGMAN' => array('track' => '000', 'car' => 'XRT')
);
$table = some_function_name($SDK, $drivers);
foreach ($table as $p => $driver)
echo ($p + 1), '. ', $driver['racername'], ' ', $driver['car'], ' ', disptime($driver['time']), '<br />', PHP_EOL;
?>