- 1
- 2
- 3
- 4
- 5
function get_the_fucking_first_image_from_the_fucking_content_DUDE_is_this_really_so_hard($content)
{
preg_match_all('/(<img .*? src=\"\/images.*?\">?)/', $content, $result);
return $result[0][0];
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+164
function get_the_fucking_first_image_from_the_fucking_content_DUDE_is_this_really_so_hard($content)
{
preg_match_all('/(<img .*? src=\"\/images.*?\">?)/', $content, $result);
return $result[0][0];
}
мне кажется, коллега задолбался
−94
import time
def inttime():
return int(''.join(str(time.time()).split('.')))
def rand():
while True:
s = bin(inttime())[2:]
for x in s:
yield x
Этим "рандомом" заполняется клеточный автомат "Жизнь". Нечего было делать.
+167
gl.drawArrays(gl.QUADS, 0, 4);
// WebGL рисует черный экран с четырьмя точками.
bormand vs WebGL. Акт второй.
Как оказалось, в OpenGL ES выпилили GL_QUADS и GL_POLYGON.
Но т.к. в js несуществующее поле это null, а null это 0, а 0 это GL_POINTS, то рисуются 4 точки ;)
+133
// bormand: Ну что, затестим шейдер в WebGL...
int iter = 0;
while (iter < 1000 && length(z) < 2.0) {
z = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + c;
iter++;
}
// compileShader: 'while' : This type of loop is not allowed
// bormand: WTF?! В обычном OpenGL же работало, ну ок...
int iter = 0;
for (; iter < 1000; iter++) {
if (length(z) < 2.0)
break;
z = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + c;
}
// compileShader: 'for' : Missing init declaration
// bormand: Да что за херня!?
for (iter = 0; iter < 1000; iter++) {
// compileShader: 'for' : Invalid init declaration
// bormand: Подавись, сука!
int iters = -1;
for (int iter = 0; iter < 1000; iter++) {
if (length(z) < 2.0) {
iters = iter;
break;
}
z = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + c;
}
// compileShader: ok.
bormand vs WebGL
+125
@ECHO OFF
VESAINF %1
PAUSE
Фикс к программе на ассемблере с исходным кодом.
http://masm32.com/board/index.php?topic=2727.msg29659#msg29659
+126
<input type="text" id="tos" name="tos" data-validate="true" class="text-field" tabindex="6" data-validation-rules="^(https?|ftp):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$" data-validation-msg="Invalid URL" />
Monkey killing monkey killing monkey
Over pieces of the ground.
Silly monkeys give them thumbs,
They forge a blade,
And where there's one
they're bound to divide it,
Right in two.
Right in two.
:'(
+16
// https://github.com/mono/moon/blob/master/src/list.h#L87
class Queue {
protected:
MoonMutex lock;
List *list;
public:
Queue ();
~Queue ();
// convenience properties
bool IsEmpty ();
int Length ();
// convenience methods
void Clear (bool freeNodes);
void Push (List::Node *node);
List::Node *Pop ();
void Lock ();
void Unlock ();
// accessing the internal linked list directly requires manual Locking/Unlocking.
List *LinkedList ();
// copies the queue and empties the original
void MoveTo (Queue &queue);
};
// https://github.com/mono/moon/blob/master/src/list.cpp#L391
Queue::Queue ()
: lock (true)
{
list = new List ();
}
int
Queue::Length ()
{
int length;
Lock ();
length = list->Length ();
Unlock ();
return length;
}
void
Queue::MoveTo (Queue &queue)
{
List::Node *node;
while ((node = list->First ())) {
list->Unlink (node);
queue.Push (node);
}
}
Во имя луны!
+148
Милости прошу опробовать новую модификацию моего прокси-чекера:
http://rghost.ru/51449039
пароль на архив - ситэ; конкретно, то место, куда слетают все опубликованные пароли и учетки.
Выражаю огромную благодарность более опытным товарищам, которые охотно шли мне навстречу, делясь опытом и указывая правильный путь.
Я не могу не упомянуть имен этих замечательных людей:
Bormand
1024-
Kegdan
Anonimb
+27
int enumDevices(DevInfo* &lst) {
int count = 0;
DevInfo* tmp = NULL;
Device device;
for (int i = 0; i < MAXDEVICES; i++)
if (device = OpenDevice(i)) {
count++;
realloc(tmp, sizeof(DevInfo)*count);
ReadInfo(device, &tmp[count-1]
}
if (count == 0) return 0;
lst = new DevInfo[count];
for (int i = 0; i < count; i++)
lst[i] = tmp[i];
free(tmp);
return count;
}
//................
DevInfo* list;
int devcount = enumDevices(list);
/* работаем со списком */
delete[] list;
Самому стыдно.
+152
// Сначала было
$result['routes'][0]['legs'][0]['start_address'].split(',');
// Повтыкал с минуту, исправил на
$result['routes'][0]['legs'][0]['start_address'].explode(',');
NodeJS головного мозга...