- 1
https://github.com/syn2cat/pidor
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−6
https://github.com/syn2cat/pidor
−10
Вопрос
Кто знает, как динамически выделить память, заполнить её нужными инструкциями, и исполнить этот код, не испытав при этом анальной боли и не получить Segmentation Fault ?
0
class Task:
def set_activity( activity_method ):
# проанализировать исходный код activity_method
# разделить цепочку команд на N частей
pass
def _get_parts_number():
return N
def _run_part( part_num ):
# выполнить часть part_num
pass
def run(tasks):
execution = True
part_num = 0
while execution:
execution = False
for task in tasks:
if part_num < task._get_parts_number():
task._run_part( part_num )
execution = True
part_num += 1
Попросил коллегу реализовать concurrency многозадачность, он на питоне нагавнякал такое.
+1
public static class MyExtensions {
private static Random _random = new Random();
public static bool IsMnogo(this object value) {
try {
var n = double.Parse(value.ToString());
return n > 9999999999;
} catch {
return true;
}
}
public static bool IsDavno(this DateTime value) {
return value < new DateTime(1900 + _random.Next(10, 90), 04, 17);
}
}
−2
for word in {"Блять", "пишите", "красивые" ,"коды" ,"уёбки", ",", "ради", "энтузиазма", "и", "плодотворного", "труда", ",", "почитайте", "книжку", "сталина", "и", "поймёте", "как", "надо", "делать", "сруны", "говнокодерные!"}; do
echo "$word"
done
хули?
0
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="css/style.css">
<!--[if IE]>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js"></script>
<![endif]-->
<style>
article, aside, details, figcaption, figure, footer,header,
hgroup, menu, nav, section { display: block; }
</style>
</head>
<body>
<form id="form">
<input type="date">
<input id="inp" type="email" required>
<input type="submit">
</form><br>
<section itemtype="http://data-vocabulary.org/Person" itemscope>
<h1 itemprop="name">Mark Pilgrim</h1>
<p><img itemprop="photo" src="http://www.example.com/photo.jpg" alt="[me smiling]"></p>
<p><a itemprop="url" href="http://diveintomark.org/">weblog</a></p>
</section>
<progress id="pg" value="50" max="100">
<br>
<script>
let forward = true;
function pgset() {
if(forward) {
pg.value = +pg.value + 1;
if(+pg.value == 100)
forward = false;
}
else {
pg.value = +pg.value - 1;
if(+pg.value == 0)
forward = true;
}
}
//setInterval(pgset, 100); //нахуй!
</script>
</body>
</html>
Куда мне ещё говно скидывать??
0
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="css/style.css">
<!--[if IE]>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js"></script>
<![endif]-->
<style>
article, aside, details, figcaption, figure, footer,header,
hgroup, menu, nav, section { display: block; }
</style>
</head>
<body>
<input id="inp" type="number" placeholder="num" min="-2" max="37" step="7" value="17">
<br>
<input type="button" value="+" onclick="plus()">
<input type="button" value="-" onclick="minus()">
<br>
<div id="info"></div><br>
<input id="rng" type="range" min="0" max="255" step="1" value="0" onchange="info2.innerHTML = rng.value; info2.style.color = 'rgb('+rng.value+','+0+','+rng.value+')'">
<div id="info2"></div>
<br>
<input type="date">
<input type="time">
<br>
<input type="search">
<script>
function plus() {
inp.stepUp(3);
Info();
}
function minus() {
inp.stepDown(3);
Info();
}
function Info() {
info.innerHTML = inp.valueAsNumber;
}
</script>
</body>
</html>
0
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="css/style.css">
<!--[if IE]>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js"></script>
<![endif]-->
<style>
article, aside, details, figcaption, figure, footer,header,
hgroup, menu, nav, section { display: block; }
</style>
</head>
<body>
<div id="example">
Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test. Test test test test test.
</div>
<style>
#example {
width: 300px;
height: 200px;
border: 25px solid #E8C48F; /* рамка 25px */
padding: 20px; /* поля 20px */
overflow: auto; /* прокрутка */
}
</style>
<input type="button" value="Размер снизу" onclick="below()">
<input type="button" value="Ширина полосы прокрутки" onclick="widthScroll(example)">
<script>
function below() {
alert(example.scrollHeight-example.scrollTop-example.clientHeight);
}
function widthScroll(elem) {
alert((elem.offsetWidth-(elem.clientLeft*2))-elem.clientWidth+'px');
}
</script>
</body>
</html>
1488 плохое число
0
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="css/style.css">
<!--[if IE]>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js"></script>
<![endif]-->
<style>
article, aside, details, figcaption, figure, footer,header,
hgroup, menu, nav, section { display: block; }
#moving-div {
border: 5px groove green;
padding: 5px;
margin: 10px;
background-color: yellow;
}
</style>
</head>
<body>
Before Before Before
<div id="moving-div">
Text Text Text<br>
Text Text Text<br>
</div>
After After After
<script type="text/javascript">
'use strict';
let empty = document.createElement('div');
let mdiv = document.getElementById('moving-div');
let cs = getComputedStyle(mdiv);
function clone_Node(elem) { //плохая релизация глючит:(((
let r = document.createElement(elem.tagName);
for(let k of getComputedStyle(elem)) {
try {
r.style[k] = getComputedStyle(elem)[k];
}
catch(e) { /*пофиг!*/ }
}
r.innerHTML = elem.innerHTML;
return r;
}
let copy = mdiv.cloneNode(true);
mdiv.style.opacity = '0';
copy.style.position = 'absolute';
copy.style.right = copy.style.top = 0;
mdiv.after(copy);
</script>
</body>
</html>
хуй!
−106
Кто желает вывернуть мой похотливый, жадный до хуёв анус наизнанку?
Нужен крепкий, выносливый самец с толстым.