- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
class C
{
val: number;
constructor()
{
this.val = 2;
}
}
function o(val? : C)
{
print(val?.val);
}
function main()
{
o(new C());
o(null);
o();
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−8
class C
{
val: number;
constructor()
{
this.val = 2;
}
}
function o(val? : C)
{
print(val?.val);
}
function main()
{
o(new C());
o(null);
o();
}
Новый говнокод подоспел.... а как тебе такое слабый ужасный С/C++ ... ты так умеешь?
Результат работы:
C:\temp>C:\dev\TypeScriptCompiler\__build\tsc\bin\tsc.exe --emit=jit --opt --shared-libs=C:\dev\TypeScriptCompiler\__build\tsc\bin\TypeScriptRuntime.dll C:\temp\1.ts
2
0
0
+3
// https://deadlockempire.github.io/
// Игра, где надо играть за планировщик чтоб вызвать дедлок
// https://deadlockempire.github.io/#2-flags
// First Army
while (true) {
while (flag != false) {
;
}
flag = true;
critical_section();
flag = false;
}
// Second Army
while (true) {
while (flag != false) {
;
}
flag = true;
critical_section();
flag = false;
}
The day finally came. The Deadlock Empire opened its gates and from them surged massive amounts of soldiers, loyal servants of the evil Parallel Wizard. The Wizard has many strengths - his armies are fast, and he can do a lot of stuff that we can't. But now he set out to conquer the world, and we cannot have that.
You are our best Scheduler, commander! We have fewer troops and simpler ones, so we will need your help. Already two armies of the Deadlock Empire are approaching our border keeps. They are poorly equipped and poorly trained, however. You might be able to desync them and break their morale.
0
t = rx + (ry * 100);
std::vector<std::string> tmap;
coin = 0;
rcol = 0;
roomname = "Untitled room ["+UtilityClass::String(rx) + "," + UtilityClass::String(ry)+"]";
switch(t)
{
case rn(50,50):
tmap.push_back("283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,284,444,444,444,444,444,444,444,444,444,285,283,284,444,444,444,444,444,444,444,444,444,444,444,444,285,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,405,0,0,0,363,364,365,0,0,0,403,283,405,0,0,0,363,364,365,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,443,444,445,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("444,444,444,444,444,444,285,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("0,0,0,0,0,0,403,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("0,0,0,0,0,0,403,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("0,0,0,0,0,0,403,283,405,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,325,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("0,0,0,0,0,0,403,283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("0,0,0,0,0,0,403,283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,285,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("364,364,365,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,405,0,0,0,403,283,324,364,364,364,364,364,364,364,364,364,364,364,365,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,405,0,0,0,403,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,405,0,0,0,443,444,444,444,444,444,444,444,444,444,444,444,444,444,445,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,405,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,403,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,324,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,325,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
tmap.push_back("283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,405,0,0,0,0,0,0,403,283,283,283,283,283,283");
obj.createentity(game, 232, 24, 10, 0, 250500); // (savepoint)
if(game.intimetrial)
{
obj.createblock(0, 0, 0, 8, 240);
}
rcol=1;
roomname = "Get Ready To Bounce";
break;
Именно поэтому я за «std::embed».
https://github.com/TerryCavanagh/VVVVVV/blob/master/desktop_version/src/Labclass.cpp
+2
<?php
define('_SECUR_GAMES', 1);
$rootpath = '../';
require_once '../includes/start.php';
require_once '../includes/function.php';
require_once '../includes/header.php';
if($level >0 AND $fr_id!=0)
{
$header='alliance';
mysql_query("UPDATE `mesto` SET `place` = '".check(htmlspecialchars(stripslashes(addslashes(strip_tags(mysql_real_escape_string(trim($header)))))))."' WHERE `uid`=".check(htmlspecialchars(stripslashes(addslashes(strip_tags(mysql_real_escape_string(trim($use_id)))))))."");
}
$fr=check(htmlspecialchars(stripslashes(addslashes(strip_tags(mysql_real_escape_string(trim($_GET['f'])))))));
$q = mysql_query("SELECT * FROM `fractions` WHERE `id`='".check(htmlspecialchars(stripslashes(addslashes(strip_tags(mysql_real_escape_string(trim($fr)))))))."'");
$f = mysql_fetch_array($q);
$ucount = mysql_result(mysql_query("SELECT COUNT(*) FROM `fractions_users` WHERE `uid`='".check(htmlspecialchars(stripslashes(addslashes(strip_tags(mysql_real_escape_string(trim($use_id)))))))."' AND `fid`='".check(htmlspecialchars(stripslashes(addslashes(strip_tags(mysql_real_escape_string(trim($f['id'])))))))."';"), 0);
$fadm = mysql_result(mysql_query("SELECT COUNT(*) FROM `fractions_users` WHERE `uid`='".check(htmlspecialchars(stripslashes(addslashes(strip_tags(mysql_real_escape_string(trim($use_id)))))))."' AND `fid`='".check(htmlspecialchars(stripslashes(addslashes(strip_tags(mysql_real_escape_string(trim($f['id'])))))))."' AND `adm`=1;"), 0);
if($game==0 OR $level==0 OR $ban==1){
echo "<title>Доступ закрыт!!!</title>";
@since 2019
−1
def da_pizda(update, context):
global da_counter, pizda_counter
text = update.message.text.split()
text = [word.lower() for word in text]
if 'дa' in text or 'da' in text or 'dа' in text:
text.append('да')
if 'пиздa' in text or 'pizda' in text or 'pizdа' in text or 'Πизда' in text:
text.append('пизда')
if 'да' in text:
bot.send_message(chat_id=update.message.chat_id, text='пизда',
reply_to_message_id=update.message.message_id)
pizda_counter += 1
if 'пизда' in text:
bot.send_message(chat_id=update.message.chat_id, text='да',
reply_to_message_id=update.message.message_id)
da_counter += 1
da_counter += update.message.text.split().count('да')
pizda_counter += update.message.text.split().count('пизда')
Бот, проверяющий наличие слов "да" и "пизда" в чате телеграма, и отвечающий соответственно.
0
checkTableFilters () {
if (this._activeTableFilter && this._filter.filter._filters.get(this._activeTableFilter)) {
this._filter.filter._filters.get(this._activeTableFilter).Update();
}
}
"Так вышло" - хороший ответ.
1. this._filter.filter._filters (фильтры фильтра фильтра?..)
2. Зачем имитировать приватность полей класса соглашением о наименовании, если её игнорируют как могут?..
3. ... дополните сами
+2302
http://govnokod.ru/20924
Запрашиваемая страница не найдена!
Возможно, её и не было никогда
http://dump.bitcheese.net/files/pimarut/%D0%93%D0%BE%D0%B2%D0%BD%D0%BE%D0%BA%D0%BE%D0%B4_%2320924_%E2%80%94_C___%E2%80%94_%D0%93%D0%BE%D0%B2%D0%BD%D0%BE%D0%BA%D0%BE%D0%B4.%D1%80%D1%83.html
но бекап я сделал, так что хуй вам. Я требую продолжения банкета.
+5
function is_assoc( $array ) {
return is_array($array) && substr( json_encode($array), 0, 1 ) == '{';
}
+5
class Db {
private $where;
private $select = '*';
private $limit;
private $order_by;
private $query;
private $set;
private function query_string($table){
$query = ($this->query) ? $this->query : "SELECT $this->select FROM $table WHERE $this->where $this->order_by $this->limit";
return $query;
}
function query($text){
$this->query = $text;
return $this;
}
function where_text($text){
$operator = 'AND';
if (!$this->where){
$this->where = $text;
} else {
$this->where .= $operator." ".$text;
}
return $this;
}
function order_by_text($text){
if (!$this->order_by){
$this->order_by = ' ORDER BY '.$text;
} else {
$this->order_by .= ', '.$text;
}
}
function connect($host,$login_mysql,$password_mysql,$baza_name) {
$db = @mysql_connect("$host", "$login_mysql", "$password_mysql");
mysql_set_charset('utf8',$db);
if (!$db) exit("<p>Sorry, not available MySQL server</p>");
if (!@mysql_select_db($baza_name,$db)) exit("<p>Unfortunately, the database is not available</p>");
}
function select($column){
$this->select = $column;
return $this;
}
function limit($start,$count){
$this->limit = ' LIMIT '.$start.','.$count;
return $this;
}
function order_by($key){
if (is_array($key)){
foreach ($key as $column => $value){
if (!$this->order_by){
$this->order_by = ' ORDER BY '.$column.' '.$value;
} else {
$this->order_by .= ', '.$column.' '.$value;
}
}
} else {
if (!$this->order_by){
$this->order_by = ' ORDER BY '.$key;
} else {
$this->order_by .= ', '.$key;
}
}
return $this;
}
function where($key,$compare = '='){
$operator = 'AND';
if (is_array($key)){
foreach ($key as $column=>$value){
if (!$this->where){
$this->where = $column.$compare."'".$value."' ";
} else {
$this->where .= $operator." ".$column.$compare."'".$value."' ";
}
}
} else {
$key = explode(',',$key);
if (!$this->where){
$this->where = $key[0].$compare."'".$key[1]."' ";
} else {
$this->where .= $operator." ".$key[0].$compare."'".$key[1]."' ";
}
}
return $this;
}
function search($column,$search){
$operator = 'AND';
$search = strtr($search,array(" "=>" +"));
$search = '+'.$search;
$w = 'MATCH('.$column.") AGAINST('".$search."' IN BOOLEAN MODE)";
if (!$this->where){
$this->where = $w;
} else {
$this->where .= $operator." ".$w;
}
return $this;
}
function lines($table,$ext = true){
$msql_query = mysql_query($this->query_string($table));
$line = mysql_fetch_assoc($msql_query);
"Удобный php класс для работы с MySQL"
https://habrahabr.ru/post/277095
+175
function json2array($json_data)
{
$json_array = false;
$json = substr($json, 1, -1);
$json = str_replace(array(":", "{", "[", "}", "]"), array("=>", "array(", "array(", ")", ")"), $json_data);
@eval("\$json_array = array({$json});");
return $json_array;
}
Парсим json