- 1
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e3-1200v3-spec-update.pdf
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+175
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e3-1200v3-spec-update.pdf
http://www.anandtech.com/show/8376/intel-disables-tsx-instructions-erratum-found-in-haswell-haswelleep-broadwelly
На этот раз мне зогплатила амд, и принёс вам почитать.
+158
$rand = rand(1,100);
if (($rand => 1) && ($rand <= 50)) {
include 'код баннера 1';
}
elseif (($rand => 51) && ($rand <= 80)) {
include 'код баннера 2';
}
else {
include 'код баннера 3';
}
50% - баннер 1, 30% - баннер 2, остальное (20%) - баннер 3.
Хотели сделать "ротацию с весом" для X баннеров :)
+82
Boolean hasRefId = !node.getAttributes().getNamedItem("refid").equals(null);
equals(null)
−119
import sys;
class Cout(object):
def __lshift__(self, anything):
sys.stdout.write(str(anything));
return self;
cout = Cout();
endl = '\n';
cout << 'Hello, World!' << endl;
http://lurkmore.to/Обсуждение:Python#.D0.92_.D1.81.D1.82.D0 .B8.D0.BB.D0.B5_.D0.BF.D0.BB.D1.8E.D1.81 .D0.BE.D0.B2
+154
foreach ($params as $param) {
$param_type = (isset($param['type']) ? $param['type'] : 's');
$param_value = (isset($param['value']) ? $param['value'] : $param);
// <...>
}
Угадайте, что произошло, когда значение параметра оказалось равным 'type'?
+134
for (var i = 0; i < numberPhone.Length; i++)
{
if (numberPhone[i] == ',')
return resultPhone;
if (Char.IsNumber(numberPhone[i]))
{
resultPhone += numberPhone[i];
}
}
return resultPhone;
+122
protected SimulationElement getThis(){
return this;
}
+157
$PriceProduct = $Price;
$Skidka = $Skidka;
$PriceSkidka = $PriceSkidka;
$Price = $PriceItog;
Самописная CRM. Коллега метко назвал этот кусок кода считалочкой. Для полноты картины осталось заменить последнюю строку на $Price = $PriceProduct;
+123
//---------------------------------------------------------------------------
#include <vcl.h>
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 test;
int a;
int b;
int i;
int t;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button11Click(TObject Sender)
{
Edit1->Text='0';
/*glob_check:=True;//Для поля
t:=0;
for i:=1 to 1000 do // Очищает массив
begin
a[i]:='|';
b[i]:='0'; */
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button14Click(TObject Sender)
{
/*var z,n: integer;
begin*/
if (Sk=0) then begin
if (glob_check=true) then t:=t-1;
t:=t+1;
a[t]:=edit1.Text; //Присваевает значение массиву элементу
if (glob_check=true) then t:=t-1; // храняшему в поле мемо
edit1.text:=rezul(t);
glob_check:=true;
end
else MessageBeep(0);
end;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button12Click(TObject Sender)
{
var n,d,z:integer;
begin
if (glob_check=true) then t:=t-1;
t:=t+1;
a[t]:=edit1.Text;
b[t]:='+';
glob_check:=true;
if ((b[2]<>'0') and (skob=false)) then
edit1.Text:=rezul(t-1);
end;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button15Click(TObject Sender)
{
if (glob_check=true) then t:=t-1;
t:=t+1;
a[t]:=edit1.Text;
b[t]:='*';
if (((b[2]<>'0') and ((b[1]<>'+') and (b[1]<>'-'))) and (skob=false)) then
edit1.Text:=rezul(t-1);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button16Click(TObject Sender)
{
if (glob_check=true) then t:=t-1;
t:=t+1;
a[t]:=edit1.Text;
b[t]:='/';
Когда-то, когда я абсолютно не шарил в плюсах, но хотел изучить их, я откопал среду Borland Turbo C++ и проверки ради её работоспособности попросил одного чувака ( который хвастался, что изучает С++ ) прислать мне калькулятор. Ну, он прислал. В среде мне выдало хренову тучу ошибок. Я думал уже с ней что-то не так, а другой не имел. Так и отложил плюсы до поры. А сегодня откопал тот самый код калькулятора и охренел от увиденного. Это просто капец. Смесь плюсов и дельфи какая-то. И ясен пень, что оно не запашет, как не старайся заставить. Тут ещё не влезло в поле для кода... Перед кодом калькулятора были прописаны каждый с новой строки числа от 1 по 172.
+155
Object.prototype.toString.call(o).match(/\[object (\w+)\]/)[1];
Реализация typeof