- 1
- 2
- 3
- 4
- 5
- 6
- 7
template<typename T>
static json_string _itoa(T val) json_nothrow {
/*...*/
long value = (long)val;
/*...*/
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+19
template<typename T>
static json_string _itoa(T val) json_nothrow {
/*...*/
long value = (long)val;
/*...*/
}
Продолжаю бороться с поддержкой 64-битных чисел в libjson :/
+25
public OnPlayerSpawn(playerid) {
IsSpawned[playerid]=1;
if(Team[playerid]==ZOMBIE) { TextDrawSetString(Textdraw9[playerid],"You are a ~r~Zombie~w~. Kill & Infect every Human to complete your mission.");
} else if(Team[playerid]==HUMAN) { TextDrawSetString(Textdraw9[playerid],"You are a ~r~Human~w~. Prevent Zombie attacks and survive till the end."); }
TextDrawHideForAll(Box); TextDrawHideForAll(text_Top5[0]); TextDrawHideForAll(text_Top5[1]);
TextDrawShowForPlayer(playerid, Textdraw0); TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2); TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4); TextDrawShowForPlayer(playerid, Textdraw5);
TextDrawShowForPlayer(playerid, Textdraw6); TextDrawShowForPlayer(playerid, Textdraw7);
TextDrawShowForPlayer(playerid, Textdraw9[playerid]);
TextDrawShowForPlayer(playerid, Textdraw15); TextDrawShowForPlayer(playerid, Textdraw16[playerid]);
SetTeam(playerid); SetClass(playerid);
if(Infection==1) {
Infection=0;
if(Totalplayers>=2) {
SetTimer("InfectionLoad",0,0);
} else if(Totalplayers>=10) {
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
}else if(Totalplayers>=10) {
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
}else if(Totalplayers>=20) {
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
}else if(Totalplayers>=30) {
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
}else if(Totalplayers>=45) {
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
}else if(Totalplayers>=60) {
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
}else if(Totalplayers<=75) {
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
SetTimer("InfectionLoad",0,0);
}
} return 1; }
Серьезно?
−120
Мутабелен ли 1С.Овощи.Банан?
Коллега считает что мутабелен.
+56
function issets($text)
{
if (isset($text) && $text != '')
return 1;
else
return 0;
}
По просьбам радиослушателей :) Отрывок из админки неизвестного автора.
Кусочки http://govnokod.ru/11650 , http://govnokod.ru/11647 , http://govnokod.ru/11646
+70
if( (r == g) && (g == b) && (b == 255) )
{
// .....
}
...
+76
/* ------------------------------------------------------------ */
private boolean isJspServlet ()
{
if (_servlet == null)
return false;
Class c = _servlet.getClass();
boolean result = false;
while (c != null && !result)
{
result = isJspServlet(c.getName());
c = c.getSuperclass();
}
return result;
}
/* ------------------------------------------------------------ */
private boolean isJspServlet (String classname)
{
if (classname == null)
return false;
return ("org.apache.jasper.servlet.JspServlet".equals(classname));
}
Копался в исходниках Jetty
+15
void* const allocateOrDie(const size_t Size) throw();
Ультиматум. :)
+61
$istmount = mysql_num_rows(mysql_query("SELECT `cid` FROM `usermail` WHERE `date` >='".date('Y-m-d', strtotime('-1 month'))."'"));
Подсчет количества подписчиков за прошлый месяц. Про count(*) автор, похоже, не в курсе...
И, чтобы не было вопросов про формат поля даты:
date - это varchar(11) :)
+71
$var1 = "Строка";
$var2 = true;
var_dump($var1);
var_dump($var2);
if($var1 != $var2){
echo "Не равны";
}else{
echo "Равны";
}
Недавно заметил странное поведение моего кода и вот что выяснилось.
Исправил сравнением по типу !==.
Не думал что такая вот хрень всплывет.
+194
if(!menu_font||!oboima_text||!info||!infoR||!infoD||!infoBR||
!oblaka1_tex||!fon1_tex||!fon2_tex||!fon3_tex||
!galka_tex||!galka_menu_tex||!strelka_menu_tex||!strelka_menu_D_tex||
!znak_myasnik_tex||!znak_strelok_tex||!znak_razrushitel_tex||!znak_tehnik_tex||
!status_opit_tex||!status_udar_tex||!status_status_tex||!opit_okno_vibora_tex||
!okno_lvl_progress_tex||!okno_lvl_progress_red_tex||!okno_lvl_progress_green_tex||!okno_lvl_polzunok_tex||
!snd||!ak_reload1||!ak_reload2||!pm_fire||!pm_reload1||!pm_reload2||
!pp19_fire||!pp19_reload1||!pp19_reload2||!fn_f2000_fire||!tt_fire||
!mac_fire||!mac_reload1||!mac_reload2||!webley_fire||!webley_reload1||!webley_reload2||!milkor_fire||
!fn_five_seven_fire||!winch_fire||!drob_reload1||!drob_pompa||!vzriv_grena1||
!rocket_fire||!rocket2_fire||!rocket_polet||!rocket2_polet||
!myaso_upalo1||!myaso_upalo2||!myaso_upalo3||!myaso_upalo4||!myaso_upalo5||!myaso_upalo6||!myaso_upalo7||
!myaso_upalo8||
!myaso_razriv_user1||!myaso_razriv_user2||
!menu_sound||!menu_choose||
!shot1||!headshot1||!headshot2||!headshot3||!headshot4||!headshot5||!headshot6||!headshot7||!headshot8||
!ssik1||!ssik2||!ssik3|!ssik4||
!ptenec_death1||
!ak||!ak2||!ak_upgraded||!ak2_upgraded||!w_pm_tex||!w_pp19_vityaz_tex||!w_fn_f2000_tex||!w_fn_f2000_upgraded_tex||
!w_tt_tex||!w_rpk_tex||!w_mac_tex||
!w_winchester_tex||!w_winchester_anime_tex||!w_rpk47_tex||!w_glok_tex||!w_glok2_tex||!w_rgd5_tex||!w_milkor_tex||
!w_panzer_tex||!w_panzer_out_tex||!w_webley_tex||!w_fn_five_seven_tex||!w_granata_podstvol_tex||!w_granata_panzer_tex||
!w_qlz87_pushka_tex||!w_qlz87_trenoga_tex||!katana_udar_sleva_tex||
!blood1_tex||!blood2_tex||!blood3_tex||!blood_shot1_tex||
!blood_plyam1_tex||!blood_plyam2_tex||!blood_plyam3_tex||!blood_luzha1_tex||
!blood_myaso1_tex||!blood_myaso2_tex||!blood_myaso3_tex||!blood_myaso4_tex||!blood_myaso5_tex||
!blood_zayac_noga1_tex||!blood_zayac_noga2_tex||!blood_zayac_noga3_tex||!blood_zayac_noga4_tex||
!blood_zayac_rebra1_tex||!blood_zayac_rebra2_tex||
!blood_vzriv1_a_tex||!blood_vzriv1_b_tex||!blood_vzriv1_c_tex||!blood_vzriv1_d_tex||!blood_vzriv1_e_tex||
!blood_vzriv1_e2_tex||
!player1_myasnik_gogranata_ruka1_tex||!player1_myasnik_gogranata_ruka2_tex||
!player1_strelok_gogranata_ruka1_tex||!player1_strelok_gogranata_ruka2_tex||
!player1_razrushitel_gogranata_ruka1_tex||!player1_razrushitel_gogranata_ruka2_tex||
!player1_tehnik_gogranata_ruka1_tex||!player1_tehnik_gogranata_ruka2_tex||
!player1_myasnik_tex||!player1_strelok_tex||!player1_razrushitel_tex||!player1_tehnik_tex||
!player1_myasnik_ruka1_udar_sleva_tex||!player1_strelok_ruka1_udar_sleva_tex||
!player1_razrushitel_ruka1_udar_sleva_tex||!player1_tehnik_ruka1_udar_sleva_tex||
!player1_myasnik_ruka1_pistol_tex||!player1_strelok_ruka1_pistol_tex||
!player1_razrushitel_ruka1_pistol_tex||!player1_tehnik_ruka1_pistol_tex||
!player1_myasnik_ruka1_vintovka_tex||!player1_strelok_ruka1_vintovka_tex||
!player1_razrushitel_ruka1_vintovka_tex||!player1_tehnik_ruka1_vintovka_tex||
!player1_myasnik_ruka1_winch_tex||!player1_strelok_ruka1_winch_tex||
!player1_razrushitel_ruka1_winch_tex||!player1_tehnik_ruka1_winch_tex||
!player2_strelok_tex||!player2_gogranata_ruka1_tex||!player2_gogranata_ruka2_tex||
!player2_strelok_ruka1_udar_sleva_tex||!player2_strelok_ruka1_vintovka_tex||!player2_strelok_ruka1_pistol_tex||
!zayac_go_tex||!zayac_uhi_k_tex||!zayac_uhi_s_tex||!zayac_uhi_tex||
!zayac_boshka_tex||!zayac_boshka_bezuh_tex||
!volk_go_tex||!volk_trup1_a_tex||!volk_trup1_b_tex||!volk_trup1_c_tex||
!medved_go_tex||!medved_boshka1_tex||
http://www.gamedev.ru/projects/forum/?id=160897
ЩИ!!!! ЗАЛЕЙ ВЕСЬ ЭКРАН КРОВЬЮ УВИДЕВ ИСХОДНЫЙ КОД