- 1
- 2
- 3
- 4
- 5
if (IFabrica::First == NULL)
{
this->link = IFabrica::First;
IFabrica::First = this;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+27.2
if (IFabrica::First == NULL)
{
this->link = IFabrica::First;
IFabrica::First = this;
}
+27.1
function getalignurl(align)
{
var n=parseFloat(align);
return "http://не_палим_домен."+language+"/какой-то_файл.html";
}
может я чет не понимаю...
+27
Вскрытие покровов:
Я есмъ
LispGovno
HaskellGovno
laMer007
macGovno
LinuxGovno
C_Plus_Plus_Govno
CKrestKrestGovno
CPPGovno
AnimeGovno-_-
lucidfoxGovno
dosGovno
RS-232
IKing
и др.
Я регал несколько пользователей guest в том числе с юникодными e и аватарками гостя. Что-то из них удалили, что-то переименовали в fake_guest или даже просто сменили аватарку.
Не всё писал я, так как от каких-то из аккаунтов я выкладывал пароли,
какие-то из них взламывали и\или как-то выкладывали пароли на некий сайт bugmenot (до сих пор не знаю как они туда попадали).
У меня 320 номер юзера и я был здесь, когда зарегистрированных юзеров здесь еще не было.
Кто-то даже считает меня страйкером.
Я даже девственник.
Задавайте свои вопросы.
+27
@@ -50,9 +50,6 @@ void AreaTrigger::RemoveFromWorld()
///- Remove the AreaTrigger from the accessor and from all lists of objects in world
if (IsInWorld())
{
- if (!IsInWorld())
- return;
-
WorldObject::RemoveFromWorld();
sObjectAccessor->RemoveObject(this);
}
"Core/AreaTrigger: Remove useful check"
https://github.com/TrinityCore/TrinityCore/commit/d920463fe5fe6eee7c4a8e2d777720fcfbe6f08f
+27
#include <iostream>
#include <iterator>
#include <algorithm>
#include <vector>
#include <utility>
#include <sstream>
#include <assert.h>
using namespace std;
struct PeriodDescription{
size_t length, repeat_amount, last_items_amount;
/*friend ostream& operator<<(ostream& os, const PeriodDescription& s){
os<<" (PeriodDescription){"<<s.length<<", "<<s.repeat_amount<<", "<<s.last_items_amount<<"} ";
return os;
}*/
};
/*template<class C>
string co(C&& c){
ostringstream r;
r<<" (C) {";
copy(c.begin(), c.end(), ostream_iterator<typename C::value_type>(r, ", "));
r<<"}; ";
return move(r.str());
}*/
vector<PeriodDescription> find_repeat_sequences_since_begin(const string& sequence){
vector<PeriodDescription> result;
if(sequence.empty())
return result;
auto position_at_last_period=sequence.begin();
const char first_item = *position_at_last_period;
const auto after_last=sequence.end();
auto position_at_current_period = position_at_last_period;
while(true){
position_at_last_period=sequence.begin();
position_at_current_period = find(next(position_at_current_period), after_last, first_item);
PeriodDescription new_period {size_t(distance(position_at_last_period, position_at_current_period)), 1, 0};
while(position_at_current_period!=after_last && *position_at_last_period==*position_at_current_period){
++position_at_last_period; ++position_at_current_period;
if(++new_period.last_items_amount>=new_period.length){
new_period.last_items_amount = 0;
++new_period.repeat_amount;
}
}
if(new_period.repeat_amount==1 && new_period.last_items_amount==0)
return result;
result.push_back(new_period);
if(position_at_current_period==after_last)
return result;
}
}
vector<size_t> generate_FSM_failJumpIndices(const vector<PeriodDescription>& periodDescriptions, const size_t stringLength){
vector<size_t> r(stringLength+1);
for(const auto& pd : periodDescriptions){
for(size_t periodIndex=1; periodIndex<pd.repeat_amount; ++periodIndex)
for(size_t indexAtPeriod=0; indexAtPeriod<pd.length; ++indexAtPeriod)
r[(periodIndex*pd.length)+indexAtPeriod]=(periodIndex-1)*pd.length + indexAtPeriod;
for(size_t indexAtAfterPeriods=0; indexAtAfterPeriods<pd.last_items_amount; ++indexAtAfterPeriods)
r[pd.length*pd.repeat_amount+indexAtAfterPeriods]=pd.length*(pd.repeat_amount-1)+indexAtAfterPeriods;
}
return r;
}
vector<size_t> make_FSM_failJumpIndices(const string& sequence){
return generate_FSM_failJumpIndices(find_repeat_sequences_since_begin(sequence), sequence.size());
}
class FSM_for_find_equal_ranges{
size_t state;
vector<size_t> failJumpIndices;
string sequence;
string::const_iterator find_next(string::const_iterator checkPosition, const string::const_iterator last){
struct atReturn{
size_t& state;
~atReturn(){state = 0;}
}nullify{state};
if(checkPosition==last)
return last;
if(sequence.empty())
return next(checkPosition);
if(size_t(distance(checkPosition, last))<sequence.size())
return last;
while(true){
if(checkPosition==last)
return last;
if(*checkPosition==sequence[state])
++state;
else
state=failJumpIndices[state];
++checkPosition;
if(state>=sequence.size())
return prev(checkPosition, sequence.size());
}
}
public:
template<class T>
FSM_for_find_equal_ranges(T&& sequence):
Очередное собеседование. Пригласили на должность дельфина. Но оп отказался проходить собеседование на дельфи.
http://ideone.com/zp5CRb
+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;
Самому стыдно.
+27
function makehash($str,$salt='',$strength='08'){
if (!$salt):
$salt = "";
for ($i = 0; $i < 22; $i++) {
$salt .= substr("./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", mt_rand(0, 63), 1);
}
endif;
return crypt($str, "$2a$".$strength."$".$salt);
}
no comments
+27
//Определение рангов узлов
NL1=NL2=0; int msKl1,kl1I1;
M6: NL1=NL1+NL2; FormMS(NL1,MS); K9=NO-NL1; KSS=32767*32767*2;
for(J=2;J<=K9;J++)
{KS[J]=KU1[J]*(KU1[J]-1)/2;
if(KS[J] != 0)
{L6=KU2[J-1]+1; L8=KU2[J]; L7=L8-1;
for(I1=L6;I1<=L7;I1++)
{II2=I1+1; kl1I1=KL1[I1];
for(I2=II2;I2<=L8;I2++)
{msKl1=MS[KL1[I2]];
L61=KU2[msKl1-1]+1; L71=KU2[msKl1];
for(L=L61;L<=L71;L++)
{if(KL1[L] != kl1I1)goto M10;
else { KS[J]--; goto M9;}
M10:;}
M9:;}
}
}
if(KS[J] < KSS) KSS=KS[J];
}
//=================
куски кода какой-то очень древней расчетной программы. Радует форматирование
+27
inline double poly(double x, const double *c, int k) const {
double y = c[k];
switch (k) {
case 15: y = y * x + c[14];
case 14: y = y * x + c[13];
case 13: y = y * x + c[12];
case 12: y = y * x + c[11];
case 11: y = y * x + c[10];
case 10: y = y * x + c[ 9];
case 9: y = y * x + c[ 8];
case 8: y = y * x + c[ 7];
case 7: y = y * x + c[ 6];
case 6: y = y * x + c[ 5];
case 5: y = y * x + c[ 4];
case 4: y = y * x + c[ 3];
case 3: y = y * x + c[ 2];
case 2: y = y * x + c[ 1];
case 1: y = y * x + c[ 0];
case 0: break;
}
return y;
}
Схема Горнера для вычисления значения многочлена в точке
+27
cout<<!0&&0;
Что вернет?
1) 1||0&&0
2) !0&&0
3) Приоритет оператора "!" ?
http://ideone.com/hHdZ1
http://ideone.com/s8Cj0
Сории за толстейший троллинг.