- 1
Сучечки, ну и где же теперь Ваш крым?
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−104
Сучечки, ну и где же теперь Ваш крым?
Из-за дороговизны и налогов люди едут в эмираты.
0
var a=new Array();
a['line']=document.getElementById('water_disconnection_search').value;
array-oriented programming
https://www.teplosetspb.ru/water_disconnection
−1
#include <iostream>
#include <string>
#include <sstream>
#include <string.h>
#include <stdlib.h>
typedef std::ios_base& sibr;
typedef sibr (*StringType)(sibr);
int atoi_hod(const char a[], short int *offset)
{
short int numtype = (a[0]== '0')+((a[1]=='x')||(a[1]=='X'));
StringType st;
*offset = 0;
while(a[*offset]&&a[*offset]!='.') (*offset)=(*offset)+1;
switch (numtype)
{
case 0:
st = std::dec;
break;
case 1:
st = std::oct;
break;
case 2:
st = std::hex;
break;
}
int u;
std::istringstream(a)>>st>>u;
return u;
}
bool isIpv4String(const std::string &str)
{
size_t size = str.length();
bool result = size!=0;
if(result)
{
const char *c_str = str.c_str();
unsigned long int i = 0;
char sym;
do
{
sym = c_str[i++];
result = sym=='.'||(sym>='0'&&sym<='9')||!sym||(sym>='a'&&sym<='f')||(sym>='A'&&sym<='F')||sym=='x'||sym=='X';
}
while (sym&&result);
i = 0;
short int dotsOrTerm = 0, numbers = 0, offset;
while (result&&i<size)
{
int n = atoi_hod(&c_str[i], &offset);
result = n<256;
numbers += result;
i += offset;
result = result&&(c_str[i]=='.'||!c_str[i]);
i+=result;
dotsOrTerm += result;
}
result = (dotsOrTerm == 4)&&(numbers == 4);
}
return result;
}
int main()
{
std::string adress;
std::cin>>adress;
std::cout<<(isIpv4String(adress)?"TRUE":"FALSE")<<std::endl;
return 0;
}
По мотивам ГК #24055, наконец-то руки дошли.
+3
namespace CarsKursova
{
public static class Car
{
public static int x1, x2, x3, x4, x5, x6, x7, x8, x9, x10,
x11, x12, x13, x14, x15, x16, x17, x18, x19, x20,
x21, x22, x23, x24, x25, x26, x27, x28, x29, x30,
x31, x32, x33, x34, x35, x36, x37, x38, x39, x40,
x41, x42, x43, x44, x45, x46, x47, x48, x49, x50,
x51, x52, x53, x54, x55, x56, x57, x58, x59, x60,
x61, x62, x63, x64, x65, x66, x67, x68, x69, x70,
x71, x72, x73, x74, x75, x76, x77, x78, x79, x80,
x81, x82, x83, x84,
y1, y2, y3, y4, y5, y6, y7, y8, y9, y10,
y11, y12, y13, y14, y15, y16, y17, y18, y19, y20,
y21, y22, y23, y24, y25, y26, y27, y28, y29, y30,
y31, y32, y33, y34, y35, y36, y37, y38, y39, y40,
y41, y42, y43, y44, y45, y46, y47, y48, y49, y50,
y51, y52, y53, y54, y55, y56, y57, y58, y59, y60,
y61, y62, y63, y64, y65, y66, y67, y68, y69, y70,
y71, y72, y73, y74, y75, y76, y77, y78, y79, y80,
y81, y82, y83, y84;
public static string car = " ";
public static bool game_over = false;
public static bool fix = true;
public static int score = 0;
public static char[,] game_grond = new char[35, 29];
public static char[,] game_gr = new char[35, 29];
....
}
public static void RisovPole()
{
p = Console.CursorTop;
z = Console.CursorLeft;
Console.ForegroundColor = ConsoleColor.Cyan;
WriteAt("|*|", 29, 0);
WriteAt("|*|", 29, 1);
WriteAt("|*|", 29, 2);
WriteAt("|*|", 29, 3);
WriteAt("|*|", 29, 4);
WriteAt("|*|", 29, 5);
WriteAt("|*|", 29, 6);
WriteAt("|*|", 29, 7);
WriteAt("|*|", 29, 8);
WriteAt("|*|", 29, 9);
WriteAt("|*|", 29, 10);
WriteAt("|*|", 29, 11);
WriteAt("|*|", 29, 12);
WriteAt("|*|", 29, 13);
WriteAt("|*|", 29, 14);
WriteAt("|*|", 29, 15);
WriteAt("|*|", 29, 16);
WriteAt("|*|", 29, 17);
WriteAt("|*|", 29, 18);
WriteAt("|*|", 29, 19);
WriteAt("|*|", 29, 20);
WriteAt("|*|", 29, 21);
WriteAt("|*|", 29, 22);
WriteAt("|*|", 29, 23);
WriteAt("|*|", 29, 24);
WriteAt("|*|", 29, 25);
WriteAt("|*|", 29, 26);
WriteAt("|*|", 29, 27);
WriteAt("|*|", 29, 28);
WriteAt("|*|", 29, 29);
WriteAt("|*|", 29, 30);
WriteAt("|*|", 29, 31);
WriteAt("|*|", 29, 32);
WriteAt("|*|", 29, 33);
WriteAt("|*|", 29, 34);
WriteAt("-----------------------------+*|", 0, 35);
WriteAt("*******************************|", 0, 36);
WriteAt("-------------------------------+\n\n\n\n\n\n\n\n\n\n\n", 0, 37);
Console.ResetColor();
}
public static void carplins()
{
y1 = 27; x1 = 13; y22 = 31; x22 = 13;
y2 = 27; x2 = 14; y23 = 31; x23 = 14;
y3 = 27; x3 = 15; y24 = 31; x24 = 15;
y4 = 28; x4 = 13; y25 = 32; x25 = 13;
y5 = 28; x5 = 14; y26 = 32; x26 = 14;
y6 = 28; x6 = 15; y27 = 32; x27 = 15;
y7 = 29; x7 = 10; y28 = 33; x28 = 10;
y8 = 29; x8 = 11; y29 = 33; x29 = 11;
y9 = 29; x9 = 12; y30 = 33; x30 = 12;
y10 = 29; x10 = 13; y31 = 33; x31 = 13;
y11 = 29; x11 = 14; y32 = 33; x32 = 14;
y12 = 29; x12 = 15; y33 = 33; x33 = 15;
y13 = 29; x13 = 16; y34 = 33; x34 = 16;
y14 = 29; x14 = 17; y35 = 33; x35 = 17;
y15 = 29; x15 = 18; y36 = 33; x36 = 18;
y16 = 30; x16 = 10; y37 = 34; x37 = 10;
y17 = 30; x17 = 11; y38 = 34; x38 = 11;
y18 = 30; x18 = 12; y39 = 34; x39 = 12;
y19 = 30; x19 = 16; y40 = 34; x40 = 16;
y20 = 30; x20 = 17; y41 = 34; x41 = 17;
Тетрисные гонки в консоли.
По ссылке - дермомонстр на 400 строк - http://www.cyberforum.ru/csharp-beginners/thread2169797.html
−105
МИД высылает из России дипломатов из Австралии, Албании, Германии, Дании, Ирландии,
Испании, Италии, Канады, Латвии, Литвы, Македонии, Молдавии, Нидерландов, Норвегии,
Польши, Румынии, Украины, Финляндии, Франции, Хорватии, Чехии, Швеции и Эстонии.
Рашке приходит конец.
0
<?php
/* Здесь проверяется существование переменных */
if (isset($_POST['phone'])) {$phone = $_POST['phone'];}
if (isset($_POST['name'])) {$name = $_POST['name'];}
/* Сюда впишите свою эл. почту */
$address = "[email protected]";
/* А здесь прописывается текст сообщения, \n - перенос строки */
$mes = "Тема: Заказ обратного звонка!\nТелефон: $phone\nИмя: $name\nE-mail: $email";
/* А эта функция как раз занимается отправкой письма на указанный вами email */
$sub='Заказ'; //сабж
$email='Заказ <vzhope.ru>'; // от кого
$send = mail ($address,$sub,$mes,"Content-type:text/plain; charset = utf-8\r\nFrom:$email");
ini_set('short_open_tag', 'On');
header('Refresh: 3; URL=index.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content="3; url=index.php">
<title>С вами свяжутся</title>
<meta name="generator">
<style type="text/css">
body
{
background: #22BFF7 url(img/zakaz.jpg) top -70% center no-repeat;
}
<script type="text/javascript">
setTimeout('location.replace("/index.php")', 0);
/*Изменить текущий адрес страницы через 3 секунды (3000 миллисекунд)*/
</script>
</head>
</body>
</html>
Вот такие у нас теперь лендинги...
Нужно больше переадресаций, богу переадресаций!!!1
−4
Кто из тутошних пососёт мой до омерзения жилистый кол? Кто полижет мои эспандеры?
−4
Кто может прочистить мою трубу?.. У меня запор.
0
'use strict';
function map(fn, array) {
let arr = [];
for(let i of array)
arr.push(fn(i));
return arr;
}
function take(fn, count) {
var arr = [];
for(let i = 0; i < count; i++)
arr.push(fn());
return arr;
}
function sequence(start, step)
{
step = step || 1;
start = start || 0;
start-=step;
return function() {
return start+=step;
}
}
function fmap(a, gen) {
return (...args) => {
if(args.length > 0)
return a(gen(...args));
else
return a(gen());
};
}
function partial(fn, ...args) {
return (...twoArgs) => {
let newM = args.slice();
for(let k of twoArgs)
newM.push(k);
return fn(...newM);
};
}
function partialAny(fn, ...args) {
return (...twoArgs) => {
let newM = args.slice();
let k = 0;
for(let i = 0; i < newM.length; i++)
if(newM[i] === undefined)
newM[i] = twoArgs[k++];
while(twoArgs[k] !== undefined) {
newM.push(twoArgs[k]);
k++;
}
return fn(...newM);
};
}
function bind(fn, context) {
return (...args) => {
return fn.apply(context, args);
};
}
function pluck(objects, fieldName) {
let a = [];
for(let i = 0; i < objects.length; i++)
if(objects[i][fieldName] !== undefined)
a.push(objects[i][fieldName]);
return a;
}
function filter(arr, fn) {
let a = [];
arr.forEach((item, i, arr) => {
if(fn(item))
a.push(item);
});
return a;
}
function count(arr) {
return Object.keys(arr).length;
}
var a = { a: 1, b: 2 };
console.log(count(a)); // 2
var b = function () {};
console.log(count(b)); // 0
var c = [1, 2, 3];
console.log(count(c)); // 3
var d = [];
d[100] = 1;
console.log(count(d)); // 1
Ня (^_^)
Суперкодики!
+4
template<class T, T = 1>
constexpr bool __can_one(int) { return true; };
template<class T>
constexpr bool __can_one(long) { return false; };
template <class T>
constexpr bool is_integral_v = __can_one<T>(0);
https://twitter.com/ericniebler/status/976524085927731200
Не кто попало, а автор Ranges TS (без пяти минут кусок стандарта) сомневается, валидную метушню он написал или нет. Пора уже создавать крестоблядский суд, который будет трактовать букву стандарта и решать, где с++ а где нет. И разрабы гцц будут нанимать за бешеное бабло крестоблядских юристов и судиться в крестоблядском суде с авторами багрепортов.