-
+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
-
−89
- 1
if (numberOfAnimals == 3 || numberOfAnimals == 3)
"Чтоб наверняка"
Новичок нашел заказчика. Дал мне код, чтобы я сделал "чтобы работал". Начал смотреть, ужаснулся.
itruf,
19 Августа 2012
-
+60
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
list($width, $height, $type, $attr) = getimagesize($file1);
if($width == $height)
{
set_time_limit(270);
if(filesize($file1) > 102400) return array(false, "Размер больше 100Кб!");
if($type == 1) {$file2 = $file1.'.gif'; $out = $tizer_id.'.gif'; $type = 'gif'; $ext = 'gif';}
elseif($type == 2) {$file2 = $file1.'.jpg'; $out = $tizer_id.'.jpg'; $type = 'jpg'; $ext = 'jpg';}
elseif($type == 3) {$file2 = $file1.'.png'; $out = $tizer_id.'.png'; $type = 'png'; $ext = 'png';}
else return array(false, "Это не картинка!");
/* ... */
}
// no square
else
{
return array(array('img',false, "Изображение не квадратное!"));
}
Зачем жить, если no square
roman-kashitsyn,
19 Августа 2012
-
−160
- 1
SELECT count(*) as count FROM wz_vacancy WHERE action='1' and TO_DAYS(NOW()) - TO_DAYS(date) = '0';
* индекс только по primary key - id
* Оригинальный способ выборки сегодняшних объектов :) особенно, когда можно подставить конкретные даты еще в коде программы.
scorcher,
19 Августа 2012
-
+52
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
<?
....
//башкортостан
$city_select_arr = "<OPTGROUP LABEL=\"Республика Башкортостан\">";
foreach($city_select_data as $k=>$v) {
{
$global_city = ($_GET['city'] == '' ? $_POST['city_select']: $_GET['city']);
$city_select_arr .= "<option value=\"".$v."".( $v == $global_city ? " selected" : "" ) . "\">".$v."</option>";
}
}
$city_select_arr .= "</OPTGROUP>";
//пермский край
$city_select_arr .= "<OPTGROUP LABEL=\"Пермский край\">";
foreach($city_select2_data as $k=>$v) {
{
$global_city = ($_GET['city'] == '' ? $_POST['city_select']: $_GET['city']);
$city_select_arr .= "<option value=\"".$v."".( $v == $global_city ? "" : "" ) . "\">".$v."</option>";
}
}
$city_select_arr .= "</OPTGROUP>";
.... и так еще циклов 10-15
обратите внимание на переменную $global_city - ей в каждой итерации каждого цикла присваивают условное значение, которое в пределах этого файла точно не меняется :)
ну и сам набор циклов можно было бы конечно систематизировать.
scorcher,
19 Августа 2012
-
+46
- 1
- 2
- 3
<?php
echo implode(", ", array_map(create_function('$tag', 'return \'<a href="?tag=\' . hs($tag) . \'">\' . hs($tag) . \'</a>\';'), $post['tags']));
?>
Нашел в дебрях своей древней CMS. Как говорится, экономика должна быть экономичной, а конь коническим.
TBoolean,
19 Августа 2012
-
+25
- 1
- 2
- 3
- 4
uint32 originalDamage = damage;
if (absorb && originalDamage > damage)
*absorb += (originalDamage - damage);
Вытащил из 1 эмулятора игры World of WarCraft
Heisenberg,
19 Августа 2012
-
−159
Коллеги намедни выдали
noosipip,
18 Августа 2012
-
+20
- 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
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
class NetGetPlmnListReply: public Message {
public:
virtual uint8_t command() const;
virtual uint8_t subcommand() const;
virtual RequestType requestType() const;
virtual bool deliver(IUnsolicitedReceiver *receiver);
static inline bool isTypeOf(Message *message) {
return message->command() == 8 && message->subcommand() == 4;
}
std::string inspect() const;
bool writeToStream(DataStream &stream);
bool readFromStream(DataStream &stream);
inline uint8_t count() const { return m_count; }
inline void setCount(uint8_t count) { m_count = count; }
class PlmnListItem {
public:
std::string inspect() const;
bool writeToStream(DataStream &stream);
bool readFromStream(DataStream &stream);
enum Status {
Available = 2,
Current = 3,
Forbidden = 4,
};
inline Status status() const { return (Status) m_status; }
inline void setStatus(Status status) { m_status = (uint8_t) status; }
inline const std::vector<unsigned char> &plmn() const { return m_plmn; }
inline void setPlmn(const std::vector<unsigned char> &plmn) { m_plmn = plmn; }
private:
uint8_t m_status;
std::vector<unsigned char> m_plmn;
};
inline const std::vector<PlmnListItem> &plmnList() const { return m_plmnList; }
inline void setPlmnList(const std::vector<PlmnListItem> &plmnList) { m_plmnList = plmnList; }
private:
uint8_t m_count;
std::vector<PlmnListItem> m_plmnList;
};
Один из тысячи сгенерированных классов.
Grindars,
18 Августа 2012
-
+106
- 1
- 2
- 3
- 4
foreach (DataRow row in this.TestsTable.Select(query))
{
return true;
}
Все тот же крупный и дорогой проект :)
minuzZ,
17 Августа 2012