Mistři v programování na #hovnokod


Anonymous,


Anonymous,

som zdedil kod

if (wft.currentState.name == "bla" && wft.currentState.name != "blabla")
     nieco
else
     nieco

Anonymous,

Moc mi to dnes nepálilo..

            for (int i = 0; i < BookmarkItems.Count; i++)
            {
                if (BookmarkItems[i].State != BookmarkState.New)
                {
                    BookmarkItems.RemoveAt(i);
                }
            }

Anonymous,

WebClient klyjent = new WebClient();
klyjent.Encoding = System.Text.Encoding.UTF8;
bool wrtd;
StreamWriter writer = File.AppendText(DateTime.Now.ToString("yyyyMMddHHmm") + ".txt");
for (;;)
{
    wrtd = false;
    try
    {
        hledany = klyjent.DownloadString("http://......php");
        ...
    }
    catch (System.Net.WebException)
    {
        Console.WriteLine("Network error");
        writer.WriteLine("Network error");
        wrtd = true;
    }
    catch (ArgumentOutOfRangeException)
    {
        Console.WriteLine("Vyjebaný O2 ADSL modem");
    }
    if (wrtd)
    {
        Console.WriteLine("at " + DateTime.Now + Environment.NewLine);
        writer.WriteLine("at " + DateTime.Now + Environment.NewLine);
        writer.Flush();
    }
    System.Threading.Thread.Sleep(10000);
}

Anonymous,