- 1
- 2
SELECT * FROM [dbo].[Publications]
where [UserId] not like 'NULL'
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−857
SELECT * FROM [dbo].[Publications]
where [UserId] not like 'NULL'
UserId, естественно, int
+148.2
var tbl = order.group != 0 ?
(order.group != 1 ?
limit :
closed) :
open;
+162.6
<?php
if($_GET['id'] == 10 ){
$location = "/articles/lyustry/lustra-na-kuhne/";
}elseif($_GET['id'] == 13 and $_GET['id_type'] == 17){
$location = "/market/interernye_svetilniki/lyustry/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 22 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/bolshie_lyustry/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 34 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/lyustry/bolee_6_rozhkov/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 2 ){
$location = "/market/interernye_svetilniki/podvesnye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 40 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/podvesnye/odinochnyj_podves/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 41 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/podvesnye/trojnoj_i_bolee/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 5 ){
$location = "/market/interernye_svetilniki/nastenno-potolochnye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 35 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/potolochnye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 52 ){
$location = "/market/interernye_svetilniki/vlagozawitnye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 51 ){
$location = "/market/interernye_svetilniki/podsvetka_kartin/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 7 ){
$location = "/market/interernye_svetilniki/bra/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 37 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/bra/odnorozhkovye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 38 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/bra/dvuhrozhkovye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 39 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/bra/treh_i_bolee_rozhkovye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 1 ){
$location = "/market/interernye_svetilniki/tochechnye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 42 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/tochechnye/odinochnye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 43 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/tochechnye/dvojnye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 44 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/tochechnye/tri_i_bolee/";
}
elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 8){
$location = "/market/interernye_svetilniki/nastolnye_lampy/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 46 and $_GET['act'] == 'sub_type'){
$location = "/market/interernye_svetilniki/nastolnye_lampy/ofisnye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 47 and $_GET['act'] == 'sub_
type'){
$location = "/market/interernye_svetilniki/nastolnye_lampy/prikrovatnye_domashnie_ili_interernye/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 6 ){
$location = "/market/interernye_svetilniki/torshery/";
}elseif(
$_GET['id'] == 13 and $_GET['id_type'] == 9 ){
$location = "/market/ulichnye_svetilniki/";
}...
И так далее..
Клиент поставил нашу CMS, на старой были ссылки типа /?id=10 и т.д. Сделал ему для примера скрипт редиректа с использованием switch case и вот что я увидел через две недели 0_0 Неприкрытый говнокод.
+122.6
string[] mas_param = a.Split('_');
this.s_sw_neraspred = mas_param[15];
s_neraspred.Text = this.s_sw_neraspred;
int i = a.IndexOf("_", 0, a.Length);
sw_id = a.Substring(0, i);
int j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
mf_id = a.Substring(j, i - j);
//mf1=a.Substring(j);
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
ta_ed = a.Substring(j, i - j);
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
this.s_op = a.Substring(j, i - j);
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
s_rm = a.Substring(j, i - j);
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
s_tm = a.Substring(j, i - j);
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
s_sw = a.Substring(j, i - j);
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
ta_sd = a.Substring(j, i - j);
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
sw_sd = a.Substring(j, i - j);
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
sw_ed = a.Substring(j, i - j);
//mf_topsw
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
mf_topsw = a.Substring(j, i - j);
//s_op_topsw
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
s_op_topsw = a.Substring(j, i - j);
//s_rm_topsw
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
s_rm_topsw = a.Substring(j, i - j);
//s_tm_topsw
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
s_tm_topsw = a.Substring(j, i - j);
//s_sw_topsw
j = i + 1;
i = a.IndexOf("_", j, a.Length - j);
s_sw_topsw = a.Substring(j, i - j);
//ta
ta_id = a.Split('_')[mas_param.Length-1];
a - строка вида
{0}_{1}_{2}_{3}_{4}_{5}_{6}_{7}_{8}_{9}_ {10}_{11}_{12}_{13}_{14}_{15}_{16}
+115.4
public partial class AbstractPickerBrw : Form
{
//...
public AbstractPickerBrw ()
{
this.Shown += new System.EventHandler(this.AbstractPickerBrw_Shown);
}
//...
private void AbstractPickerBrw_Shown(object sender, System.EventArgs e)
{
Width = Width % 2 == 0 ? Width + 1 : Width - 1;
}
}
Это мой код, просто не мог добиться перерисовки диалога при смене данных в WinForms и решил не заморачиваться.
+69
if (isRenderVerifyClaimTab()) {
addContrToInit("com.cs.creditecspert.webjsf.controllers.ddeControllers.VerifyClaimController");
}
if (isRenderVerifyAvtoTab()) {
addContrToInit("com.cs.creditecspert.webjsf.controllers.ddeControllers.VerifyAvtoController");
}
if (isRenderUntipicalClaimTab()) {
addContrToInit("com.cs.creditecspert.webjsf.controllers.ddeControllers.UntipicalClaimController");
}
if (isRenderTypeClaimTab()) {
addContrToInit("com.cs.creditecspert.webjsf.controllers.ddeControllers.TypeClaimController");
}
Профтыкал что можно было делать так:
if (isRenderCheckClaimTab()) {
addContrToInit(CheckClaimController.clas s.getName());
}
:)
+131.6
<div style="width:100%; text-align:center; height:95%; position: absolute ; left:0; top:0; text-align:center; " >
<table id="TableHead" cellpadding="0" cellspacing="0" style="text-align:center;width: 400px; margin-top:-150px; margin-left:-200px; position:absolute; top: 50%; " align="center">
...
</div>
ну не красотень
+74.4
private String getNullString(int kol){
String nullstr="";
for(int i=0;i<kol;i++){
nullstr+="0";
}
return nullstr;
}
public String getNumber(int idd){
String regid="";
String idds=(idd+"");
if(idds.length()<getNumberLenth()){
regid+=getNullString(getNumberLenth()-idds.length());
regid+=idds;
}
String regnum="";
regnum+=getNumberPrefix()+regid;
if(getNumberPeriod()!=NUM_PERIOD_NOPERIOD){
GregorianCalendar c=new GregorianCalendar();
switch(getNumberPeriod()){
case NUM_PERIOD_MONTH:
int m=c.get(Calendar.MONTH)+1;
regnum+="-"+m;
regnum+=".";
regnum+=c.get(Calendar.YEAR);
break;
case NUM_PERIOD_YEAR:
regnum+="-"+c.get(Calendar.YEAR);
}
}
return regnum;
}
Ну незнал я про String.format (((..
+102
function TicksBetween(t1, t2 : dword) : dword;
begin
if t2 > t1
then Result:=t2 - t1 + 1
else Result:=dword(-1) - t1 + t2 + 1;
end;
Никогда не пишите с бодуна!
+143.6
for i:=1 to 10000000 do
begin
{...}
if m=0 then break;
end;