- 1
<?php echo strtolower( ?> HELLO WORLD! <?php ); ?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+146.9
<?php echo strtolower( ?> HELLO WORLD! <?php ); ?>
Не рабочий код, конечно, но на мой взгляд ржачный)
+154.3
There is a little problem with iconv in such using:
$mytext = iconv('windows-1251', 'utf-8', $mytext);
echo $mytext;
This code isn't work correctly. Solution is:
$mytext_utf = iconv('windows-1251', 'utf-8', $mytext);
echo $mytext_utf;
//or just
echo iconv('windows-1251', 'utf-8', $mytext);
ссылка: http://www.php.net/manual/en/function.iconv.php#83511
смотрел ман, наткнулся на вот такой комментарий
Если я еще не ослеп, то чувак одну один и тот же код три раза переписал
и он якобы у него заработал :D
+156.1
class I_Mysql
{
var
$host="localhost",
$user="root",
$password="",
$database="gorodokbox",
$charset="utf8",
$connected=false,
$db_selected=true,
$r_connection=null,
$result=null,
$row=array(),
$field=null,
$debug=false;
function I_Mysql()
{
}
function connect($host="localhost", $user="roo", $password="", $type=0)
{
$this->host=$host;
$this->user=$user;
$this->password=$password;
$this->database=$password;
if(defined('MYSQLDEBUG'))$this->debug=1;
@$this->r_connection = mysql_connect($this->host, $this->user, $this->password);
@$er=mysql_errno($this->r_connection);
if(!$er)
{
if($this->debug) echo "mySQL connected<br>";
$GLOBALS['CVARS']['DB']['connected']=true;
$GLOBALS['CVARS']['DB']['rcon']=$this->r_connection;
$this->connected = true;
$GLOBALS['CVARS']['DB']['mysql']=&$this;
return true;
}
return false;
}
..................................................
Ковырял самописный двиг магазина.
+147.9
function log($message){
echo $message; //just echo it out! Yee haw!
}
офигенный лог
+99
try
SetPropValue(c, aqGetConfigproperty_name.asString,aqGetConfigpropery_value.asvariant);
aqGetConfig.Next;
if aqGetConfigproperty_name.AsString = 'TabVisible'
then begin
if aqGetConfigpropery_value.AsString = '1' then vis:=True
else vis:=False;
SetPropValue(c, aqGetConfigproperty_name.asString,vis);
end
Вот так мы ставим свойства закладок из конфигуратора:)
+156.2
if($started==true && !empty($query))
do { } while ($todo===$berry);
/*
* if started equals true,
* and isn't empty query,
* do nothing while todo
* really more, than berry
*/
no comments
+136.4
public class Xps2Slides
{
private int MakeCollection(List<string> data)
{
...
CallGC();
...
}
private void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
...
CallGC();
...
}
private void makeDeepZoomFiles(string png)
{
...
CallGC();
}
private string MakePNG(ref FrameworkElement fe, int pageNumber)
{
CallGC();
...
CallGC();
...
}
private void doPNG(string outputPath, ref RenderTargetBitmap bmp)
{
...
CallGC();
...
}
private void CallGC()
{
GC.AddMemoryPressure(300000);// number was picked at random..
GC.Collect();
GC.WaitForPendingFinalizers();
GC.WaitForFullGCComplete();
}
}
Кандидат на позицию программиста: "There are alot of samples on the internet of such similar code, but nothing that could be used for serially generating these collections on the fly without crashing with a memory overflow error or some other input output issue. I have resolved these problems in the file contained in the sample."
+160.1
while ($row = @mysql_fetch_array($result)) {
$id =$row[id];
$appelation =$row[appelation];
$name =$row[name];
$name2 =$row[name2];
$company =$row[company];
$street =$row[street];
$addition =$row[addition];
$state =$row[state];
$zip_code =$row[zip_code];
$city =$row[city];
$country =$row[country];
$email =$row[email];
$fax =$row[fax];
$phone =$row[phone];
}
из одного шопика..
+136
/// <summary>Read-Only property. Gets the Age.</summary>
public Int32 Age {
get {
Int32 age = 0;
if(this.dateOfBirth != DateTime.MaxValue){
String temp = (DateTime.Now.Subtract(this.dateOfBirth).TotalDays / 365).ToString();
age = Convert.ToInt32(temp.Substring(0, temp.IndexOf(".")));
}
return (age);
}
}
вот только одно не понимаю -- мочему Int32?
+44.3
while(*(++a)=*(++b));
Краткость - сетра таланта.