- 1
- 2
- 3
- 4
- 5
- 6
- 7
int k = 50;
while (true){
i = i + i;
System.out.println(i);
k--;
if (k<0) break;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 33
+68
int k = 50;
while (true){
i = i + i;
System.out.println(i);
k--;
if (k<0) break;
}
http://stackoverflow.com/questions/24173463/why-does-i-i-i-give-me-0
+71
List<String> list = ...;
for (String s : someStringList)
list.add(s);
list.set(SOME_CONST, someString);
list.add(0, secondSomeString);
Поначалу никак не мог понять, почему list.get(SOME_CONST) != someString. Ну и копирование через цикл тоже норм
+79
List<SomeType> list = ...;
...
if (list.size() < 0)
return true;
а вдруг?
+133
typedef long bool_t;
#define TRUE 1
#define FALSE 0
void f() {
bool_t var;
for (var = TRUE; var > FALSE; var++) { /* ... */ }
}
+71
try {
throw new Exception();
} catch (Exception e) {
e.printStackTrace();
}
+127
#define PIXEL_PARTS_NUM 3
typedef struct _pixel {
char parts[PIXEL_PARTS_NUM];
} pixel;
+64
short someShort = (short) (someBoolean ? 15 : 42);
такая удобная Java
+74
/**
*
*
* @param wb
* @param sheet
* @param row
* @param borderDashedRight
* @param borderDashedLeft
* @param borderDashedRightLeft
* @param fulBorderCalignFont10
* @param forSummary
*/
private void mergeCellsForRows(HSSFWorkbook wb, HSSFSheet sheet,
HSSFRow row, HSSFCellStyle borderDashedRight,
HSSFCellStyle borderDashedLeft,
HSSFCellStyle borderDashedRightLeft,
HSSFCellStyle fulBorderCalignFont10, boolean forSummary)
полезный javadoc
+71
private int[] pageBreaks = new int[] { 25, 48, 71, 94, 117, 140, 163, 186,
209, 232, 255, 278, 301, 324, 347, 370, 393, 416, 439, 462, 485,
508, 531, 554, 577, 600, 623, 646, 669, 692, 715, 738, 761, 784,
807, 830, 853, 876, 899, 922, 945, 968, 991, 1014, 1037 };
+72
if (match) {
formCell(sheet, rowPlus2, 0, 0, fulBorderCalignFont10, 1, false);
formCell(sheet, rowPlus2, 8, 8, fulBorderCalignFont10, 2, false);
formCell(sheet, rowPlus2, 14, 14, fulBorderCalignFont10, 3, false);
formCell(sheet, rowPlus2, 20, 20, fulBorderCalignFont10, 4, false);
formCell(sheet, rowPlus2, 26, 26, fulBorderCalignFont10, 5, false);
formCell(sheet, rowPlus2, 32, 32, fulBorderCalignFont10, 6, false);
formCell(sheet, rowPlus2, 42, 42, fulBorderCalignFont10, 7, false);
formCell(sheet, rowPlus2, 48, 48, fulBorderCalignFont10, 8, false);
formCell(sheet, rowPlus2, 54, 54, fulBorderCalignFont10, 9, false);
formCell(sheet, rowPlus2, 60, 60, fulBorderCalignFont10, 10, false);
formCell(sheet, rowPlus2, 66, 66, fulBorderCalignFont10, 11, false);
formCell(sheet, rowPlus2, 72, 72, fulBorderCalignFont10, 12, false);
} else {
formCell(sheet, rowPlus2, 0, 0, fulBorderCalignFont10, 1, false);
formCell(sheet, rowPlus2, 8, 8, fulBorderCalignFont10, 2, false);
formCell(sheet, rowPlus2, 14, 14, fulBorderCalignFont10, 3, false);
formCell(sheet, rowPlus2, 20, 20, fulBorderCalignFont10, 4, false);
formCell(sheet, rowPlus2, 26, 26, fulBorderCalignFont10, 5, false);
formCell(sheet, rowPlus2, 32, 32, fulBorderCalignFont10, 6, false);
formCell(sheet, rowPlus2, 38, 38, fulBorderCalignFont10, 7, false);
formCell(sheet, rowPlus2, 42, 42, fulBorderCalignFont10, 8, false);
formCell(sheet, rowPlus2, 48, 48, fulBorderCalignFont10, 9, false);
formCell(sheet, rowPlus2, 54, 54, fulBorderCalignFont10, 10, false);
formCell(sheet, rowPlus2, 60, 60, fulBorderCalignFont10, 11, false);
formCell(sheet, rowPlus2, 66, 66, fulBorderCalignFont10, 12, false);
formCell(sheet, rowPlus2, 72, 72, fulBorderCalignFont10, 13, false);
formCell(sheet, rowPlus2, 78, 78, fulBorderCalignFont10, 14, false);
}