- 1
searchResultItemArray.push(new SearchResultItem(((kwList.GetItem(rsl[i].kwC))[0].kw[rsl[i].kw]),((kwList.GetItem(rsl[i].kwC))[0].src),i));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−429.1
searchResultItemArray.push(new SearchResultItem(((kwList.GetItem(rsl[i].kwC))[0].kw[rsl[i].kw]),((kwList.GetItem(rsl[i].kwC))[0].src),i));
Красота архитектуры умиляет
+143.9
http://www.***.com/Hotels?action=hotelPackageWizard@searchHotelOnly&packageType=HOTEL_ONLY&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_hotelSearchRegionControl_hotelRegionTypeControl_inpRegionType=AIRPORT&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_hotelSearchRegionControl_airportControl_inpAirport=kiev&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_dateRangeWidget_inpStartDate=3/25/2009&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_dateRangeWidget_inpEndDate=4/15/2009&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_roomInputWidget_hotelRoomCountInput=1&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_roomInputWidget_adultCountInput=2&hotelPackageWizard_hotelPackageWizardControl_hotelWidgetControl_roomInputWidget_childCountInput=0&isAdditionOptionExist=0&rfrr=-905
// админы сделайте общую категорию а пока это асм наверно :)
к всем ЯП-ам относится
+173.1
$h_month = date("m");
$h_day = date("d");
$h_year = date("Y");
$h_hour = date("H");
$h_minute = date("i");
$history = mysql_query("insert into history values('','$h_month','$h_day','$h_year','$h_hour','$h_minute','$total_open','$beat','$wins','$tie','$can_change_up','$can_change_down','$cannot_win','$t_adjusted_gain','$t_adjusted_loss','$t_dollar_amount')");
вот так вот человек хранит дату в БД =)
+849.2
switch (driver.Status)
{
case ClientStatus.Unknown:
return m_driverStatusNames[ClientStatus.Unknown];
case ClientStatus.Free:
return m_driverStatusNames[ClientStatus.Free];
case ClientStatus.Busy:
return m_driverStatusNames[ClientStatus.Busy];
case ClientStatus.InWay:
return m_driverStatusNames[ClientStatus.InWay];
case ClientStatus.Work:
return m_driverStatusNames[ClientStatus.Work];
case ClientStatus.Break:
return m_driverStatusNames[ClientStatus.Break];
case ClientStatus.Alarm:
return m_driverStatusNames[ClientStatus.Alarm];
}
:)
+24
while (!bFound && j < enmMessages)
{
if (!strcmp(str.operator const char * (), strPacketName[j]))
{
iPacketType = j;
bFound = true;
TRACE(" of type %s\n",strPacketName[j]);
strcat(strOut," of type ");
strcat(strOut, strPacketName[j]);
break;
}
j++;
}
+2.4
int a=0;
if (a != 0)
{
a=0;
}
else a=0;
+11.9
if ($site_is_work)
{
}
else
{
exit('Сайт не работает');
}
0
// https://github.com/dotnet/runtime/issues/117233#issuecomment-3028066225
// Issue: Math.Pow relies directly on the OS pow implementation
// Location: [src/coreclr/classlibnative/float/floatdouble.cpp lines 232‑236] and [src/coreclr/classlibnative/float/floatsingle.cpp lines 207‑211]
// COMDouble::Pow and COMSingle::Pow simply call pow/powf from the C runtime. On Windows 11 Insider Preview (build 27881.1000),
// these functions can return incorrect results (e.g., Math.Pow(-1, 2) giving -1). The JIT also uses these functions for constant folding, causing
// wrong constants to be embedded at compile time.
// Suggested Fix: Introduce a managed fallback in COMDouble::Pow/COMSingle::Pow that handles negative bases with integral exponents, bypassing the faulty system call.
//A simple approach:
FCIMPL2_VV(double, COMDouble::Pow, double x, double y)
{
FCALL_CONTRACT;
if ((x < 0.0) && (y == floor(y)))
{
double absResult = pow(-x, y);
return fmod(fabs(y), 2.0) == 1.0 ? -absResult : absResult;
}
return pow(x, y);
}
// Suggested Implementation:
// Add the following code to src/coreclr/classlibnative/float/floatdouble.cpp below line 234 before the return pow:
if ((x < 0.0) && (y == floor(y)))
{
double result = pow(-x, y);
if (fmod(fabs(y), 2.0) != 0.0)
{
result = -result;
}
return result;
}
// Add the following code to src/coreclr/classlibnative/float/floatsingle.cpp below line 209 before the return powf:
if ((x < 0.0f) && (y == floorf(y)))
{
float result = powf(-x, y);
if (fmodf(fabsf(y), 2.0f) != 0.0f)
{
result = -result;
}
return result;
}
// Add the following code to src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Math.cs below line 1124:
[Fact]
public static void Pow_NegativeBaseEvenExponent_ReturnsPositive()
{
Assert.Equal(1.0, Math.Pow(-1, 2));
Assert.Equal(16.0, Math.Pow(-2, 4));
}
Вот к чему плавучий петух приводит!
+1
/* Python:
def A004086(n):
return int(str(n)[::-1])
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int A004086(int n) {
char str[12]; // Enough to hold the string representation of an int
sprintf(str, "%d", n);
int len = strlen(str);
char reversed[12];
for (int i = 0; i < len; i++) {
reversed[i] = str[len - 1 - i];
}
reversed[len] = '\0'; // Null-terminate the string
return atoi(reversed);
}
Результат переписывание с "Python" на "C". A004086 это последовательность из OEIS https://oeis.org/A004086
0
$_GET