Zmiana adresu bloga
Monday, February 8, 2010 12:44:29 PM
(!ereg("^http://", $url)) ? $this->url = "http://" . $url : $this->url = $url;
Monday, February 8, 2010 12:44:29 PM
Thursday, May 17, 2007 7:39:11 PM
function ivtf($ANo)
{
if(ereg('^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$', $ANo) == True)
{
$date = explode(':', $ANo);
if(
($date[0] < 24) AND ($date[1] < 60) AND ($date[2] < 60)
) return True;
else return False;
}
else
{
return False;
}
}
function calkowita($ANo) {
return ereg('^[+-]?[0-9]+$', $ANo);
}
function zmiennoprzecinkowa($ANo) {
return ereg('^[+-]?[0-9]*\.?[0-9]+$', $ANo);
}
Thursday, May 17, 2007 1:28:47 PM

$uchwyt = fopen("slowa-win.txt", "rb");
$tresc = NULL;
while (!feof($uchwyt)) {
$tresc .= fread($uchwyt, 16384);
++$a;
}
fclose($uchwyt);
$tmp = explode("\n", $tresc);
$ile = count($tmp);
while ($a < $ile) {
if((strlen($tmp[$a]) > 3)) {
if($tmp[$a][2] != $tmp[$a-1][2]) {
$plik = substr($tmp[$a], 0, 2) . "_max.txt";
}
$fp = fopen($plik, "a+");
fputs($fp, $tmp[$a]);
fclose($fp);
}
++$a;
}Jeżeli macie wystarczająco dużo czasu żeby bawić się w przetwarzanie ponad 30 megowego txt w PHP - śmiało, musicie tylko zmienić jeszcze dyrektywy w php.ini odpowiadające za maksymalny czas wykonywania skryptów oraz ilośc pamięci na to przeznaczonejmax_execution_time = 3600 ; Maximum execution time of each script, in seconds memory_limit = 64M ; Maximum amount of memory a script may consume (8MB), a to może okazać się jeszcze za mało ;D
Wednesday, April 25, 2007 6:34:32 AM
Wednesday, April 18, 2007 6:52:45 PM
FUNCTION werele($nazwa) {
RETURN EREG('^[_A-Za-z:]+[-_A-Za-z0-9.;]*$', $nazwa);
}
Monday, April 16, 2007 6:21:57 AM
<?
$_POST['a'] = -10;
$_POST['b'] = 10;
$e = 0.001;
$k = 0.61803398;
function oblicz($x) {
return ($x - 3.1415) * ($x - 3.1415);
}
$_POST['ciecie_lewe'] = $_POST['b'] - $k * ($_POST['b'] - $_POST['a']);
$_POST['ciecie_prawe'] = $_POST['a'] + $k * ($_POST['b'] - $_POST['a']);
$_POST['wartosc_lewa'] = oblicz($_POST['ciecie_lewe']);
$_POST['wartosc_prawa'] = oblicz($_POST['ciecie_prawa']);
$i++;
while(($_POST['b'] - $_POST['a']) > $e) { $i++;
if (oblicz($_POST['ciecie_lewe']) < oblicz($_POST['ciecie_prawe'])) {
$_POST['b'] = $_POST['ciecie_prawe'];
$_POST['ciecie_prawe'] = $_POST['ciecie_lewe'];
$_POST['wartosc_prawa'] = oblicz($_POST['ciecie_prawe']);
$_POST['ciecie_lewe'] = $_POST['b'] - $k * ($_POST['b'] - $_POST['a']);
$_POST['wartosc_lewa'] = oblicz($_POST['ciecie_lewe']);
} else {
$_POST['a'] = $_POST['ciecie_lewe'];
$_POST['ciecie_lewe'] = $_POST['ciecie_prawe'];
$_POST['wartosc_lewa'] = oblicz($_POST['ciecie_lewe']);
$_POST['ciecie_prawe'] = $_POST['a'] + $k * ($_POST['b'] - $_POST['a']);
$_POST['wartosc_prawa'] = oblicz($_POST['ciecie_prawa']);
}
$_POST['ciecie_srodek'] = ($_POST['a'] + $_POST['b']) / 2;
}
echo "<b>". $_POST['ciecie_srodek'] . "</b> za <b>" . $i . "</b> razem.";
?>
Wednesday, April 4, 2007 9:11:21 PM
# autor: Fabian Lenczewski
# data: 2007-04-04
# Uniwersytet w Białymstoku, Instytut Informatyki
function oblicz($x) {
# przykładowa funkcja
return ($x - 3.1415) * ($x - 3.1415);
}
# granice przedziału
$_POST[a] = -10;
$_POST[b] = 10;
# epsilon
$e = 1.3;
# echo "Max. ilosc kroków: ". $il_krokow = ($_POST[b] - $_POST[a]) / $e . "\n";
for($i = 1; $i<$il_krokow; $i++) {
$_POST[l] = $_POST[b] - $_POST[a];
$_POST[ciecie_srodek] = ($_POST[a] + $_POST[b]) / 2;
$_POST[ciecie_lewe] = $_POST[a] + $_POST[l] / 4;
$_POST[ciecie_prawe] = $_POST[b] - $_POST[l] / 4;
$_POST[wartosc_lewa] = oblicz($_POST[ciecie_lewe]);
$_POST[wartosc_srodek] = oblicz($_POST[ciecie_srodek]);
$_POST[wartosc_prawa] = oblicz($_POST[ciecie_prawe]);
if ($_POST[wartosc_lewa] > $_POST[wartosc_srodek]) {
$_POST[a] = $_POST[ciecie_srodek];
} else if ($_POST[wartosc_prawa] <= $_POST[wartosc_srodek]) {
$_POST[a] = $_POST[ciecie_lewe];
$_POST[b] = $_POST[ciecie_prawe];
} else {
$_POST[b] = $_POST[ciecie_srodek] ;
}
}
echo $_POST[ciecie_srodek];
Tuesday, January 23, 2007 11:20:20 AM
# IS VALID DATE FORMAT, RRRR-MM-DD
function ivdf($ANo)
{
if(ereg('^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$', $ANo) == True)
{
$date = explode('-', $ANo);
if (checkdate($date[1], $date[2], $date[0])) {
return True;
} else {
return False;
}
}
else
{
return False;
}
}
Monday, January 22, 2007 9:38:43 AM

function del_numeric($data){
return $data = preg_replace('/[0-9.]/', '', $data);
}
dodane: function save_numeric($data){
return $data = preg_replace('/[^0-9.]/', '', $data);
}
anonymous
MiZar writes: Bardzo czytelny i dobry artykuł, który bardzo ...
anonymous
Анонімний writes: If you are willing to buy a car, you will ...
anonymous
diesel fuel filter writes: When the rains come, sit half ...
anonymous
diesel fuel filter writes: When the rains come, sit half br ...
anonymous
Anonim writes: Pewnie tyile ile wynosi limit int'a 21474836 ...
anonymous
Анонимно writes: I propose not to hold off until you get en ...
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
|
| ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | ||||