- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
protected virtual void OnDisconnected()
{
DispatcherHelper.CheckBeginInvokeOnUI(() =>
{
...
Cameras.ToList().Clear();
Meltings.ToList().Clear();
Spans.ToList().Clear();
...
});
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+145
protected virtual void OnDisconnected()
{
DispatcherHelper.CheckBeginInvokeOnUI(() =>
{
...
Cameras.ToList().Clear();
Meltings.ToList().Clear();
Spans.ToList().Clear();
...
});
}
Очищаем коллекции с данными, привязанные на списковые контролы UI. Доступ к свойствам Cameras, Meltings, Spans только через IEnumerable<>. Как же их очистить?
+144
public String tommorowCalendarCountry(String date, String country){
String tommorowCountry = null;
if(date.equals(getTommorow())){
tommorowCountry = country;
}
return tommorowCountry;
}
public String tommorowCalendarIndicator(String date, String indicator){
String tommorowIndicator = null;
if(date.equals(getTommorow())){
tommorowIndicator = indicator;
}
return tommorowIndicator;
}
public String tommorowCalendarImportance(String date, String importance){
String tommorowImportance = null;
if(date.equals(getTommorow())){
tommorowImportance = importance;
}
return tommorowImportance;
}
public String tommorowCalendarForecast(String date, String forecast){
String tommorowForecast = null;
if(date.equals(getTommorow())){
tommorowForecast = forecast;
}
return tommorowForecast;
}
public String tommorowCalendarPrevious(String date, String previous){
String tommorowPrevious = null;
if(date.equals(getTommorow())){
tommorowPrevious = previous;
}
return tommorowPrevious;
}
public String tommorowCalendarActual(String date, String actual){
String tommorowActual = null;
if(date.equals(getTommorow())){
tommorowActual = actual;
}
return tommorowActual;
}
public String tommorowCalendarDescription(String date, String description){
String tommorowDescription = null;
if(date.equals(getTommorow())){
tommorowDescription = description;
}
return tommorowDescription;
}
public String tommorowCalendarPeriod(String date, String period){
String tommorowPeriod = null;
if(date.equals(getTommorow())){
tommorowPeriod = period;
}
return tommorowPeriod;
}
public String tommorowCalendarLocation(String date, String location){
String tommorowLocation = null;
if(date.equals(getTommorow())){
tommorowLocation = location;
}
return tommorowLocation;
}
пришло с аутсорса. Такого в проекте очень много)
+143
int i = 132,
*ii = &i,
**iii = &ii,
***iiii = &iii,
****iiiii = &iiii,
*****iiiiii = &iiiii,
******iiiiiii = &iiiiii;
printf("%d", ******iiiiiii);
Забавно
−390
openUTButton.frame = CGRectMake(SCREEN_WIDTH - (IS_IPAD ? 225. : 120.) - (IS_IPAD ? 40. : 20),
IS_IPAD ? 40. : 20.,
IS_IPAD ? 225 : 120.,
IS_IPAD ? 60. : 35.);
И так для каждого элемента интерфейса и каждый раз при смене ориентации - просто тернарный фетишизм.
−129
except Exception:
raise
+142
<?php
$file1 = 'D:\file.txt';
$fo1 = fopen($file1,"r");
$array = array(1=>'б',2=>'в',3=>'г',4=>'д',5=>'ж',6=>'з',7=>'й',8=>'к',9=>'л',10=>'м',11=>'н',12=>'п',
13=>'р',14=>'с',15=>'т',16=>'ф',17=>'х',18=>'ц',19=>'ч',20=>'ш',21=>'щ');
$shetchik = 0;
$t=0;
while (!feof($fo1))
{
$line2 = fgets($fo1);
$line = strtolower($line2);
for ($j=0;$j<strlen($line);$j++)
{
$char = $line[$j];
if(in_array($line[$j],$array))
{
$index = array_keys($array,$line[$j]);
$int = $index[0];
if ($int-$t>=1)
{
$shetchik++;
$t = $int;
}
else
{
$t=0;
$shetchic=0;
}
if ($shetchik==4) echo "$line2<br>";
}
}
}
?>
шедевр
+145
if (count($stores) == 1) {
foreach ($stores as $store) {
$storeId = $store->id;
}
}
+144
class Select
constructor: ->
Select = this
###
var Select;
Select = (function() {
function Select() {
Select = this;
}
return Select;
})();
код на coffeescript. до сих пор годаю - зачем?
+144
cs_zagl.Edit;
cs_zagl.fieldbyname('count_z').asinteger:=cs_tab.RecordCount;
cs_zagl.Post;
cs_mk.Edit;
cs_mk.FieldByName('med_kart_id').Asinteger:=select_row_Form.ClientDataSet1.FieldByName('id_kart').asinteger;
cs_mk.FieldByName('id_kart_public').Asinteger:=select_row_Form.ClientDataSet1.FieldByName('id_kart_public').asinteger;
cs_mk.FieldByName('id_pac').Asinteger:=select_row_Form.ClientDataSet1.FieldByName('id_pac').asinteger;
cs_mk.FieldByName('type_kart').asinteger:=select_row_Form.ClientDataSet1.FieldByName('type_kart').asinteger;
cs_mk.post;
IF (cs_mk.FieldByName('med_kart_id').Value=0) or (cs_mk.FieldByName('type_kart').asinteger<>27) then begin
cmd := VarArrayCreate([0,20],varVariant);
cmd[1] := 6832;
cmd[2] := 17;
cmd[5] := 1;
cmd[6] := 0;
ProvOptions := [grMetadata, grReset];
cmd[7] := dsp_mk.GetRecords(-1, RecsOut, Byte(ProvOptions));
try
rez := MainFormInterface.EXT_call_server('spr_read', cmd);
cs_tab.Edit;
cs_tab.FieldByName('med_kart_id').Asinteger:=rez[3];
cs_tab.Post;
if rez[1] < 0 then begin
debug_sql('Ошибка: ' + varastype(rez[1], varstring), 2);
MessageDlg('Ошибка: '+ #10 + #13 +
varastype(rez[1],varstring),mtError,[mbok],0);
Exit;
end;
except
on e:exception do
begin
MessageDlg(ERROR_MESS_5 + 'Исключение:' + E.ClassName + 'Mess:' + E.Message, mterror, [mbok], 0);
debug_sql('Ошибка записи документа!', 2);
debug_all('Err при записи документа тип=' + varastype(cmd[1], varstring)+
' id=' + inttostr(id_doc) + 'Исключение:' + E.ClassName + 'Mess:' + E.Message,2);
end;
end;
end;
end else begin
end;
end
else exit;
end else
begin
id_pac:=rez[3];
id_med_kart:=rez[2];
Application.MessageBox(pchar('Ошибка: '+#10+#13+
'Даный пациент не найден!!!'),pchar(application_title_short),MB_OK+MB_ICONERROR);
exit;
end;
end;
Это называется стиль
+142
TCompareType = (ctGT, ctGE, ctLT, ctLE, ctEQ, ctNE, ctIsIn, ctNIsIn,
ctLike, ctNLike, ctNull, ctNNull, ctBetween, ctNotBetween, ctExists,
ctNotExists);
Преклоняюсь перед истинным ниндзя. Ходил не обращал на ...код, но видимо я осознал глубокий смысл этого пути).