public static class time
{
    public const int minutes_per_hour = 60;
    public const int seconds_per_minute = 60;
    public const int hours_per_day = 24;
    public const int minutes_per_day = minutes_per_hour * hours_per_day;
    public const int seconds_per_day = seconds_per_minute * minutes_per_day;
    public const int days_per_year = 365;
}
By Anonymous, 2018-10-15 17:15:52
/// <summary>
/// Returns true if any component of of Vector3 v is negative
/// </summary>
public static bool Ext_IsNegative(this Vector3 v)
{
    return v.x < 0f && v.y < 0f && v.z < 0f;
}

Either the description is wrong or the method in itself

By SwagridOfficial, 2017-12-13 13:00:34
// IsFooBar being a boolean, we check if it's different from true and from false
if (x.IsFooBar != true && x.IsFooBar != false)
{
    return "error";
}

x.IsFooBar is juste a regular bool

By A senior developer, 2018-05-14 14:46:14
namespace network
{
    class ip
    {
        uint _IP;
        public ushort this[int i]
        {
            get
            {
                switch(i)
                {
                    case 0:
                    case 1:
                    case 2:
                    case 3:
                        return (ushort)(_IP>>(i*8));
                    default:
                    throw new IndexOutOfRangeException();
                }
            }
            set
            {
                switch(i)
                {
                    case 0:
                    case 1:
                    case 2:
                    case 3:
                        _IP=(((uint)value)<<i*8);
                        break;
                    default:
                    throw new IndexOutOfRangeException();
                }
            }
        }
    }
}

I have no idea what this does

By Anonymous, 2022-04-26 16:20:05
private readonly FooType _foo = new FooType();

/// <summary>
/// Gets the controller of this component
/// </summary>
private FooType Foo
{
    get
    {
        return _foo;
    }
}
By Anonymous, 2018-07-25 13:55:26
 if (!String.IsNullOrEmpty(Client.CLADDR1))
            {
                if (Client.CLADDR1 == "NULL")
                {
By Anonymous, 2017-06-29 12:33:24
const int ONLY_ONE_ITEM = 1;

if (myList.Count > ONLY_ONE_ITEM)
{
    DoSomething();
}
else
{
    DoSomethingElse();
}
By Anonymous, 2018-05-15 17:04:22
string AllPDF = "";
int CountPDF = 0;
AllPDF = txtInput.Text;
string[] AllPDF2 = AllPDF.Split(';');
List<string> PDF = new List<string>();
PDF.AddRange(AllPDF2);
while (PDF.Count != CountPDF)
{
    File.Delete(AllPDF2[0 + CountPDF] + ".pdf");
	CountPDF++;
}

I believe, there are so many easier ways to do that

By Anonymous, 2018-03-27 12:15:10