- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
Запиши эти слова в файл (например, words.txt или slova.txt) и прочитай его с помощью функции fgetcsv().
<?php
$x=fopen("slova.txt","r");
$y=fgetcsv($x,filesize($x),' ');
foreach($y as $line)
{
echo $line;
};
?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+156
Запиши эти слова в файл (например, words.txt или slova.txt) и прочитай его с помощью функции fgetcsv().
<?php
$x=fopen("slova.txt","r");
$y=fgetcsv($x,filesize($x),' ');
foreach($y as $line)
{
echo $line;
};
?>
Разбиение строки на отдельные слова с сайта hashcode.ru
+153
<script language="javascript">
function setcookie(data['uid'])
</script>
+146
else
{
if(cells[i][j-1].label == 1)
{
cells[i][0].label = 2;
cells[i][0].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i-1][j].label == 1)
{
cells[0][2].label = 2;
cells[0][2].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i-1][j-1].label == 1)
{
cells[0][0].label = 2;
cells[0][0].empty = false;
playerIsTurn = true;
numTurns++;
}
}
}
}
}
}
}
}
}
часть 4 полный код можно посмотреть на http://www.gamedev.ru/projects/forum/?id=160346&page=2
+142
else
{
if(i == 0)
{
if(j == 0)
{
if(cells[i][j+1].label == 1)
{
cells[i][2].label = 2;
cells[i][2].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i+1][j].label == 1)
{
cells[2][j].label = 2;
cells[2][j].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i+1][j+1].label == 1)
{
cells[2][2].label = 2;
cells[2][2].empty = false;
playerIsTurn = true;
numTurns++;
}
}else if(j == 1)
{
if(cells[i][j-1].label == 1)
{
cells[i][2].label = 2;
cells[i][2].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i+1][j].label == 1)
{
cells[2][j].label = 2;
cells[2][j].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i][j+1].label == 1)
{
cells[0][0].label = 2;
cells[0][0].empty = false;
playerIsTurn = true;
numTurns++;
}
}else
{
if(cells[i][j-1].label == 1)
{
cells[i][0].label = 2;
cells[i][0].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i+1][j].label == 1)
{
cells[2][2].label = 2;
cells[2][2].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i+1][j-1].label == 1)
{
cells[2][0].label = 2;
cells[2][0].empty = false;
playerIsTurn = true;
numTurns++;
}
}
}else if(cells[i-1][j].label == 1)
часть 3 полный код можно посмотреть на http://www.gamedev.ru/projects/forum/?id=160346&page=2
+141
else if(numTurns != 1)
{
{
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 3; j++)
{
if(cells[i][j].label == 1)
{
if(i == 1 && j == 1)
{
if(cells[i][j-1].label == 1)
{
cells[i][j+1].label = 2;
cells[i][j+1].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i][j+1].label == 1)
{
cells[i][j-1].label = 2;
cells[i][j-1].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i-1][j].label == 1)
{
cells[i+1][j].label = 2;
cells[i+1][j].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i+1][j].label == 1)
{
cells[i-1][j].label = 2;
cells[i-1][j].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i-1][j-1].label == 1)
{
cells[i+1][j+1].label = 2;
cells[i+1][j+1].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i-1][j+1].label == 1)
{
cells[i+1][j-1].label = 2;
cells[i+1][j-1].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i+1][j+1].label == 1)
{
cells[i-1][j-1].label = 2;
cells[i-1][j-1].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[i+1][j-1].label == 1)
{
cells[i-1][j+1].label = 2;
cells[i-1][j+1].empty = false;
playerIsTurn = true;
numTurns++;
}
}
часть 2
+150
if(numTurns == 1)
{
if(cells[1][1].label == 1)
{
cells[0][0].label = 2;
cells[0][0].empty = false;
playerIsTurn = true;
numTurns++;
}else
{
if(cells[0][0].label == 1 && cells[0][2].label == 1 &&
cells[2][0].label == 1 && cells[2][2].label == 1)
{
cells[1][1].label = 2;
cells[1][1].empty = false;
playerIsTurn = true;
numTurns++;
}else if(cells[0][1].label == 1 && cells[1][2].label == 1 &&
cells[1][0].label == 1 && cells[2][1].label == 1)
{
cells[1][1].label = 2;
cells[1][1].empty = false;
playerIsTurn = true;
numTurns++;
}
}
}
во аи для крестиков ноликов часть1
+162
...
q = new double[50];
c = new double[50];
d = new double[50];
b = new double[50];
s11 = new double[50];
a4 = new double[50];
s1 = new double[50];
int c2 = 0;
for ( int i = 1; i < n1; i++)
{
h1[i] = a3[i] - a3[i-1];
}
for ( int i = 0; i < n1; i++)
{
f1[i] = sin(exp(a3[i]));
}
for ( int i = 1; i < k; i++)
{
al[i] = h1[i];
bet[i] = 2*(h1[i+1] + h1[i]);
gam[i] = h1[i+1];
fi[i] = 6*(((f1[i+1] - f1[i])/h1[i+1]) - ((f1[i] - f1[i-1])/h1[i]));
}
p[1] = 0;
q[1] = 0;
for ( int i = 1; i < k; i++)
{
p[i+1] = -(gam[i])/(bet[i] + al[i]*p[i]);
q[i+1] = (fi[i] - al[i]*q[i])/(bet[i] + al[i]*p[i]);
}
c[0] = 0.0;
c[k] = 0.0;
for ( int i = k-1; i > 0; i--)
{
c[i] = p[i+1]*c[i+1] + q[i+1];
}
for ( int i = 0; i < k; i++)
{
d[i+1] = (c[i] - c[i+1])/h1[i+1];
b[i+1] = ((f1[i] - f1[i+1])/h1[i+1]) - ((c[i+1]*h1[i+1])/2) - (((c[i] - c[i+1])*h1[i+1])/6);
}
for ( double j = 0.0; j <= 0.5; j = j + 0.1)
{
c2 = c2 + 1;
for ( int i = 1; i < 2; i++)
{
spkub = f1[i] + b[i]*(a3[i] - j) + ((c[i]*pow((a3[i] - j), 2))/2) + ((d[i]*pow((a3[i] - j), 3))/6);
}
for (int i = c2 - 1; i < c2; i++)
{
a4[i] = j;
s1[i] = spkub;
}
}
for ( double j = 0.5; j <= 0.7; j = j + 0.1)
{
c2 = c2 + 1;
for ( int i = 2; i < 3; i++)
{
spkub = f1[i] + b[i]*(a3[i] - j) + ((c[i]*pow((a3[i] - j), 2))/2) + ((d[i]*pow((a3[i] - j), 3))/6);
}
for (int i = c2 - 1; i < c2; i++)
{
a4[i] = j;
s1[i] = spkub;
}
}
........
for ( double j = 1.4; j <= 1.6; j = j + 0.1)
{
c2 = c2 + 1;
for ( int i = 5; i < 6; i++)
{
spkub = f1[i] + b[i]*(a3[i] - j) + ((c[i]*pow((a3[i] - j), 2))/2) + ((d[i]*pow((a3[i] - j), 3))/6);
}
for (int i = c2 - 1; i < c2; i++)
{
a4[i] = j;
s1[i] = spkub;
}
}
for ( double j = 1.7; j <= 2.0; j = j + 0.1)
{
c2 = c2 + 1;
for ( int i = 6; i < 7; i++)
{
spkub = f1[i] + b[i]*(a3[i] - j) + ((c[i]*pow((a3[i] - j), 2))/2) + ((d[i]*pow((a3[i] - j), 3))/6);
}
for (int i = c2 - 1; i < c2; i++)
{
a4[i] = j;
s1[i] = spkub;
}
}
for ( int i = 0; i < c2; i++)
{
chart1 -> Series["Кубический сплайн S(x)"] -> Points -> AddXY( a4[i], s1[i]);
}
Построение кубического сплайна
+158
За эту же цену:плохой запрос SELECT * FROM tur_stuff WHERE (razdel like '') AND (nal like 1) AND (price>0) AND (price >= *0.90) AND (price <= *1.1)
Результат, который был пойман по ссылке
http://www.kant.ru/show_good1.php?t=tur_stuff&id=302960&id_ razdel=159
Хотя ссылка может в принципе работать. Радует качественная характеристика запроса ;)
+156
<?php if(isset($_GET["fullVersion"])) $_SESSION["fullVersion"]="on"; ?><?php if($_SESSION["fullVersion"]!='on' && (substr_count($_SERVER["HTTP_USER_AGENT"],'Android') || substr_count($_SERVER["HTTP_USER_AGENT"],'iPhone'))){
header("Location: /m/redirects/?withjs");
exit;
}
else if($_SESSION["fullVersion"]!='on' && substr_count($_SERVER["HTTP_USER_AGENT"],'Opera Mini')){
header("Location: /m/redirects/?operamini");
exit;
}
?><?php if($_GET["ClockId"] && $_GET["str"] && $_GET["frompartnerka"]==1){ header("Location: http://vip-timeclub.ru/catalog/articul/?ClockId=".(int)$_GET["ClockId"]."&str=2");} ?>
<?php if(function_exists('vtPrice')==false){
function vtPrice($price=0,$sale=0,$priceGold=0){
if($priceGold){
$priceOld = $price;
$price = $priceGold;
}
else if($sale){
$priceOld = $price;
$price = ceil(intval($priceOld)-((intval($priceOld)/100)*(intval($sale))));
}
else{
$priceOld = 0;
}
return array('price'=>$price,'priceOld'=>$priceOld);
}
}if(function_exists('vtPriceGood')==false){
function vtPriceGood($price){
if(intval(substr($price,-1)) > 0 && intval(substr($price,-1)) < 5)
$price = intval($price) + (5-intval(substr($price,-1)));
else if(intval(substr($price,-1)) > 5 && intval(substr($price,-1)) <= 9)
$price = intval($price) + (10-intval(substr($price,-1)));
return $price;
}
} ?>
spam, club-viptime DOT RU
+140
VK.callMethod('showPaymentBox', 1);
Есть приложение ВКонтакте (IFRAME), на него через VK.callMethod('showPaymentBox', 1); внесён 1 голос и пользователь его видит как: http://i.imgur.com/2b57c.png, т.е его можно в любой момент снять. Но как на PHP написать полное снятие этого голоса, чтобы его уже было нереально снять? Помогите, пожалуйста :)