-
+162
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
vector<int> vi;
vector<bool> vi_index;
const unsigned unicode_size=0x10FFF;
vi.resize (unicode_size+1);
vi_index.resize (unicode_size+1);
for (int fa=0;fa<vi.size();fa++)
vi[fa]=0;
for (int fa=0;fa<vi.size();fa++)
vi_index[fa]=false;
Человек не умеет инициализировать вектор. Ну, и пр.
panter_dsd,
03 Февраля 2011
-
+156
- 1
- 2
- 3
- 4
$q = "SELECT tax_rate FROM #__{vm}_tax_rate WHERE tax_country='$country'\n";
if( !empty($state)) {
$q .= "AND (tax_state='$state' OR tax_state=' $state ' OR tax_state='-')";
}
Странное формирование запроса при загрузке налога по стране и конкретному региону...
kolibri,
03 Февраля 2011
-
+163
- 1
- 2
- 3
- 4
- 5
if (!isset($caseMenu['child'])) {
$catsArr['list'][$caseMenu['parent']]['status'] = "active";
}else{
$catsArr['list'][$caseMenu['parent']]['children']['list'][0]['status'] = "active";
}
помоему это охуенно
warider,
03 Февраля 2011
-
+146
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
static void WriteToFile()
{
StreamWriter SW;
SW=File.CreateText("c:\\MyTextFile.txt");
SW.WriteLine("God is greatest of them all");
SW.WriteLine("This is second line");
SW.Close();
Console.WriteLine("File Created SucacessFully");
}
SucacessFully, что здесь непонятного!)
А строки 3 и 4 стоило написать в одну строчку сразу.
Источник: http://www.csharphelp.com/2005/12/simple-text-file-operations-in-c/
RaZeR,
03 Февраля 2011
-
+160
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
if($('#month1').attr('value') == 2 ||
$('#month2').attr('value') == 2){
if($('#day1').attr('value') > 29 ||
$('#day2').attr('value') > 29){
alert('Неправильная дата');
return 0;
}
}
Проверка двух дат на 30 февраля.
regex,
03 Февраля 2011
-
+131
- 1
DateTime dt = DateTime.Parse(DateTime.Now.ToString("dd.MM.yyyy"));
Вот такие гении встречаются в нашей местности....
Buzurud,
03 Февраля 2011
-
+165
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
static string GetRequestParam(string request)
{
string result="";
int i = 4;
for(char c=request[i];c!=' ';c=request[++i])
result+=c;
return result;
}
Говногость,
03 Февраля 2011
-
+161
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
String^ TDebug::GetCurrentThreadFunctionName(int CallFunctionIndex)
{
return (gcnew StackTrace(true))->GetFrame(CallFunctionIndex)->GetMethod()->ToString();
};
void TDebug::ShowCurrentFunctionName(void)
{
Windows::Forms::MessageBox::Show(GetCurrentThreadFunctionName(2));
};
Помоему, в Microsoft Visual Studio 2010 отладчик для С++\CLI давно есть. :)
Говногость,
03 Февраля 2011
-
+116
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
namespace Containers
{
public class TBinaryWaitingQueue<TItem> where TItem : struct
{
private readonly TBinaryQueue<TItem> _queue;
TBinaryWaitingQueue(int amountOfitem)
{
_queue = new TBinaryQueue<TItem>(amountOfitem);
}
public void Enqueue(TItem[] items)
{
throw new NotImplementedException();
}
public void Enqueue(TItem[] items, int beginItem, int amountOfItem)
{
throw new NotImplementedException();
}
public void Dequeue(TItem[] items, int beginItem, int amountOfItem)
{
throw new NotImplementedException();
}
public TItem[] Dequeue(int amountOfItem)
{
throw new NotImplementedException();
}
}
}
Досталось в наследство от предков. Этому коду уже года 4.
Говногость,
03 Февраля 2011
-
+118
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
public class TWriteableForEach
{
public delegate void TForEachDelegate<TItem>(TItem item);
public static void Exec<TItem>(IList<TItem> itemsCollection, TForEachDelegate<TItem> forEachDelegate)
{
for (int i = 0; i < itemsCollection.Count(); ++i)
forEachDelegate(itemsCollection[i]);
}
} ;
Велосипед с квадратными колёсами?
Говногость,
03 Февраля 2011