- 1
short someShort = (short) (someBoolean ? 15 : 42);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+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);
}
+75
Integer code = Integer.valueOf(service.getId().toString());
service.getId() возвращает Long
+73
StartElement startElement = event.asStartElement();
if(startElement.getName().getLocalPart().equals(REPORT)){
report = new Report();
}else if (startElement.getName().getLocalPart().equals(CODE)){
event = eventReader.nextEvent();
report.setCode(event.asCharacters().getData());
continue;
}else if(startElement.getName().getLocalPart().equals(SHORT_NAME)){
event = eventReader.nextEvent();
report.setShortName(event.asCharacters().getData());
}else if(startElement.getName().getLocalPart().equals(NAME)){
event = eventReader.nextEvent();
report.setName(event.asCharacters().getData());
continue;
}else if(startElement.getName().getLocalPart().equals(TYPE)){
event = eventReader.nextEvent();
report.setType(ReportType.valueOf(event.asCharacters().getData()));
continue;
}else if(startElement.getName().getLocalPart().equals(CON_CMN_REPORT)){
event = eventReader.nextEvent();
String conRepCode = event.asCharacters().getData();
report.setConnectedCommonReport(getReportByCode(conRepCode, reports));
continue;
}else if(startElement.getName().getLocalPart().equals(BEFORE)){
event = eventReader.nextEvent();
report.setAvaliableBefore(Boolean.valueOf(event.asCharacters().getData()));
continue;
}else if(startElement.getName().getLocalPart().equals(QUANTITY)){
event = eventReader.nextEvent();
report.setQuantity(ReportQuantity.valueOf(event.asCharacters().getData()));
continue;
}else if(startElement.getName().getLocalPart().equals(CREATOR_CLASS_NAME)){
event = eventReader.nextEvent();
report.setCreatorClassName(event.asCharacters().getData());
}
и не лень же было
+73
private static class Errors extends ArrayList<String> {
private static final long serialVersionUID = 1L;
}
private static class Notices extends ArrayList<String> {
private static final long serialVersionUID = 1L;
}
две большие разницы
+77
AddTextNode(ma_empNode.addChildElement('ORG_NAME', namespace, prefix),NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(
NewRegEx(' '+app.OrgName__c+' '
,' ООО ',5)
,' ООО.',5)
,' ООО"',5)
,' 000 ',5)
,' 000.',5)
,' 000"',5)
,' OOO ',5)
,' OOO.',5)
,' OOO"',5)
,' ЗАО ', 5)
,' ЗАО.', 5)
,' ЗАО"', 5)
,' ОАО ', 5)
,' ОАО.', 5)
,' ОАО"', 5)
,' ИП ', 4)
,' ИП.', 4)
,' ИП"', 4)
,'Общество с ограниченной ответственностью', 37)
,'Индивидуальный предприниматель', 28)
,'Открытое акционерное общество', 27)
,'Закрытое акционерное общество', 27)
.Replace('"', '')
.Replace('', '')
.Replace('«', '')
.Replace('»', ''));
Проверял код одного нашего програймера. От первых же строк ушел в аут. Такое еще не видел.
+134
ok = r.nextInt(prob) <= prob
рассчитываем вероятность события...
+130
Java programming class.
A boy and a girl were sitting in a Java programming class together. He reached over and grabbed her breast. She said: "Hey, that's private". He looked confused and said: "I thought we were in the same class"
Оффтоп, ржака, ебмп.