-
Лучший говнокод
- В номинации:
-
- За время:
-
-
+51
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
class happy
{
public $today = 0;
public $text = null;
public function __construct($text)
{
if (!$text){
exit('ничего не пришло!:(');
}
if ($text)
{
$this->text = $text;
}
}
public function today()
{
$date = date('z');
$this->today = $date;
return $this->today;
}
public function echotext()
{
if (!$this->text)
{
echo 'нет текста!';
}
if ($this->text)
{
echo $this->text;
}
}
}
if (date('z') == 256)
{
$obj = new happy('С днём программиста!');
if ($obj->today == 0)
{
$obj->today();
}
if ($obj->today == 256)
{
$obj->echotext();
}
}
С праздником!
kuler,
12 Сентября 2012
-
+53
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
public function __construct() {
$this->em = \Zend_Registry::get('em');
$this->_pid = mysql_connect(
$this->em->getConnection()->getHost(),
$this->em->getConnection()->getUsername(),
$this->em->getConnection()->getPassword());
mysql_select_db( $this->em->getConnection()->getDatabase(), $this->_pid);
}
shmaltorhbooks,
10 Сентября 2012
-
+141
- 1
- 2
- 3
- 4
- 5
<select>
<option class="a2" value="0" selected="selected">любой возраст</option>
<option class="a2" value="1">0 мес - 6 мес</option>
<option class="a2" value="2">0 мес - 12 мес</option>
</select>
selected="selected" для элемента, выбираемого по дефолту - зачем?
ps. Код - кусок статичного html.
domaster,
22 Августа 2012
-
+127
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
function name = monthName( m )
switch m
case 1
name = 'Jan';
case 2
name = 'Feb';
case 3
name = 'Mar';
case 4
name = 'Apr';
case 5
name = 'May';
case 6
name = 'Jun';
case 7
name = 'Jul';
case 8
name = 'Aug';
case 9
name = 'Sep';
case 10
name = 'Oct';
case 11
name = 'Nov';
case 12
name = 'Dec';
end
MATLAB. Источник: http://berkeleyearth.org/results-summary/ - почитайте, что за проект. А ноги растут вот отсюда: http://www.sfgate.com/science/article/UC-climate-change-skeptic-changes-views-3748148.php
Этот отрывок присутствует в двух файлах, я нашел его после беглого просмотра. Может быть, я ничего не понимаю в научных расчетах и совершенно незнаком с синтаксисом MATLAB, но есть у меня подозрения, что здесь что-то не так.
Папки с тестами к коду я не нашел. Сижу вот, думаю...
scriptin,
20 Августа 2012
-
+106
- 1
- 2
- 3
- 4
foreach (DataRow row in this.TestsTable.Select(query))
{
return true;
}
Все тот же крупный и дорогой проект :)
minuzZ,
17 Августа 2012
-
+137
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
private static Tag GetTopic(Guid tagId)
{
var tag = DataService.PerThread.TagSet.SingleOrDefault(x => x.Id == tagId);
if (tag == null && tag.GroupId != null)
return null;
if (tag.TopicState != (byte)TopicState.GroupTopic)
return null;
return tag;
}
Arbium,
08 Августа 2012
-
+64
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
<?php
/* File: config.php */
$ea_hot_color = "#F06000";
$ea_fulllocation = "1";
$ea_curconverter = "1";
$ea_show_hits = "1";
$ea_show_created_date = "1";
//и т.д.~300 строк
// ============================
/* File: config.class.php */
class EAConf{
/*
...
*/
function EAConf(){
require('config.php');
$allvars=get_defined_vars();
$names=array_keys($allvars);
foreach($names as $name){
if(substr($name,0,2)=="ea") $this->$name=$allvars[$name];
}
}
/*
...
*/
}
Какая глубина мысли! Смело, нетривиально!
virtual_cia,
06 Августа 2012
-
+70
- 1
- 2
- 3
- 4
- 5
} catch (CacheException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
Привет из Индии
dzagy,
06 Августа 2012
-
+157
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
onChange: function (el, e) {
var val = el.val();
if (val.substring(8, 10) === " ") {
this.setValue(val.substring(0, 6) + "20" + val.substring(6, 8));
}
this.setValue(val === "" ? null : val);
}
Обработчик onChange в дейтпикере
нинзя-разработчик 16 levl
nur,
06 Августа 2012
-
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
while (true)
{
try
{
ProductService.Invoke(method);
return;
}
catch(Exception ex)
{
if (ex is System.ServiceModel.CommunicationException)
{
if (currentRetryCount == RetryCount)
throw new CommunicationException(CommunicationFailureMessage, ex);
System.Threading.Thread.Sleep(RetryWait);
currentRetryCount++;
}
}
}
abatishchev,
03 Августа 2012