- 1
- 2
- 3
- 4
for ($i = 1, $i++; $i < 10; )
{
do_some();
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+162
for ($i = 1, $i++; $i < 10; )
{
do_some();
}
+105
public T GetT<T>(T t1, T t2) where T : class, IEnumerable<T>, new() { return new T().Concat(t1.Concat(t2)) as T; }
привет всем! давно я не выкладывал перлы)
история сего кода такова: сидел я и придумывал вопросы на анкетирование при принятии на работу в мою контору. дело дошло до дженериков. не долго думая родилась сия жесть. када я сам понял шо написал, был подстолом.
вчитайтесь (вдумайтесь) в код!
то шо получилось - это код, который с синтаксической точки зрения абсолютно правильный, и он закомпилируется, НО, этот метод невозможно вызвать принципе! нельзя построить синтаксическую конструкцию средствами языка, ибо это будет постоянно сложенный на один уровень енумерейбл дженерик.
так-то!
−131
# cmd.exe
subst 5: C:\Windows
собственно можно любою число от 0 до 9
правда прикол в том, что в отличии от subst Z: C:\Windows ( где в Май ПиСи будет отображен Z: ), в случае если int , то только из под cmd можно обратиться
cd 5:
+61.8
const int size=8;
class Bin
{
public:
Bin();
private:
char first[size];
char second[size];
};
Bin::Bin()
{
for (int s=0;s<=size;s++, first[s]='0');
}
Вот вам смешно? А я пару часов думал почему при заполнении одного вектора меняется другой...
0
(steps
(1 given (t (((x - y) = 3) & ((y + 5) = x))))
(2 rewrite (s 1) (path "/main/right/right") (t ((x = y) == (y = x))))
(3 addThisToBoth (s 2) (path "/main/right/left/left/right"))
(4 arrangeSum (s 3) (path "/right/right/left/right"))
(5 simplifySite (s 4) (path "/right/right/left/left"))
(6 replaceConjunct (s 5) (path "/right/right/left/left"))
(7 subtractThisFromBoth (s 6) (path "/right/right/left/left/left"))
(8 arrangeSum (s 7) (path "/right/right/left/right"))
(9 simplifySite (s 8) (path "/right/right/left/right"))
(10 arrangeSum (s 9) (path "/right/right/left/left"))
(11 simplifySite (s 10) (path "/right/right/left/left"))
(12 rewrite (s 11) (path "/right/right/left") (t (((R a) & (R b)) => ((a = b) == ((a - b) = 0)))))
(13 simplifyFocalPart (s 12))
(14 modusPonens (s 1) (s 13))
)
https://mathtoys.org/equations.html
Доказательство неразрешимости системы уравнений
x-y=3
y=5=x
Где x и y это ℝ
https://i.imgur.com/oY4FXTN.png
0
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define SIMPLIFY ^ -1
globalStorage[] = {3, 1819043146, 1998597229, 1684828781, 35, 0 };
int* localStorage = globalStorage + 1;
declarator(x) int x; { return x; }
main(void)
{
int* __L_LOCAL_BUF = malloc(-(localStorage[-1] SIMPLIFY) << 2);
for(localStorage[-(localStorage[-1] SIMPLIFY)] ^= localStorage[-(localStorage[-1] SIMPLIFY)];
localStorage[-(localStorage[-1] SIMPLIFY)] <
-(localStorage[-1] SIMPLIFY); ++localStorage[-(localStorage[-1] SIMPLIFY)])
__L_LOCAL_BUF[ localStorage[-(localStorage[-1] SIMPLIFY)]] =
localStorage[localStorage[-(localStorage[-1] SIMPLIFY)]]
^ (((2 * 2 * 2 * 2 * 2 * 2 * 2 *
((int_fast8_t*)((int_fast64_t)(declarator)-(-((-((2ll * 2ll * 2ll * 2ll * 2ll *
2ll * 2ll * 2ll * 2ll) ^ -1ll))
^ -1ll))))[0]) >> 1 >> 2 >> 3) /
((int_fast8_t*)((int_fast64_t)(declarator)-(-((-((2ll * 2ll * 2ll * 2ll * 2ll * 2ll *
2ll * 2ll * 2ll) ^ -1ll))
^ -1ll))))[0]);
printf("%s\n", (const char*)__L_LOCAL_BUF);
free(__L_LOCAL_BUF);
return 0;
}
Переписал Hello world под современные тренды и библиотеки.
0
def is_tuple(node: Node) -> bool:
match node:
case Node(children=[LParen(), RParen()]):
return True
case Node(children=[Leaf(value="("), Node(), Leaf(value=")")]):
return True
case _:
return False
https://www.python.org/dev/peps/pep-0622/
+1
namespace Test;
/**
* MyTest (test/mytest.zep)
*/
class MyTest
{
public function someMethod()
{
/* Variables must be declared */
var myArray;
int i = 0, length;
/* Create an array */
let myArray = ["hello", 0, 100.25, false, null];
/* Count the array into a 'int' variable */
let length = count(myArray);
/* Print value types */
while i < length {
echo typeof myArray[i], "\n";
let i++;
}
return myArray;
}
}
Язык программирования «Зефир».
https://docs.zephir-lang.com/0.12/en/introduction
0
import Foundation
@objc protocol SomethingDoable {
func doSomething()
}
class Inner: SomethingDoable {
@objc func doSomething() {
print("Inner!")
}
}
@objc class Outer: NSObject {
let inner: SomethingDoable = Inner()
override func forwardingTarget(for aSelector: Selector!) -> Any? {
return inner
}
}
let outer = Outer()
outer.perform(#selector(SomethingDoable.doSomething))
Удачного дебага!
+1
void Start () {
carRight1 = GameObject.Find("CarRight1");
carRight2 = GameObject.Find("CarRight2");
carRight3 = GameObject.Find("CarRight3");
carRight4 = GameObject.Find("CarRight4");
carRight5 = GameObject.Find("CarRight5");
carRight6 = GameObject.Find("CarRight6");
carRight7 = GameObject.Find("CarRight7");
carRight8 = GameObject.Find("CarRight8");
carRight9 = GameObject.Find("CarRight9");
carRight10 = GameObject.Find("CarRight10");
carRight11 = GameObject.Find("CarRight11");
carRight12 = GameObject.Find("CarRight12");
carRight13 = GameObject.Find("CarRight13");
carRight14 = GameObject.Find("CarRight14");
carRight15 = GameObject.Find("CarRight15");
carRight16 = GameObject.Find("CarRight16");
carRight17 = GameObject.Find("CarRight17");
carLeft1 = GameObject.Find("CarLeft1");
carLeft2 = GameObject.Find("CarLeft2");
carLeft3 = GameObject.Find("CarLeft3");
carLeft4 = GameObject.Find("CarLeft4");
carLeft5 = GameObject.Find("CarLeft5");
carLeft6 = GameObject.Find("CarLeft6");
carLeft7 = GameObject.Find("CarLeft7");
carLeft8 = GameObject.Find("CarLeft8");
carLeft9 = GameObject.Find("CarLeft9");
carLeft10 = GameObject.Find("CarLeft10");
carLeft11 = GameObject.Find("CarLeft11");
carLeft12 = GameObject.Find("CarLeft12");
carLeft13 = GameObject.Find("CarLeft13");
carLeft14 = GameObject.Find("CarLeft14");
carLeft15 = GameObject.Find("CarLeft15");
carLeft16 = GameObject.Find("CarLeft16");
carLeft17 = GameObject.Find("CarLeft17");
carLeft18 = GameObject.Find("CarLeft18");
carLeft19 = GameObject.Find("CarLeft19");
carLeft20 = GameObject.Find("CarLeft20");
carLeft21 = GameObject.Find("CarLeft21");
carLeft22 = GameObject.Find("CarLeft22");
speed = 15f;
//gameObject.transform.localScale = new Vector3(0, 0, 0);
}
// Update is called once per frame
void Update () {
carRight1.GetComponent<Rigidbody>().velocity = carRight1.transform.forward * speed;
carRight2.GetComponent<Rigidbody>().velocity = carRight2.transform.forward * speed;
carRight3.GetComponent<Rigidbody>().velocity = carRight3.transform.forward * speed;
carRight4.GetComponent<Rigidbody>().velocity = carRight4.transform.forward * speed;
carRight5.GetComponent<Rigidbody>().velocity = carRight5.transform.forward * speed;
carRight6.GetComponent<Rigidbody>().velocity = carRight6.transform.forward * speed;
carRight7.GetComponent<Rigidbody>().velocity = carRight7.transform.forward * speed;
carRight8.GetComponent<Rigidbody>().velocity = carRight8.transform.forward * speed;
carRight9.GetComponent<Rigidbody>().velocity = carRight9.transform.forward * speed;
carRight10.GetComponent<Rigidbody>().velocity = carRight10.transform.forward * speed;
carRight11.GetComponent<Rigidbody>().velocity = carRight11.transform.forward * speed;
carRight12.GetComponent<Rigidbody>().velocity = carRight12.transform.forward * speed;
carRight13.GetComponent<Rigidbody>().velocity = carRight13.transform.forward * speed;
carRight14.GetComponent<Rigidbody>().velocity = carRight14.transform.forward * speed;
carRight15.GetComponent<Rigidbody>().velocity = carRight15.transform.forward * speed;
carRight16.GetComponent<Rigidbody>().velocity = carRight16.transform.forward * speed;
carRight17.GetComponent<Rigidbody>().velocity = carRight17.transform.forward * speed;
carLeft1.GetComponent<Rigidbody>().velocity = carLeft1.transform.forward * speed;
carLeft2.GetComponent<Rigidbody>().velocity = carLeft2.transform.forward * speed;
carLeft3.GetComponent<Rigidbody>().velocity = carLeft3.transform.forward * speed;
carLeft4.GetComponent<Rigidbody>().velocity = carLeft4.transform.forward * speed;
carLeft5.GetComponent<Rigidbody>().velocity = carLeft5.transform.forward * speed;
carLeft6.GetComponent<Rigidbody>().velocity = carLeft6.transform.forward * speed;
carLeft7.GetComponent<Rigidbody>().velocity = carLeft7.transform.forward * speed;
carLeft8.GetComponent<Rigidbody>().velocity = carLeft8.transform.forward * speed;
carLeft9.GetComponent<Rigidbody>().velocity = carLeft9.transform.forward * speed;
carLeft10.GetComponent<Rigidbody>().velocity = carLeft10.transform.forward * speed;
carLeft11.GetComponent<Rigidbody>().velocity = carLeft11.transform.forward * speed;
carLeft12.GetComponent<Rigidbody>().velocity = carLeft12.transform.forward * speed;
carLeft13.GetComponent<Rigidbody>().velocity = carLeft13.transform.forward * speed;
carLeft14.GetComponent<Rigidbody>().velocity = carLeft14.transform.forward * speed;
carLeft15.GetComponent<Rigidbody>().velocity = carLeft15.transform.forward * speed;
carLeft16.GetComponent<Rigidbody>().velocity = carLeft16.transform.forward * speed;
carLeft17.GetComponent<Rigidbody>().velocity = carLeft17.transform.forward * speed;
carLeft18.GetComponent<Rigidbody>().velocity = carLeft18.transform.forward * speed;
carLeft19.GetComponent<Rigidbody>().velocity = carLeft19.transform.forward * speed;
carLeft20.GetComponent<Rigidbody>().velocity = carLeft20.transform.forward * speed;
carLeft21.GetComponent<Rigidbody>().velocity = carLeft21.transform.forward * speed;
carLeft22.GetComponent<Rigidbody>().velocity = carLeft22.transform.forward * speed;
}
Обнаружил на ПК у "коллеги" по цеху. AI для машинок... (Сами переменные не влезли, но легко понять как они заданы.)