-
Лучший говнокод
- В номинации:
-
- За время:
-
-
−1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
var i, j;
loop1:
for (i = 0; i < 3; i++) { //The first for statement is labeled "loop1"
loop2:
for (j = 0; j < 3; j++) { //The second for statement is labeled "loop2"
if (i === 1 && j === 1) {
continue loop1;
}
console.log('i = ' + i + ', j = ' + j);
}
}
Метки в js. Баян?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label
vistefan,
03 Марта 2018
-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
class PriceCache {
public:
FlightStorage(const std::size_t count) {
for (std::size_t i = 0; i < count; ++i) {
flights.emplace_back(FlightCache::get(i));
prices.emplace_back(&flights.back(), Price::getFor(flights.back()));
}
}
private:
std::vector<Flight> flights;
std::vector<const Flight *, double> prices;
};
"случайные сегфолты при обращении к PriceCache::prices"
Elvenfighter,
28 Февраля 2018
-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
public class DialogBuilder: NSObject {
private var style: UIAlertControllerStyle
private var titleColor: UIColor?
/**
* initial DialogBuilder with UIAlertControllerStyle and for title color
*/
public init(style: UIAlertControllerStyle = .alert, titlecolor : UIColor?) {
self.style = style
if(titlecolor != nil)
{self.titleColor = titlecolor}
}
/**
* initial DialogBuilder with UIAlertControllerStyle
*/
public init(style: UIAlertControllerStyle = .alert) {
self.style = style
}
...
}
wwweshka,
31 Января 2018
-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
func onlyCashLessEUR(_ rates : [CurrencyRateMto]) -> CurrencyRateItem {
var EUR : CurrencyRateItem? = nil
let cashLessEUR = rates.filter({$0.type.enumValue == CurrencyRateTypeMtoEnum.CASHLESS && $0.currency.isEUR() == true})
if(cashLessEUR.count > 0){
EUR = CurrencyRateItem(
cashLessEUR.first?.currency.getIcon(),
(cashLessEUR.first?.currency.id)!,
NumberFormatting.sum(cashLessEUR.first?.buyPrice?.price),
NumberFormatting.sum(cashLessEUR.first?.sellPrice?.price))
}
if(EUR == nil){
EUR = CurrencyRateItem(
UIImage.init(named: "currency_eur"),
"EUR",
"-",
"-")
}
return EUR!
}
"Я форматирую как далбаёб, и мне похер на то, что cashLessEUR.first опционален, я буду его юзать дальше".
wwweshka,
30 Января 2018
-
+1
- 1
OrderedDict().fromkeys(['key1', 'key2', 'key3'], [])
Снова сел на грабли с изменяемыми объектами
syoma,
29 Января 2018
-
−1
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
public static class TaskExtension
{
// Silences compiler warning: Because this call is not awaited,
// execution of the current method continues before the call is completed.
// Consider applying the 'await' operator to the result of the call
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void NoWarning(this Task task) { }
}
Коллеги добавили в код после введения правила treat warnings as errors
cherepets,
25 Января 2018
-
0
- 1
- 2
- 3
- 4
- 5
var id = setTimeout(function timer() {
var d = new Date()
document.getElementById('text').innerHTML = (d.getHours() < 10 ? '0'+d.getHours() : d.getHours())+':'+(d.getMinutes() < 10 ? '0'+d.getMinutes() : d.getMinutes() )+':'+(d.getSeconds() < 10 ? '0'+d.getSeconds() : d.getSeconds())
id = setTimeout(timer, 1000)
}, 1000)
Вот чем крут js это простотой и ненадобности ставить точки с запятыми!
fuckercoder,
30 Декабря 2017
-
−2
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
#define POLY 0x8408
/*
// 16 12 5
// this is the CCITT CRC 16 polynomial X + X + X + 1.
// This works out to be 0x1021, but the way the algorithm works
// lets us use 0x8408 (the reverse of the bit pattern). The high
// bit is always assumed to be set, thus we only use 16 bits to
// represent the 17 bit value.
*/
unsigned short crc16(unsigned char *data_p, size_t length)
{
unsigned char i;
unsigned int data;
if ( length == 0 ) return 0;
unsigned int crc = 0xFFFF;
do
{
data = *data_p++;
for ( i=0; i < 8; i++ )
{
if ( (crc ^ data) & 1 )
crc = (crc >> 1) ^ POLY;
else
crc >>= 1;
data >>= 1;
}
} while ( --length != 0 );
crc = ~crc;
data = crc;
crc = (crc << 8) | ((data >> 8) & 0xff);
return (unsigned short)(crc);
}
Типичный пример непортабельной хуйни на Си.
j123123,
07 Декабря 2017
-
−4
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
while( (i=xyi.read()) != -1 )
{
al.add( i+b-e*b*e+b+e-b+e-b+e+e+e+e+b-b-e+b+b-xer*e-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer );
}
for(int n=0; n<al.size(); n++)
out.println(al.get(n));
out.println("\nА теперь ебашим в обратку...");
Thread.sleep(1000);
int pizdec;
for(int n=0; n<al.size(); n++)
{
i = al.get(n);
pizdec = i+xer*e-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-xer-b+e-b+e-b+e+e+e+e+b-b-e+b+b+e*b*e-b;
out.print((char)pizdec);
}
пиздец сложный код!
выдаёт вот что: ◇◓▸○◇◊○◘▎●◔▏□╰╯▆▆▆▆●◔◚▆●▣▖□╰╯▆▆▆▆●◔◚▆◈▣▝ ▝▒▆○▣▟▟▟▒▆◞○◘▣▗▙□╰╯▆▆▆▆▧◘◘◇◟▲●◙◚▢▯◔◚○◍○◘ ▤▆◇◒▆▣▆◔○◝▆▧◘◘◇◟▲●◙◚▢▤▎▏□╰╯▆▆▆▆◝◎●◒○▎▆▎● ▣◞◟●▔◘○◇◊▎▏▏▆▇▣▆▓▗▆▏╰╯▆▆▆▆◡╰╯▆▆▆▆╯◇◒▔◇◊◊ ▎▆●░◈▓○▐◈▐○░◈░○▓◈░○▓◈░○░○░○░○░◈▓◈▓○░◈░◈▓ ◞○◘▐○▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○ ◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▆▏□╰╯▆▆▆▆◣╰ ╯▆▆▆▆◌◕◘▎●◔◚▆◔▣▖□▆◔▢◇◒▔◙●◠○▎▏□▆◔░░▏╰╯▆▆▆ ▆╯◕◛◚▔◖◘●◔◚◒◔▎◇◒▔◍○◚▎◔▏▏□╰╯▆▆▆▆◕◛◚▔◖◘●◔◚ ◒◔▎█◂◔⥶▆⦨⦛⦥⦛⦦⦲▆⦛⦗⦖⦮⦞⦢▆⦘▆⦤⦗⦦⦖⦨⦠⦩▔▔▔█▏□╰╯▆ ▆▆▆►◎◘○◇◊▔◙◒○○◖▎▗▖▖▖▏□╰╯▆▆▆▆●◔◚▆◖●◠◊○◉□╰ ╯▆▆▆▆◌◕◘▎●◔◚▆◔▣▖□▆◔▢◇◒▔◙●◠○▎▏□▆◔░░▏╰╯▆▆▆ ▆◡╰╯▆▆▆▆╯●▆▣▆◇◒▔◍○◚▎◔▏□╰╯▆▆▆▆╯◖●◠◊○◉▆▣▆● ░◞○◘▐○▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞ ○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◞○◘▓◈░○▓◈░○▓◈ ░○░○░○░○░◈▓◈▓○░◈░◈░○▐◈▐○▓◈□╰╯▆▆▆▆╯◕◛◚▔◖◘ ●◔◚▎▎◉◎◇◘▏◖●◠◊○◉▏□╰╯▆▆▆▆◣╰╯◣╰╯◉◇◚◉◎▎▯▵▫◞ ◉○◖◚●◕◔▆○▏▆◡╰╯╯◕◛◚▔◖◘●◔◚◒◔▎█⦫⦩⦟▆⦨⦖⦢▆⦥⦡⦖⦘ ⦖⦡▇█▏□╰╯◣╰▆▆◣╰◣╰
FlowerGay,
13 Ноября 2017
-
−7
- 1
- 2
- 3
- 4
- 5
- 6
- 7
#!/bin/bash
echo Я говно на баш!
while true; do
read PS1
PS2="${PS2} ${PS1} Смищно правда?"
echo $PS2
don
RUSSIAN-PROGRAMMER,
11 Ноября 2017