I've seen a lot of people using the Deleted Items folder as their own personal archive. And the ones that do always seem to expect that the e-mails will never disappear.
What can we do about it, people are idiots
I've seen a lot of people using the Deleted Items folder as their own personal archive. And the ones that do always seem to expect that the e-mails will never disappear.
What can we do about it, people are idiots
Sleep is part of kernel32.dll under Windows Vista, Windows XP, or Windows 2000 Professional. The Platform SDK is needed to get the function prototype, you could declare it yourself too without the SDK.
There are a million reasons why Sleep is bad. Most people use it to 'estimate' when some action or operation will be done and continue the rest of their script.
Since I've hit the motherload recently, i might as well share it.
bool PaulaClass::DeleteIgnoredABC(const string& a, const string& b, const string& c)
{
bool retw = false;
string *valueStr = 0;try
{
valueStr = new string(a+b+c);if(iDeleteIgnoredABC.contains(valueStr))
retw = true;
else
retw = false;
}
catch(...)
{
delete valueStr;
valueStr = 0;
}delete valueStr;
valueStr = 0;return retw;
}
Can in fact be written as (why noone has noticed this yet? i don't know):
bool PaulaClass::DeleteIgnoredABC(const string& a, const string& b, const string& c)
{
return iDeleteIgnoredABC.contains(a+b+c); // why even use a function?
}
This is some obfuscated code (to protect the innocent) demonstrating the use of memory allocation combined with exception handling.
{
VarType *var = 0;try
{
while(itr())
{
try
{
delete var;
var = new VarType();if (!someCondition)
{
delete var;
var = new VarType();
}delete var;
var = 0;
}
catch(...)
{
}delete var;
var = 0;
}
delete var;
var = 0;
}
catch(...)
{
}delete var;
var = 0;
return ok;
}
It's part of 40.000 lines of spaghetticode. This snippet starts at around line 12.000.
I won't be staying around for long
The constructor doesn't have any side-effects and they catch XString because they throw XString. Ugh, my eyes.
@snip said:
catch(...)
{
XString er = "fout";
throw er; // throw!
}
}
catch(XString)
{
code = codeStr(0); // yay! catch
}
On a sidenote: this snippet is part of 40722 lines of code (yes, one very big cpp file).
What this code does is determine which bits in a byte are set, but it does so in an amazingly ... peculiar way.
XString codeStr = roster->GetCode();
int codeInt = 0;
char code;try
{
try
{
codeInt = atoi(codeStr.data());
code = (char) codeInt;
}
catch(...)
{
XString er = "fout";
throw er;
}
}
catch(XString)
{
code = codeStr(0);
}
catch(...)
{
code = (char) 0;
}char flag1, flag2, flag3, flag4,
flag5, flag6, flag7, flag8;bool * codeBit = new bool[8];
for(int b = 0; b < 8; b++)
{
int v = 1;
for(int m = 0; m < b; m++)
{
v = v * 2;
}
char mask = (char) v;
char maskbit = (char) (code & mask);
if(maskbit != 0)
codeBit[b] = true;
else
codeBit[b] = false;
}if(someCondition)
{
if(codeBit[1])
flag1 = '1';
else
flag1 = '0';
//... snip}
else
{
if(codeBit[1])
flag1 = '1';
else
flag1 = '0';
if(codeBit[0])
flag2 = '1';
else
flag2 = '0';
if(codeBit[2])
flag3 = '1';
else
flag3 = '0';
if(codeBit[5])
flag4 = '1';
else
flag4 = '0';
if(codeBit[6])
flag7 = '1';
else
flag7 = '0';
if(codeBit[7])
flag8 = '1';
else
flag8 = '0';
flag5 = '0';
flag6 = '0';
}roster->Setflag1(flag1);
roster->Setflag2(flag2);
roster->Setflag3(flag3);
roster->Setflag4(flag4);
roster->Setflag5(flag5);
roster->Setflag6(flag6);
roster->Setflag7(flag7);
roster->Setflag8(flag8);