- 1
- 2
- 3
- 4
- 5
- 6
PHP
print 3 --0-- 5 == 8; // Parse error
Java Script
console.log(3 --0-- 5 == 8); // Uncaught SyntaxError: Invalid left-hand side expression in postfix operation
Python
print(3 --0-- 5 == 8) // true
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
PHP
print 3 --0-- 5 == 8; // Parse error
Java Script
console.log(3 --0-- 5 == 8); // Uncaught SyntaxError: Invalid left-hand side expression in postfix operation
Python
print(3 --0-- 5 == 8) // true
Именно поэтому я за "PHP" и "Java Script"
0
https://upload.wikimedia.org/wikipedia/commons/b/b5/Hexadecimal-counting.jpg
Просто оставлю это здесь
0
<?
class CHISLO {
private $arr = array('', 'один', 'два', 'три', 'четыре', 'пять', 'шесть', 'семь', 'восемь', 'девять', 'десять',
'одиннадцать', 'двенадцать', 'тринадцать', 'четырнадцать', 'пятнадцать',
'шестнадцать', 'семнадцать', 'восемнадцать', 'девятнадцать');
private $arr2 = array('', 'сто', 'двести', 'триста', 'четыреста');
private $ar = array(
1=>array('тысяч', 'тысяча', 'тысячи', 'тысячи', 'тысячи', 'тысяч', 'тысяч', 'тысяч', 'тысяч', 'тысяч'),
array('миллионов', 'миллион', 'миллиона', 'миллиона', 'миллиона', 'миллионов', 'миллионов',
'миллионов', 'миллионов', 'миллионов'),
array('миллиардов', 'миллиард', 'миллиарда', 'миллиарда', 'миллиарда', 'миллиардов', 'миллиардов',
'миллиардов', 'миллиардов', 'миллиардов'),
array('триллионов', 'триллион', 'триллиона', 'триллиона', 'триллиона', 'триллионов', 'триллионов',
'триллионов', 'триллионов', 'триллионов')
);
public function get_chislo($ch) {
if( $ch<1000 )
return $this->get_100($ch);
$ch = preg_split('/(?=(\d{3})+(?!\d))/is', $ch, -1, PREG_SPLIT_NO_EMPTY);
$ch = array_reverse($ch);
$result[] = $this->get_100($ch[0]);
for($i=1; $i<count($ch); $i++) {
@$result[] = $this->get_100($ch[$i]) .' '. $this->ar[$i]{$ch[$i]%10};
}
$result[1] = str_replace('один', 'одна', $result[1]);
// $result[1] = str_replace('два', 'две', $result[1]);
return join(' ', array_reverse($result));
}
private function get_100($ch) {
$c1 = (int)($ch / 100);
$c2 = $ch % 100;
if( $c1<5 )
$result = $this->arr2[$c1];
else
$result = $this->arr[$c1] . 'сот';
return @$result .' '. $this->get_10($c2);
}
private function get_10($ch) {
$c1 = (int)($ch / 10);
$c2 = $ch % 10;
if( $ch<20 ) {
$result = $this->arr[$ch];
} else if( $ch<40 ) {
$result = $this->arr[$c1] . 'дцать';
} else if( $ch<50 ) {
$result = 'сорок';
} else if( $ch<90 ) {
$result = substr( $this->arr[$c1], 0, -1 ) . 'десят';
} else if( $ch<100 ) {
$result = 'девяносто';
}
if( $ch>20 && $c2!=0 )
$result .= ' ' . $this->arr[$c2];
return $result;
}
}?>
Bitrix❤️
0
░████▓▓▓▓▓▓▓█▓█████████▓████▒
>████▓▓▓▓▓██▓▓████████████████
▓█▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓████▓
███▓▒▒▒▒▓▓▓▓▓▓▓▓██▓▓▓▓▓▓▓▓█████
██▓▓▒▒░<_▒▓▓▓▓▓▓▓▓▓▒▓▒▒▒▒▓▓███▓
██▓▓▒▒▒_ <▒▒▒▒▒▒▒░░▒▒▒▒▒▒███▒
░██▓▒▒▒░ _░▒▒▒▒▓██░
██▓█▓░_░_ _▒▒▒▒▒▓██
█▓▓█▓▒ < <░▒▒▒▒▓██
█▓▓▓▓▓▓░ <░▒▒▒▓▓█▓
█▒▓▓▒▒▒▒▓▒ ▒▒▓▒▓██
▓▓ ▒█▓▓▓▓█▒ __▒▒▒▓▓▒▒███
▓█▒ █▓▒ ▓▓▓< _ ▒▒▓▓▓▒▒▒▓▓▒▒██_
▒▒▒▓▓▒▓▓ ▒▓< ▓▒ ▒▓▓▒▓▓▓▓▓▒▓▒▓█<
░░▒▒▒▒▒▓▓▓▓▓▓▓▒▒▓░ ░░░ ░▒ _░ _ \█▓>░▒▓▒
▒▓▓▓▒▒░_ ▒▒▒▒▓▓▓▓▒░ ▒_▒▒▓ ▒\ _▒▒░▒▒ ▒▓▓▒
▓▓▓▒░> ▒▒▒▓▓▓▓▒░ __>▒▓▒ ▒░▒_ ▒▓▓▓▓▓▓░
▓▒▒_ ░▒▒▓▓▓▒▒▒ ▓▒ ░▒▒_ \▒▒▒▓▓▒░▒▒▓▓▓
▓▒▒░ ▒▒▒▓▓▒▒> ▓█ <▓▒ >▒▒▒▓▓▓ _<▒▒▒▓▓▓
▒_░ ▒▒ ▓▓▒▒< █▓▒_▒▓ _░▒▒▓▓▒ <▒▒▒▒▓▓▓
_ ▒▒░▓▓▒▒ ▒▒░▒_ ░▒▒▒▓▒▒▒ ░▒<░░▒▒▓▒
_ ▓▒▒▓▓▒▒▒▒░ ░▒ < ░▒▒▓▒▒▒▓< ░░▒▒▓▓
▓▓▒▓█▓▓▓▓▒▒░░_░▒_ _▒▒▓▒_▒▒▒▒\ _░▒▓▒
░▓▒▓▓▓▓▓▒▒▓██▓▒▒▓▒>_▒▒_▒▒▓▓░_▒▒▒▒▒\
_▓▓█▓▓▓▒▓▒▒▓███████▓▓▓▓▓▓▓▒▒▒▒▓▒▒▒░
>▓▓▓▓▓▓▓▓█▓▒<▒▓▓▒▓▓▓▓██▓▓▒▒▒▒▓▒▒▒░
▓▓▓▓▓█▓▓▓█▓▓▒▒▒▒▓▓██▒▒▒▒▒▒▒▒▒▒_
_ ▓▓▓▓▓▓▓▒▒▓▓▒▒▒▓██▓▒▒▒░▒▒▒▒▒▒\
▒▓▓██▓█▓▓▓▓▓██▓▓▒▒▒▒▒▒▒▒▒▒▒░░
_ _ ___ _ _▒▓███████▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒░_\
+2
switch (field.type) {
case 'checkbox':
case 'notification':
if (field.type == 'notification') {
fieldData.element.addClass('field-notification');
$('<span class="notification-button" data-action="notification">').text('Принять').appendTo(body).on(
'click', function () {
_class.wrapper.removeClass('notification');
_class.notification.wrapper.removeClass('notification-active');
_class.fields[index - 1].changeStatus();
$Mediator.fire({
name: 'active:filter',
target: _class.fields[0].filter
});
});
}
break;
}
Вдруг SWITCH не сработал)
−1
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
int main(void)
{
char a[8], b[8];
char *a_ptr = a+8;
char *b_ptr = b;
printf("a_ptr = %p, b_ptr = %p\n", a_ptr, b_ptr);
if (a_ptr != b_ptr)
{
printf("a_ptr != b_ptr\n");
}
else
{
printf("a_ptr == b_ptr\n");
}
if ((uintptr_t)a_ptr != (uintptr_t)b_ptr)
{
printf("(uintptr_t)a_ptr != (uintptr_t)b_ptr\n");
}
else
{
printf("(uintptr_t)a_ptr == (uintptr_t)b_ptr\n");
}
return EXIT_SUCCESS;
}
Что по-вашему тут происходит?
+2
// https://www.tutorialspoint.com/Read-a-character-from-standard-input-without-waiting-for-a-newline-in-Cplusplus
// A portable solution doesn't exist for doing this. On windows, you can use the getch() function from the conio(Console I/O) library to get characters pressed. For example,
#include<iostream>
#include<conio.h>
using namespace std;
int main() {
char c;
while(1){ // infinite loop
c = getch();
cout << c;
}
}
// This will output whatever character you input to the terminal. Note that this will only work on windows as the conio library exists only on windows. On UNIX, you can achieve this by entering in system raw mode. For example,
#include<iostream>
#include<stdio.h>
int main() {
char c;
// Set the terminal to raw mode
system("stty raw");
while(1) {
c = getchar();
// terminate when "." is pressed
if(c == '.') {
system("stty cooked");
exit(0);
}
std::cout << c << " was pressed."<< std::endl;
}
}
Вариант под UNIX еще и очень секурный, ЕВПОЧЯ
−2
Как перенести секцию ресурсов из одного филе в другое? Не корысти ради. Я - преемник робин-гуда.
Я не вор - я всего лишь нищий аристократ.
Ну да-да, заебали, вирь пишу.
Примерчик на пасцале, плз. Других языков я уже не знаю.
0
Нашёл смешной репозиторий у чувака из майкрософта, который
там делает помершелл грейт эгейн.
https://github.com/bitcrazed/badcase
+1
#include <stdio.h>
int main(void) {
puts("\x05pituh");
puts("\x06COCOCO");
puts("\x0000000005CO-CO");
puts("\00256");
return 0;
}
https://ideone.com/qNn7NF
Ололо, а я-то сразу и не понял в чём дело...