What's the difference between struct and class in .NET?

Question: What's the difference between struct and class in .NET?
Answer: In .NET, there are two categories of types, reference types and value types.
Structs are value types and classes are reference types.
The general difference is that a reference type lives on the heap, and a value type lives inline, that is, wherever it is your variable or field is defined.
A variable containing a value type contains the entire value type value. For a struct, that means that the variable contains the entire struct, with all its fields.
A variable containing a reference type contains a pointer, or a reference to somewhere else in memory where the actual value resides.
This has one benefit, to begin with:

value types always contains a value
reference types can contain a null-reference, meaning that they don't refer to anything at all at the moment

Internally, reference types are implemented as pointers, and knowing that, and knowing how variable assignment works, there are other behavioral patterns:

copying the contents of a value type variable into another variable, copies the entire contents into the new variable, making the two distinct. In other words, after the copy, changes to one won't affect the other
copying the contents of a reference type variable into another variable, copies the reference, which means you now have two references to the same somewhere else storage of the actual data. In other words, after the copy, changing the data in one reference will appear to affect the other as well, but only because you're really just looking at the same data both places

When you declare variables or fields, here's how the two types differ:

variable: value type lives on the stack, reference type lives on the stack as a pointer to somewhere in heap memory where the actual memory lives (though note Eric Lipperts article series: The Stack Is An Implementation Detail.)
class/struct-field: value type lives completely inside the type, reference type lives inside the type as a pointer to somewhere in heap memory where the actual memory lives.
Comment: In the interest of full completeness, I should mention that Eric Lippert has said that [the stack is an implementation detail](http://blogs.msdn.com/b/ericlippert/archive/2009/04/27/the-stack-is-an-implementation-detail.aspx), whenever I mention stack above, have Eric's post(s) in mind.
Comment: @KorayTugay in C++ struct and class are absolutely equivalent except for the one thing - default access restriction (class has private by default, struct has public)
Comment: another crucial difference is usage. From MSDN: "structs are typically used to encapsulate small group of related variables, such as coordinates of rectangle. Structs can also contain constructors, constants, fields, methods, properties, indexers, operators, events, and nested types, although if several such members are required, you should consider making your type a class instead."
Comment: Is this all valid for C++ as well?
Comment: @KorayTugay In terms of "value types vs. reference types", no, C++ is not equivalent to C# in this regard. In C++ you can create an _instance_ of a class on the stack (vs. a reference to an instance allocated on the heap). As berkus said, in C++, classes and structs are equivalent, except for default access. Both can act as value types, or can be referenced by pointer or reference.
Comment: Here is a code sample that illustrates the fact that class instances are assigned by reference and struct instances are assigned by value: http://ideone.com/5yqg2u
Comment: @LasseV.Karlsen The link to Eric Lippert's article seems to be broken. Is this the article you were refering to?
https://ericlippert.com/2009/04/27/the-stack-is-an-implementation-detail-part-one/
https://ericlippert.com/2009/05/04/the-stack-is-an-implementation-detail-part-two/
Comment: I enjoyed this read @LasseV.Karlsen. Thank you for your succinct explanation.
Comment: In C# you can allocates a block of memory on the stack with [stackalloc](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/stackalloc).
Comment: Great explanation. Could you please share the use cases of struct?
Answer: A short summary of each:
Classes Only:

Can support inheritance
Are reference (pointer) types
The reference can be null
Have memory overhead per new instance

Structs Only:

Cannot support inheritance
Are value types
Are passed by value (like integers)
Cannot have a null reference (unless Nullable is used)
Do not have a memory overhead per new instance - unless 'boxed'

Both Classes and Structs:

Are compound data types typically used to contain a few variables that have some logical relationship
Can contain methods and events
Can support interfaces
Comment: There are some parts of this answer that are not quite right. Classes do not always go on the heap, and structs do not always go on the stack. Current exceptions include struct fields on a class, captured variables in anonymous methods and lambda expressions, iterator blocks, and the already mentioned boxed values. But stack vs heap allocation is a implementation detail and may be subject to change. [Eric lippart discusses this here](http://blogs.msdn.com/b/ericlippert/archive/2009/04/27/the-stack-is-an-implementation-detail.aspx). I've downvoted, but will happily remove it if you update.
Comment: @MarkAmery I had the same initial reaction as you id to the expression "no memory overhead", but I think that the OP is referring to the fact that instances of `class` are managed memory (handled by the garbage collector), whereas instances of `struct` are not.
Comment: struct do not support inheritance from other stucts/classes, but you CAN implement an interface on a struct.
Comment: You might want to clarify what you mean when you claim that structs *"Do not have a memory overhead per new instance"*. My first interpretation was that you were claiming - obviously absurdly - that structs use zero memory. Then I thought that maybe you're trying to say that a struct, unlike a class, requires exactly as much memory as the sum of its member fields, and no more. But then I Googled for `c# struct memory overhead` and found [this answer](http://stackoverflow.com/a/33672124/1709587) by Hans Passant that says that no, that's not the case either. So what *do* you mean?
Comment: "Struct Are passed by value (like integers)" is false: all variable are passed by value, also the reference type. If you want to pass a variable by reference you have to use the "ref" keyword. http://jonskeet.uk/csharp/parameters.html#ref
Comment: @MarcoStaffoli "copy by value" is a term that [Eric Lippert uses to describe value type semantics](https://blogs.msdn.microsoft.com/ericlippert/2009/04/27/the-stack-is-an-implementation-detail-part-one/), so I think that Thomas's use of the term "pass by value" here is defensible. The flipside is that the current docs [support your understanding of the term](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/passing-reference-type-parameters). Our failure as a profession to come up with good terminology for the way that reference types are passed is a pity.
Comment: I read his blog post recently - but forgotten I'd written this answer the way I did.  I'll update - let me know if there's anything else wrong :)
Comment: Is a class a reference type or is an instance of a class a reference type? (asking as a non .NET pgmr)
Comment: When you create a class it has a type. The type is a reference type as it is always referenced through a pointer.  An instance of a class is an instance of a reference type.
Comment: @SimonPStevens I don't know if it is me only, however, Eric link is not telling the reason or any explanation about if classes gets posted to stack or heap. All it is talking about the complain that he could not find much details. Please tell me how it makes a difference for app programmers when system programmers makes those decision and we decided to use their compilers. Even all docos are referring that value types goes to stack; but definitely everything is subject to change (so called sysm programmers?)
Answer: Difference between Structs and Classes:

Struct are value types whereas Classes are reference types.
Structs are stored on the stack whereas Classes are stored on the
heap.
Value types hold their value in memory where they are declared, but a
reference type holds a reference to an object in memory.
Value types are destroyed immediately after the scope is lost whereas
reference type only destroys the variable after the scope is lost. The object is later destroyed by the garbage collector.
When you copy a struct into another struct, a new copy of that struct
gets created. The modified struct won't affect the value of the
other struct.
When you copy a class into another class, it only copies the
reference variable.
Both reference variables point to the same object on the heap.
Changes done to one variable will affect the other reference variable.
Structs can not have destructors, but classes can have destructors.
Structs can not have explicit parameter-less constructors whereas classes can. Structs don't support inheritance, but classes do. Both
support inheritance from an interface.
Structs are sealed type.
Comment: It's not necessarily true that "structs are stored on the stack whereas classes are stored on the heap." See https://stackoverflow.com/questions/3542083/reference-types-live-on-the-heap-value-types-live-on-the-stack
Comment: I find this an exhaustive and concise answer. Want to know more about each bullet? Go learn.
Answer: In .NET the struct and class declarations differentiate between reference types and value types.
When you pass round a reference type there is only one actually stored.  All the code that accesses the instance is accessing the same one.
When you pass round a value type each one is a copy. All the code is working on its own copy.
This can be shown with an example:
struct MyStruct
{
    string MyProperty { get; set; }
}

void ChangeMyStruct(MyStruct input)
{
   input.MyProperty = "new value";
}

...

// Create value type
MyStruct testStruct = new MyStruct { MyProperty = "initial value" };

ChangeMyStruct(testStruct);

// Value of testStruct.MyProperty is still "initial value"
// - the method changed a new copy of the structure.

For a class this would be different
class MyClass
{
    string MyProperty { get; set; }
}

void ChangeMyClass(MyClass input)
{
   input.MyProperty = "new value";
}

...

// Create reference type
MyClass testClass = new MyClass { MyProperty = "initial value" };

ChangeMyClass(testClass);

// Value of testClass.MyProperty is now "new value"
// - the method changed the instance passed.

Classes can be nothing - the reference can point to a null.
Structs are the actual value - they can be empty but never null. For this reason structs always have a default constructor with no parameters - they need a 'starting value'.
Comment: I don't know if you correctly understood me, I really upvoted/accepted your answer (as opposed to above answers), because your's had good examples (not only theorical explanation, as opposed to above answer, which had only theoretical explanations without examples).
Comment: @T.Todua yeah, there are better answers above, that I voted up and picked as the answer after providing this one - this is from the early beta of SO when we were still figuring out the rules.
Answer: From Microsoft's Choosing Between Class and Struct ...

As a rule of thumb, the majority of types in a framework should be
  classes. There are, however, some situations in which the
  characteristics of a value type make it more appropriate to use
  structs.
✓ CONSIDER a struct instead of a class:

If instances of the type are small and commonly short-lived or are commonly embedded in other objects.

X AVOID a struct unless the type has all of the following
  characteristics:

It logically represents a single value, similar to primitive types    (int, double, etc.).
It has an instance size under 16 bytes.
It is immutable. (cannot be changed)
It will not have to be boxed frequently.
Comment: This should be the concise answer.
Answer: I ♥ visualizations, and here I've created a one to show the basic differences between structs and classes.

And the textual representation just in case ;)
+--------------------------------------------------+------+----------------------------------------------+
|                      Struct                      |      |                      Class                    |
+--------------------------------------------------+------+----------------------------------------------+
| - 1 per Thread.                                  |      | - 1 per application.                         |
|                                                  |      |                                              |
| - Holds value types.                             |      | - Holds reference types.                     |
|                                                  |      |                                              |
| - Types in the stack are positioned              |      | - No type ordering (data is fragmented).     |
|   using the LIFO principle.                      |      |                                              |
|                                                  |      |                                              |
| - Can't have a default constructor and/or        |      | - Can have a default constructor             |
|   finalizer(destructor).                         |      |   and/or finalizer.                          |
|                                                  |      |                                              |
| - Can be created with or without a new operator. |      | - Can be created only with a new operator.   |
|                                                  |      |                                              |
| - Can't derive from the class or struct          |  VS  | - Can have only one base class and/or        |
|   but can derive from the multiple interfaces.   |      |   derive from multiple interfaces.           |
|                                                  |      |                                              |
| - The data members can't be protected.           |      | - Data members can be protected.             |
|                                                  |      |                                              |
| - Function members can't be                      |      | - Function members can be                    |
|   virtual or abstract.                           |      |   virtual or abstract.                       |
|                                                  |      |                                              |
| - Can't have a null value.                       |      | - Can have a null value.                     |
|                                                  |      |                                              |
| - During an assignment, the contents are         |      | - Assignment is happening                    |
|   copied from one variable to another.           |      |   by reference.                              |
+--------------------------------------------------+------+----------------------------------------------+

For more information look below:

Classes and structs (official documentation).
Choosing Between Class and Struct (official documentation).
Answer:

Struct
Class

Type
Value-type
Reference-type

Where
On stack / Inline in containing type
On Heap

Deallocation
Stack unwinds / containing type gets deallocated
Garbage Collected

Arrays
Inline, elements are the actual instances of the value type
Out of line, elements are just references to instances of the reference type residing on the heap

Al-Del Cost
Cheap allocation-deallocation
Expensive allocation-deallocation

Memory usage
Boxed when cast to a reference type or one of the interfaces they implement,  Unboxed when cast back to value type  (Negative impact because boxes are objects that are allocated on the heap and are garbage-collected)
No boxing-unboxing

Assignments
Copy entire data
Copy the reference

Change to an instance
Does not affect any of its copies
Affect all references pointing to the instance

Mutability
Should be immutable
Mutable

Population
In some situations
Majority of types in a framework should be classes

Lifetime
Short-lived
Long-lived

Destructor
Cannot have
Can have

Inheritance
Only from an interface
Full support

Polymorphism
No
Yes

Sealed
Yes
When have sealed keyword (C#), or Sealed attribute (F#)

Constructor
Can not have explicit parameterless constructors
Any constructor

Null-assignments
When marked with nullable question mark
Yes (When marked with nullable question mark in C# 8+ and F# 5+ 1)

Abstract
No
When have abstract keyword (C#), or AbstractClass attribute (F#)

Member Access Modifiers
public, private, internal
public, protected, internal, protected internal, private protected

1 Using null is not encouraged in F#, use Option type instead.
Comment: This is actually quite splendid: summarised and informative. Please only remember to proof-read your answer at least once - you swapped struct and class explanations in some rows, also there are some typos.
Comment: @ensisNoctis Sorry for those mistakes and thanks for the edit. I should re-read my answers
Answer: In addition to all differences described in the other answers:

Structs cannot have an explicit parameterless constructor whereas a class can
Structs cannot have destructors, whereas a class can
Structs can't inherit from another struct or class whereas a class can inherit from another class. (Both structs and classes can implement from an interface.)

If you are after a video explaining all the differences, you can check out Part 29 - C# Tutorial - Difference between classes and structs in C#.
Comment: Much more significant than the fact that .net languages will generally not allow a struct to define a parameterless constructor (the decision of whether or not to allow it is made by the language compiler) is the fact that structures can come into existence and be exposed to the outside world without any sort of constructor having been run (even when a parameterless constructor is defined).  The reason .net languages generally forbid parameterless constructors for structs is to avoid the confusion that would result from having such constructors be sometimes run and sometimes not.
Answer: Instances of classes are stored on the managed heap. All variables 'containing' an instance are simply a reference to the instance on the heap. Passing an object to a method results in a copy of the reference being passed, not the object itself.
Structures (technically, value types) are stored wherever they are used, much like a primitive type. The contents may be copied by the runtime at any time and without invoking a customised copy-constructor. Passing a value type to a method involves copying the entire value, again without invoking any customisable code.
The distinction is made better by the C++/CLI names: "ref class" is a class as described first, "value class" is a class as described second. The keywords "class" and "struct" as used by C# are simply something that must be learned.
Answer: Structure vs Class
A structure is a value type so it is stored on the stack, but a class is a reference type and is stored on the heap.
A structure doesn't support inheritance, and polymorphism, but a class supports both.
By default, all the struct members are public but class members are by default private in nature.
As a structure is a value type, we can't assign null to a struct object, but it is not the case for a class.
Comment: Regarding "all the struct members are public": If I'm not mistaken, that is incorrect. "The access level for class members and struct members, including nested classes and structs, is private by default." https://msdn.microsoft.com/en-us/library/ms173121.aspx
Comment: " we can't assign null to a struct object" is not true as you can use the Nullable type with structs.
Answer: To add to the other answers, there is one fundamental difference that is worth noting, and that is how the data is stored within arrays as this can have a major effect on performance.

With a struct, the array contains the instance of the struct
With a class, the array contains a pointer to an instance of the class elsewhere in memory

So an array of structs looks like this in memory
[struct][struct][struct][struct][struct][struct][struct][struct]
Whereas an array of classes looks like this
[pointer][pointer][pointer][pointer][pointer][pointer][pointer][pointer]
With an array of classes, the values you're interested in are not stored within the array, but elsewhere in memory.
For a vast majority of applications this difference doesn't really matter, however, in high performance code this will affect locality of data within memory and have a large impact on the performance of the CPU cache. Using classes when you could/should have used structs will massively increase the number of cache misses on the CPU.
The slowest thing a modern CPU does is not crunching numbers, it's fetching data from memory, and an L1 cache hit is many times faster than reading data from RAM.
Here's some code you can test. On my machine, iterating through the class array takes ~3x longer than the struct array.
    private struct PerformanceStruct
    {
        public int i1;
        public int i2;
    }

    private class PerformanceClass
    {
        public int i1;
        public int i2;
    }

    private static void DoTest()
    {
        var structArray = new PerformanceStruct[100000000];
        var classArray = new PerformanceClass[structArray.Length];

        for (var i = 0; i < structArray.Length; i++)
        {
            structArray[i] = new PerformanceStruct();
            classArray[i] = new PerformanceClass();
        }

        long total = 0;
        var sw = new Stopwatch();
        sw.Start();
        for (var loops = 0; loops < 100; loops++)
        for (var i = 0; i < structArray.Length; i++)
        {
            total += structArray[i].i1 + structArray[i].i2;
        }

        sw.Stop();
        Console.WriteLine($"Struct Time: {sw.ElapsedMilliseconds}");
        sw = new Stopwatch();
        sw.Start();
        for (var loops = 0; loops < 100; loops++)
        for (var i = 0; i < classArray.Length; i++)
        {
            total += classArray[i].i1 + classArray[i].i2;
        }

        Console.WriteLine($"Class Time: {sw.ElapsedMilliseconds}");
    }

Comment: -1; *"Structs are value types, so they store a value, classes are reference types, so they reference a class."* is unclear and unlikely to make sense to anybody who hasn't already understood it from the other answers here, and *"With a class the containing class will just contain a pointer to the new class in a different area of memory."* confuses classes with class instances.
Comment: @MarkAmery I've tried to clarify slightly. The point I was really trying to make was the difference in the ways that arrays work with value and reference types and the effect this has on performance. I wasn't trying to re-explain what value and reference types are as this is done in plenty of other answers.
Answer: Well, for starters, a struct is passed by value rather than by reference.  Structs are good for relatively simple data structures, while classes have a lot more flexibility from an architectural point of view via polymorphism and inheritance.
Others can probably give you more detail than I, but I use structs when the structure that I am going for is simple.
Comment: Class objects are also passed by value by default
Comment: @Imad: value of the reference, yes
Answer: Just to make it complete, there is another difference when using the Equals method, which is inherited by all classes and structures.
Lets's say we have a class and a structure:
class A{
  public int a, b;
}
struct B{
  public int a, b;
}

and in the Main method, we have 4 objects.
static void Main{
  A c1 = new A(), c2 = new A();
  c1.a = c1.b = c2.a = c2.b = 1;
  B s1 = new B(), s2 = new B();
  s1.a = s1.b = s2.a = s2.b = 1;
}

Then:
s1.Equals(s2) // true
s1.Equals(c1) // false
c1.Equals(c2) // false
c1 == c2 // false

So, structures are suited for numeric-like objects, like points (save x and y coordinates). And classes are suited for others. Even if 2 people have same name, height, weight..., they are still 2 people.
Answer: As previously mentioned: Classes are reference type while Structs are value types with all the consequences.
As a thumb of rule Framework Design Guidelines recommends using Structs instead of classes if:

It has an instance size under 16 bytes
It logically represents a single value, similar to primitive types (int, double, etc.)
It is immutable
It will not have to be boxed frequently
Answer:
Events declared in a class have their += and -= access automatically locked via a lock(this) to make them thread safe (static events are locked on the typeof the class). Events declared in a struct do not have their += and -= access automatically locked. A lock(this) for a struct would not work since you can only lock on a reference type expression.
Creating a struct instance cannot cause a garbage collection (unless the constructor directly or indirectly creates a reference type instance) whereas creating a reference type instance can cause garbage collection.
A struct always has a built-in public default constructor.
class DefaultConstructor
{
    static void Eg()
    {
        Direct     yes = new   Direct(); // Always compiles OK
        InDirect maybe = new InDirect(); // Compiles if constructor exists and is accessible
        //...
    }
}

This means that a struct is always instantiable whereas a class might not be since all its constructors could be private.
class NonInstantiable
{
    private NonInstantiable() // OK
    {
    }
}

struct Direct
{
    private Direct() // Compile-time error
    {
    }
}

A struct cannot have a destructor. A destructor is just an override of object.Finalize in disguise, and structs, being value types, are not subject to garbage collection.
struct Direct
{
    ~Direct() {} // Compile-time error
}
class InDirect
{
    ~InDirect() {} // Compiles OK
}

And the CIL for ~Indirect() looks like this:

.method family hidebysig virtual instance void
        Finalize() cil managed
{
  // ...
} // end of method Indirect::Finalize

A struct is implicitly sealed, a class isn't.
A struct can't be abstract, a class can.
A struct can't call : base() in its constructor whereas a class with no explicit base class can.
A struct can't extend another class, a class can.
A struct can't declare protected members (for example, fields, nested types) a class can.
A struct can't declare abstract function members, an abstract class can.
A struct can't declare virtual function members, a class can.
A struct can't declare sealed function members, a class can.
A struct can't declare override function members, a class can.
The one exception to this rule is that a struct can override the virtual methods of System.Object, viz, Equals(), and GetHashCode(), and ToString().
Comment: @JeppeStigNielsen: Structs outperform classes in many proxy usage scenarios; the biggest problem with using structs is that in cases where boxing ends up being necessary, it often ends up getting deferred to an inner loop.  If there were a way to avoid having structures get boxed *repeatedly*, they would be better than classes in many more usage scenarios.
Comment: In what circumstances would one use an event with a struct?  I can imagine that a very carefully-written program could use events with a struct in a way that would work, but only if the struct was never copied or passed by value, in which case it might as well be a class.
Comment: @supercat Yeah, a non-static event in a struct would be very strange, and it will be useful only for mutable structs, and the event itself (if it is a "field-like" event) turns the struct into the "mutable" category and also introduces a field of reference type in the struct. Non-static events in structs must be evil.
Comment: @JeppeStigNielsen: The only pattern I could see where it would make sense for a struct to have an event would be if the purpose of the struct was to hold an immutable reference to a class object for which it behaved as a proxy.  Auto-events would be totally useless in such a scenario, though; instead, subscribe and unsubscribe events would have to be relayed to the class behind the structure.  I wish .NET had (or would make it possible to define) a 'cache-box" structure type with an initially-null hidden field of type `Object`, which would hold a reference to a boxed copy of the struct.
Answer: Besides the basic difference of access specifier, and few mentioned above I would like to add some of the major differences including few of the mentioned above with a code sample with output, which will give a more clear idea of the reference and value
Structs:

Are value types and do not require heap allocation.
Memory allocation is different and is stored in stack
Useful for small data structures
Affect performance, when we pass value to method, we pass the entire data structure and all is passed to the stack.
Constructor simply returns the struct value itself (typically in a temporary location on the stack), and this value is then copied as necessary
The variables each have their own copy of the data, and it is not possible for operations on one to affect the other.
Do not support user-specified inheritance, and they implicitly inherit from type object

Class:

Reference Type value
Stored in Heap
Store a reference to a dynamically allocated object
Constructors are invoked with the new operator, but that does not allocate memory on the heap
Multiple variables may have a reference to the same object
It is possible for operations on one variable to affect the object referenced by the other variable

Code Sample
    static void Main(string[] args)
    {
        //Struct
        myStruct objStruct = new myStruct();
        objStruct.x = 10;
        Console.WriteLine("Initial value of Struct Object is: " + objStruct.x);
        Console.WriteLine();
        methodStruct(objStruct);
        Console.WriteLine();
        Console.WriteLine("After Method call value of Struct Object is: " + objStruct.x);
        Console.WriteLine();

        //Class
        myClass objClass = new myClass(10);
        Console.WriteLine("Initial value of Class Object is: " + objClass.x);
        Console.WriteLine();
        methodClass(objClass);
        Console.WriteLine();
        Console.WriteLine("After Method call value of Class Object is: " + objClass.x);
        Console.Read();
    }
    static void methodStruct(myStruct newStruct)
    {
        newStruct.x = 20;
        Console.WriteLine("Inside Struct Method");
        Console.WriteLine("Inside Method value of Struct Object is: " + newStruct.x);
    }
    static void methodClass(myClass newClass)
    {
        newClass.x = 20;
        Console.WriteLine("Inside Class Method");
        Console.WriteLine("Inside Method value of Class Object is: " + newClass.x);
    }
    public struct myStruct
    {
        public int x;
        public myStruct(int xCons)
        {
            this.x = xCons;
        }
    }
    public class myClass
    {
        public int x;
        public myClass(int xCons)
        {
            this.x = xCons;
        }
    }

Output
Initial value of Struct Object is: 10
Inside Struct Method
Inside Method value of Struct Object is: 20
After Method call value of Struct Object is: 10
Initial value of Class Object is: 10
Inside Class Method
Inside Method value of Class Object is: 20
After Method call value of Class Object is: 20
Here you can clearly see the difference between call by value and call by reference.
Answer: There is one interesting case of "class vs struct" puzzle - situation when you need to return several results from the method: choose which to use. If you know the  ValueTuple story - you know that ValueTuple (struct) was added because it should  be more effective then Tuple (class). But what does it mean in numbers? Two tests: one is struct/class that have 2 fields, other with struct/class that have 8 fields (with dimension more then 4 - class should become more effective then struct in terms processor ticks, but of course GC load also should be considered).
P.S. Another benchmark for specific case 'sturct or class with collections' is there: https://stackoverflow.com/a/45276657/506147
BenchmarkDotNet=v0.10.10, OS=Windows 10 Redstone 2 [1703, Creators Update] (10.0.15063.726)
Processor=Intel Core i5-2500K CPU 3.30GHz (Sandy Bridge), ProcessorCount=4
Frequency=3233540 Hz, Resolution=309.2586 ns, Timer=TSC
.NET Core SDK=2.0.3
  [Host] : .NET Core 2.0.3 (Framework 4.6.25815.02), 64bit RyuJIT
  Clr    : .NET Framework 4.7 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.2115.0
  Core   : .NET Core 2.0.3 (Framework 4.6.25815.02), 64bit RyuJIT

            Method |  Job | Runtime |     Mean |     Error |    StdDev |      Min |      Max |   Median | Rank |  Gen 0 | Allocated |
------------------ |----- |-------- |---------:|----------:|----------:|---------:|---------:|---------:|-----:|-------:|----------:|
  TestStructReturn |  Clr |     Clr | 17.57 ns | 0.1960 ns | 0.1834 ns | 17.25 ns | 17.89 ns | 17.55 ns |    4 | 0.0127 |      40 B |
   TestClassReturn |  Clr |     Clr | 21.93 ns | 0.4554 ns | 0.5244 ns | 21.17 ns | 23.26 ns | 21.86 ns |    5 | 0.0229 |      72 B |
 TestStructReturn8 |  Clr |     Clr | 38.99 ns | 0.8302 ns | 1.4097 ns | 37.36 ns | 42.35 ns | 38.50 ns |    8 | 0.0127 |      40 B |
  TestClassReturn8 |  Clr |     Clr | 23.69 ns | 0.5373 ns | 0.6987 ns | 22.70 ns | 25.24 ns | 23.37 ns |    6 | 0.0305 |      96 B |
  TestStructReturn | Core |    Core | 12.28 ns | 0.1882 ns | 0.1760 ns | 11.92 ns | 12.57 ns | 12.30 ns |    1 | 0.0127 |      40 B |
   TestClassReturn | Core |    Core | 15.33 ns | 0.4343 ns | 0.4063 ns | 14.83 ns | 16.44 ns | 15.31 ns |    2 | 0.0229 |      72 B |
 TestStructReturn8 | Core |    Core | 34.11 ns | 0.7089 ns | 1.4954 ns | 31.52 ns | 36.81 ns | 34.03 ns |    7 | 0.0127 |      40 B |
  TestClassReturn8 | Core |    Core | 17.04 ns | 0.2299 ns | 0.2150 ns | 16.68 ns | 17.41 ns | 16.98 ns |    3 | 0.0305 |      96 B |

Code test:
using System;
using System.Text;
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Columns;
using BenchmarkDotNet.Attributes.Exporters;
using BenchmarkDotNet.Attributes.Jobs;
using DashboardCode.Routines.Json;

namespace Benchmark
{
    //[Config(typeof(MyManualConfig))]
    [RankColumn, MinColumn, MaxColumn, StdDevColumn, MedianColumn]
    [ClrJob, CoreJob]
    [HtmlExporter, MarkdownExporter]
    [MemoryDiagnoser]
    public class BenchmarkStructOrClass
    {
        static TestStruct testStruct = new TestStruct();
        static TestClass testClass = new TestClass();
        static TestStruct8 testStruct8 = new TestStruct8();
        static TestClass8 testClass8 = new TestClass8();
        [Benchmark]
        public void TestStructReturn()
        {
            testStruct.TestMethod();
        }

        [Benchmark]
        public void TestClassReturn()
        {
            testClass.TestMethod();
        }

        [Benchmark]
        public void TestStructReturn8()
        {
            testStruct8.TestMethod();
        }

        [Benchmark]
        public void TestClassReturn8()
        {
            testClass8.TestMethod();
        }

        public class TestStruct
        {
            public int Number = 5;
            public struct StructType<T>
            {
                public T Instance;
                public List<string> List;
            }

            public int TestMethod()
            {
                var s = Method1(1);
                return s.Instance;
            }

            private StructType<int> Method1(int i)
            {
                return Method2(++i);
            }

            private StructType<int> Method2(int i)
            {
                return Method3(++i);
            }

            private StructType<int> Method3(int i)
            {
                return Method4(++i);
            }

            private StructType<int> Method4(int i)
            {
                var x = new StructType<int>();
                x.List = new List<string>();
                x.Instance = ++i;
                return x;
            }
        }

        public class TestClass
        {
            public int Number = 5;
            public class ClassType<T>
            {
                public T Instance;
                public List<string> List;
            }

            public int TestMethod()
            {
                var s = Method1(1);
                return s.Instance;
            }

            private ClassType<int> Method1(int i)
            {
                return Method2(++i);
            }

            private ClassType<int> Method2(int i)
            {
                return Method3(++i);
            }

            private ClassType<int> Method3(int i)
            {
                return Method4(++i);
            }

            private ClassType<int> Method4(int i)
            {
                var x = new ClassType<int>();
                x.List = new List<string>();
                x.Instance = ++i;
                return x;
            }
        }

        public class TestStruct8
        {
            public int Number = 5;
            public struct StructType<T>
            {
                public T Instance1;
                public T Instance2;
                public T Instance3;
                public T Instance4;
                public T Instance5;
                public T Instance6;
                public T Instance7;
                public List<string> List;
            }

            public int TestMethod()
            {
                var s = Method1(1);
                return s.Instance1;
            }

            private StructType<int> Method1(int i)
            {
                return Method2(++i);
            }

            private StructType<int> Method2(int i)
            {
                return Method3(++i);
            }

            private StructType<int> Method3(int i)
            {
                return Method4(++i);
            }

            private StructType<int> Method4(int i)
            {
                var x = new StructType<int>();
                x.List = new List<string>();
                x.Instance1 = ++i;
                return x;
            }
        }

        public class TestClass8
        {
            public int Number = 5;
            public class ClassType<T>
            {
                public T Instance1;
                public T Instance2;
                public T Instance3;
                public T Instance4;
                public T Instance5;
                public T Instance6;
                public T Instance7;
                public List<string> List;
            }

            public int TestMethod()
            {
                var s = Method1(1);
                return s.Instance1;
            }

            private ClassType<int> Method1(int i)
            {
                return Method2(++i);
            }

            private ClassType<int> Method2(int i)
            {
                return Method3(++i);
            }

            private ClassType<int> Method3(int i)
            {
                return Method4(++i);
            }

            private ClassType<int> Method4(int i)
            {
                var x = new ClassType<int>();
                x.List = new List<string>();
                x.Instance1 = ++i;
                return x;
            }
        }
    }
}

Answer:
Structs are the actual value - they can be empty but never null

This is true, however also note that as of .NET 2 structs support a Nullable version and C# supplies some syntactic sugar to make it easier to use.
int? value = null;
value  = 1;

Comment: Be aware that this is only syntactic sugar which reads 'Nullable value = null;'
Comment: @ErikvanBrakel That's not just syntactic sugar. The different boxing rules mean `(object)(default(int?)) == null` which you can't do with any other value type, because there's more than just sugar going on here. The only sugar is `int?` for `Nullable`.
Comment: -1; this doesn't address the question of what the difference between structs and classes is, and as such, it should've been a comment on the answer you're replying to, not a separate answer. (Although perhaps the site norms were different back in August 2008!)
Answer: Every variable or field of a primitive value type or structure type holds a unique instance of that type, including all its fields (public and private). By contrast, variables or fields of reference types may hold null, or may refer to an object, stored elsewhere, to which any number of other references may also exist. The fields of a struct will be stored in the same place as the variable or field of that structure type, which may be either on the stack or may be part of another heap object.
Creating a variable or field of a primitive value type will create it with a default value; creating a variable or field of a structure type will create a new instance, creating all fields therein in the default manner.  Creating a new instance of a reference type will start by creating all fields therein in the default manner, and then running optional additional code depending upon the type.
Copying one variable or field of a primitive type to another will copy the value. Copying one variable or field of structure type to another will copy all the fields (public and private) of the former instance to the latter instance. Copying one variable or field of reference type to another will cause the latter to refer to the same instance as the former (if any).
It's important to note that in some languages like C++, the semantic behavior of a type is independent of how it is stored, but that isn't true of .NET. If a type implements mutable value semantics, copying one variable of that type to another copies the properties of the first to another instance, referred to by the second, and using a member of the second to mutate it will cause that second instance to be changed, but not the first. If a type implements mutable reference semantics, copying one variable to another and using a member of the second to mutate the object will affect the object referred to by the first variable; types with immutable semantics do not allow mutation, so it doesn't matter semantically whether copying creates a new instance or creates another reference to the first.
In .NET, it is possible for value types to implement any of the above semantics, provided that all of their fields can do likewise. A reference type, however, can only implement mutable reference semantics or immutable semantics; value types with fields of mutable reference types are limited to either implementing mutable reference semantics or weird hybrid semantics.


Is "get hairs cut" proper English?

Question: A friend always writes in her emails that she and her husband are going to get their "hairs cut at a salon", not hair cuts or haircuts. She grew up in the 1930s in L.A. so perhaps this was normal for that era but it seems awkward. I would never correct her but I would like to know if this is correct English.
Comment: Note that the phrase is *literally* correct, even though it's unusual. You do *actually* have hairs cut. It could also be said in a joking way. An expression that was once said in jest but has since become habit.
Comment: It's not idiomatic. to get [my, your] hair cut, is idiomatic. To get my clothes cleaned [dry cleaned]. To get my work done.
Answer: That does not sound right to me. In current LA, I'm sure they don't say that. 1930s: I doubt it, but wasn't there.
Possibly she is making a private joke. I have heard people (mostly women) saying that their husband will get his "hairs" cut, implying that he has so little hair left, that when the barber cuts "it", he actually cuts "them" (one at a time).   ...[impertinent question: is her hair thinning also?]
Comment: It's also not impossible that she (pedantically or jocularly) employs the plural because she's getting her hair cut and he's getting his hair, so two hairs are cut.:)
Answer: "Hairs cut" is not idiomatic.  It should be "haircuts".
However, there is a silly joke (one we might call a "Dad joke") that relies on the ambiguous relationship between the uncountable noun "hair" (the part of the body that refers to the quantity of hair on one person's head) and the countable noun "hair" (as in a strand of hair):

Son:  Hey Dad, can I have some money to get a haircut?
  Dad:  How much do you need?
  Son:  It's $20.
  Dad:  Well for that price you'd better tell them to cut more than one hair.

Your friend might also be making a joke, or it might be a common expression used by her friends and family.

Is "get hairs cut" proper English?


How much is air mass flow rate of bleed air used for environmental control system in civil aircraft?

Question: I'm looking for a general use-case formula or reference that I can use to calculate the total mass flow rate of bleed air use in the environmental control system of any aircraft. I'm not looking for information on a specific aircraft - simply a general reference that can applies to all civil aircraft.
Comment: For what aircraft?
Comment: Welcome to the site! Your question is a bit broad and "critical condition" is not so clear. You may edit your post to clarify what you want to know. Overall the ECS packs on usual airliners can be shut-off when necessary, so they will not load engines.
Comment: Tnx Mr Beyer.
actually i need any kind of information on this subject. i need to know maximum and minimum mass flow rate . for any civil aircraft.
Comment: @ebrahimhajian I apologize but that is way too broad for this site. You need to narrow it down to at least a family of aircraft (777, A320, etc). This differs wildly (I'm sure) based on cabin configuration, aircraft size, and engine selection.
Answer: EASA and FAA engine type certificates often identify the total bleed mass flow, as a % of the engine's high pressure compressor exit flow. For example, see section 10, "Maximum permissible air bleed extraction" in this for the CFM56-7B, which shows 7 to 13%. If you assume in a civil aircraft that all the bleed air from the engine if for the ECS, you get an answer. (Or maybe you where actually looking for the total bleed mass flow).
If you can get this data from enough references, you could develop a general guideline.
Answer:
Compute aircraft internal volume V [m$^3$]
Refresh this volume every 2 minutes
Take an air density at 2,000 m: $\rho$ = 0.94 kg/m$^3$ (cruise altitude)
Compute the mass flow $\dot{m}$ = V * $\rho$ / 120 [kg/s]


Topological vs. non-topological noetherian charges

Question: What (if any) is the relationship between the conserved (non-topological) noetherian charges and topological charges? Namely, is there any "generalization" of the Noether's first theorem that includes topological charges as subcase and it provides some relationship between these two classes of charge?
Comment: I don't think so. Homotopy charges (aka topological charges) are not necessarily based on discrete groups, or are they?
Answer: Let there be given a physical system. What charges are Noetherian and what charges are topological often depend on the precise action formulation and field content of the physical system, see also this Phys.SE post.  To simplify the discussion, let us assume that the action formulation is fixed,
and below definitions will then refer to this fixed formulation.
A characteristic feature of a topological conservation law (CL) is that it holds off-shell, i.e. independent of the Euler-Lagrange equations. Olver calls such a CL trivial of the second kind, cf. Ref. 1.
Many authors require by definition a topological CL to not be a Noetherian CL, i.e. not covered by a Noetherian theorem.
Nevertheless, even if there exists a quasi-symmetry (QS) of the action that via Noether theorem leads to a topological CL, the CL is (as mentioned above) trivial, which (under mild assumptions) means that it corresponds to a trivial QS, cf. Ref. 1. (A trivial QS means that the QS transformation vanishes on-shell. See also this Phys.SE post.)
References:

P.J. Olver, Applications of Lie Groups to Differential Equations, 1993.


XMR to XMO (Recovery)

Question: Is it possible to recover XMR that was sent through mymonero.com to freewallet.org? At first I tried to send my XMR(mymonero.com) to deposit XMR address of(freewallet.org) but it says "Something unexpected occurred when submitting your transaction: Failed to decode address (#63): Invalid address prefix", so I used the  freewallet.org Monero Original deposit address and it went through. But then I didn't received it on my freewallet.org, I contacted their support they said it was mistake that I sent XMR to XMO and my XMR coins are stuck now. My question is that can this be recover using any tools or something like that? because if this is not valid at the first place why mymonero.org have transaction id on sending the xmr to xmo address? I'm sorry I'm newbie at this, hopefully masters like you can help me. Thanks in advance.
Answer: It is impossible for XMR to become XMO during a blockchain transaction. What actually happened is that XMR was sent to an "XMO address" which was interpreted as an XMR address. Therefore you sent XMR to an XMR address, and it's still XMR. You sent the funds to an XMR address they were not expecting you to send funds to.
Since they know the private keys to their XMO wallet, they should be able to use those private keys on the XMR blockchain to set up a wallet to get access to the the XMR funds that you sent. There is nothing you can do to reverse the transaction, because cryptocurrency transactions are irreversible.
If they are not willing to bother to do this for you, then please document the situation and notify the Monero community. There have been other reports of problems with freewallet.org documented here: https://www.reddit.com/r/Monero/wiki/avoid

XMR to XMO (Recovery)


Clan.cfg is needed in Counter strike global offensive or not?

Question: I wanted to know whether there are needed of any cfgs(configuration) like live.cfg, knife.cfg, clan.cfg and other kinds of cfg needed for counter strike global offensive or not?. In counter strike 1.6 we need those kinds of cfgs in order to play clan but as I'm a newbie in CS GO so I want to know about it. Any help would be much appreciated... :)
Answer: The server configuration files for Counter Strike Global Offensive differ from what you're used to with previous Source-based dedicated servers. The basics are covered in this article on Valve's website however I will cover the basics here;
gamemodes_server.txt
This covers the basic settings applied for each of the different game modes available in Counter Strike: Global Offensive. These settings are loaded when the server starts and applied whenever the game mode is changed.
You should not change this file manually as it will be replaced automatically by the updater in the event you patch your server after Valve have released an update, but you can use it as a basis for making changes by understanding the file hierarchy and applying it to the next configuration file:
gamemodes_server.txt
When you first install the CSGO dedicated server, this file is called gamemodes_server.txt.example and will need to be renamed. This has the same structure as the gamemodes.txt file and must remain in this structure to be read correctly. In this file you can define any custom settings you want and you can take any of the individual settings from gamemodes.txt and re-define them here in this file. When your game server is started the settings present in this file will override those loaded from the gamemodes.txt file. This is also one location that you can define your map cycle.
autoexec.cfg
This file is executed before the first map starts and can continue any individual server variables that you could otherwise provide from the command line.
server.cfg
This is your server settings file, and contains information like your server name, rcon password, maximum number of players, etc. If this file does not exist, the game server will not start.

This is not the limitation to all of the files you can create or use, however it is an overview of the ones that are required for the game server to start up to a point where people can connect and play. There are many websites that will cover each available setting in detail and even a couple of configuration file generators that will make the changes for you. As always before making changes to any configuration file, make sure you back up your existing ones first, so you can roll back any changes that you make in the future.
Comment: Thanks for your answer but still i'm little bit perplexed that inorder to play clan, i don't need of clan.cfg or not?
Comment: If it's not on the above list, it's not "needed" for the server to run. In CS:GO things like clan name are inherited from Steam - any individual settings can be set in any of the above files.
Comment: In cs go, the clan name inherited from the groups name that we have joined(You are right). Thanks for your help...:))


Getting started with PostGIS?

Question: I have been reading a lot about PostGIS, but I am struggling to find a good beginner's guide.
Which tutorials/books do you recommend?
Answer:
This question has been converted to Community Wiki and wiki locked
because it is an example of a question that seeks a list of answers
and appears to be popular enough to protect it from closure.  It
should be treated as a special case and should not be viewed as the
type of question that is encouraged on this, or any Stack Exchange
site, but if you wish to contribute more content to it then feel free
to do so by editing this answer.

A good start can be the PostGIS Manual edited by Paul Ramsey.
Boundless' Introduction to PostGIS
Boundless (formerly opengeo) has a very very good workshop with a lot of exercises on the PostGIS database. I would start with this one.
Some starting points to consider:

PostGIS in Action (Second Edition) should be your first resource

Materials from BostonGIS webpage

Also, for general introduction to PostgreSQL I quite enjoyed 'Beginning Databases with PostreSQL' book by Matthew & Stones.
Answer: My way to find PostGIS was
http://bostongis.org/?content_name=postgis_tut01#20
there is three parts of the tutorial. I really like it.
Then I have to mention:
http://postgisonline.org
I have tried to build a way of trying spatial SQL queries online. There are a very few tutorials there:
http://postgisonline.org/tutorials
anyone can write a tutorial and use it through the site. Look at http://postgisonline.org/doc
There is still a lot to do with the site but there is not time enough.
Answer: Take a look at Portable GIS:

provide beginners with a
ready-installed and configured stack
of open source GIS tools that would
run in windows without the need for
emulation or a live cdemulation or a live cd

i.e. You can have it up and running on a USB stick.  Very handy for workplace environments.
It has on it:
PostgreSQL (version 8.4)/Postgis (version 1.4)
Answer: Since this year (2014), we've got the excellent "PostGIS Cookbook" from Packt publishing [Paolo Corti, Stephen Vincent Mather, Thomas J Kraft, Bborie Park]
Here's the link: http://www.packtpub.com/postgis-to-store-organize-manipulate-analyze-spatial-data-cookbook/book
A lot of cases are explained with working instructions.
Answer: Try this book it's awesome
https://www.packtpub.com/big-data-and-business-intelligence/postgis-essentials
very clear, lot of examples.

Getting started with PostGIS?


Some Keyboard shortcut doesn't work

Question: I'm using Loki and when I try to move a window from a desktop to another this doesn't work. Or better It's move to the left but not to the right. I've tried to reassign the shortcuts but doesn't work.
Answer: go to System setting->keyboard->shortcuts  click on any function on the right box and choose what shortcut u want to use for that function.

Some Keyboard shortcut doesn't work


What does the coordinate of time really mean?

Question: The meaning of the $t$ which appears in space-time intervals or metrics in general relativity. I concluded that $t$ was just a mathematical thing which allows us to label the "space-time manifold" and only proper time τ had a physical meaning too. On Wikipedia I also found that the coordinate time is not a time that could be measured by a clock located at the place that nominally defines the reference frame. What does it really mean?
Comment: I think your question could be helped by being a bit more clear about what you're asking and providing links to sources.
Answer: First, imagine that you're in an inertial reference frame. We can think of this as a sort of lattice throughout space, with a synchronized clock at each lattice point in space. Now imagine two events, $A$ and $B$, which occur at space-time coordinates $(t_A, x_A, y_A, z_A)$ and $(t_B, x_B, y_B, z_B)$. The reference frame has (again, synchronized) clocks at $(x_A, y_A, z_A)$ and $(x_B, y_B, z_B)$. The coordinate time $\Delta t_{AB}$ is the difference in time measured by the clock at $B$ and the clock at $A$, so that $\Delta t_{AB}=t_B-t_A$. If $\Delta t_{AB}=0$, the events are simultaneous in that reference frame. However, an observer in a different inertial frame (say, in one with a boost $\vec{\beta}$ in the $x$-direction) might measure a different $\Delta t_{AB}$. This means that coordinate time is frame-dependent - it depends on the reference frame you're in.
Proper time is sometimes called "wristwatch time". Now, there's a single clock, and it measures the time between two events $A$ and $B$ on a single worldline. This proper time $\tau_{AB}$ does not depend on your reference frame, but it does depend on the path you take from $A$ to $B$ - that is, it's path-dependent.
One way to think of the difference is that coordinate time tells you something about one reference frame relative to another (because it's frame-dependent), while proper time tells you something about the worldline of the observer (because it's path dependent).


So I tried to upgrade from 10.04 to 12.04, and now I'm at the command line in recovery mode. What can I do?

Question: I first made sure I had installed all available upgrades for 10.04, and checked that my Update Manager settings were right for showing the 12.04 upgrade, but I didn't see it.  (I did this yesterday.)  So I did a quick Google and found this page, and ran update-manager -d from the command line.  It went through the download, started installing, and at this point I wanted to make sure I didn't have any other processes running so I opened the system monitor from the taskbar, as well as a terminal.  These opened, but I noticed that the windows no longer had the minimize-maximize-close buttons, and moreover I couldn't close them from the bar at the bottom.  Nor at this point was I able to switch between desktops.  The install proceeded until it came to a console prompt.  I tried responding with the default (I.e., 'n' keyboard input) but the console didn't take the input; it was unresponsive.  So I restarted the computer and the bootup procedure (from GRUB, only 10.04 is shown in the menu) appeared to hang on the low-res screen 'Ubuntu' and the 5 progress dots.  So I've restarted and gotten to the command line in recovery mode.  What to do now? :(  NB gcc 4.6.3 is installed so I know the installation got at least that far.
Comment: Possible duplicate: http://askubuntu.com/questions/126724/i-cant-boot-into-a-usable-system-anymore-what-should-i-do
Answer: Solved it!  It's booting up fine now.
Comment: Then please mark this as solved / close it.


What is the best format to deliever an illustrator logo design to a client?

Question: Which file format is best to export from illustrator for prints & enlargements and web?
Comment: The best would probably be AI as others have explained here.
Answer: The answer is: two outlined PDF. One in CMYK and one in RGB.
This enables the receiver to open and edit the CMYK file in Illustrator or any other vector program (for print). The RGB PDF can also be opened by photo editors on any resolution, for usage in social media profiles, etc. Finally, an RGB PDF can be easily converted to an SVG (by Illustrator), for usage on a website.
Answer: Short answer:
Go vector. Industry standard .eps or .ai should work (I prefer the latter). For web usage, you could include a transparent background png at a high resolution (2000px width +) and/or svg.
I would also suggest you include both RGB and CMYK versions of the logo for use in web and print contexts.
Long answer:
When I package a logo for a client, I send them a zip, with a folder structure that ussually looks like this:

cmyk/
rgb/
fonts/
README.txt

For files, I create both rgb and cmyk versions of each of the logo variations (typically horizontal and vertical designs).
I also create color variations for each format (e.g., brand colors, possibly versions for dark and light backgrounds, etc.)
Depending on project, I will also create a "bug" that can be used for social media and/or avatars.
For just the rgb logo, I include a 2000px wide png of each file; this is for clients that just need quick access but don't want to open, or have access to, an app like Adobe Illustrator.
I always remember to include the fonts I used when creating the logo, and/or any supporting fonts (e.g., taglines, subheads, etc.) (Note: While the font I use for a logo may get manipulated, there are times when having the original font is useful for scenarios where you can't include graphics and have to recreate a font-only version of the same logo.)
For naming conventions of logo files, I generally like to do this:

brand-name-[logo/bug/other]-[logo-variation-version-number-zero-padded].[color].[color-model].[extension]

The contents of README.txt may vary, but as a baseline I put:

Use logos found in "cmyk" for print materials only.
For all other purposes, use logos found in "rgb".
Company Name or Designer Name
555 Fake Street
Town, ST 55555
http://company-or-designer-domain.com

Here is an example screen shot:

Shown in screen shot above, I have a dev/ folder that contains all of the original working files that I created during development of the logo.
I hand off the logo package as a zip file (brand-name-logo.072016.zip), and it contains all files mentioned above with the exception of the dev/ folder.
Not shown in screen shot would be color swatches; I don't typically include this in the "logo zip", but giving your client their brand colors as RGB and CMYK (and Pantone) is always a nice touch.
YMMV.


How can one use multi signature transactions/addresses to improve the security of their services?

Question: Multi signature transactions and addresses are heralded to be a good way to improve security of various Bitcoin services. However, how should one go about using them in order to achieve that goal? For example, how would an owner of an exchange, a shop, or a private user would be able to gain the most out of using multi signature transactions and/or addresses?
Answer: Well, the theory is that you have a buyer, a seller, and an escrow holder. This is for transactions like Bitmit or OTC or Silk Road where the buyer and the seller do not trust one another enough to reliably complete the transaction. If you run the website and offer the goods, then you'd either need to just build a good enough rep that you don't need to offer escrow, or find a third party escrow provider to keep you honest. Once M-of-N gains traction in the client software, I could foresee business sprouting up just to handle Escrow.
So buyer pays Escrow his fee first, then buyer, seller, and escrow build a 2-of-3 multisig address and buyer dumps his funds in. Goods are transacted, and if buyer and seller are both happy then they sign a transaction together releasing the multisig funds to seller. Escrow agent doesn't need to lift a finger when there's no dispute.
When there is a dispute, buyer and seller each craft and sign the transaction they think should happen (normally "I get all the dough", but more complicated spends are possible too) and submit those to Escrow agent along with their evidence as to how the transaction happened. Escrow judges between them and signs the transaction he thinks should succeed. 2/3 signatures makes the transaction valid.
As to "how will the client software actually work" and "what will the GUI look like", that's a fine question! It appears as though crafting the GUI is the final major obstacle towards this becoming a more widespread transaction type. :3
I've been posting on /r/bitcoin and chatting with Ferroh and others, trying to work out just how to do it the hard way at the command line. :P
Comment: You have described just one specific application for multi-signature.


What is the difference between a pitot tube and a pitot-static tube?

Question: What is the difference between a Pitot tube and a Pitot-static tube? If an aircraft fitted with Pitot tube and static holes on the fuselage, is it necessary to consider the static pressure measurements to calculate the airspeed?
Answer: A pitot probe strictly measure ram air pressure, commonly called "pitot pressure" or Pt pressure. A pitot tube measures pitot pressure and pitot pressure only. A separate static port is required to measure static pressure (Ps) and will usually be located on a section of the fuselage where airflow is minimized.
A pitot-static port is a combination pitot AND static port. That is, the tube itself has an opening for detection of Pt pressure and one or more openings for static pressure. In this case, there generally is no static port on the fuselage since it's built into the pitot-static probe.
TLDR: the only difference between the two is that a pitot-static probe is a pitot probe with static ports whereas a pitot tube is strictly just a pitot tube. :-)
Edit: Not sure if the original question was edited after my answer or if I missed the second part in my original response... Static pressure is required to know indicated airspeed because as altitude increases, airspeed increases due to less air resistance.
Comment: Also called Total Pressure: both static and dynamic pressure combined.
Answer: I haven't heard of that specific item, but Piper used to design the pitot-static systems on their light aircraft with a single blade-like mast which contained both a stagnation tap on the front face and a static port on the aft side as well as a drain hole on the bottom to remove moisture from the unit.  It was also electrically heated for deicing.

Supposedly the Piper design had an advantage over conventional, separate pitot tubes and static ports as installed in Cessnas, Mooneys, etc. in that the indicated airspeed more closely matched that of calibrated airspeed on the pitot-static blades as opposed to the separate tube and port design.
Answer: A pitot tube is designed for measuring ram air pressure, but a static port is designed for measuring static pressure.
There are differences between them.
Ram air pressure is the sum of the dynamic pressure and static pressure.
You can't only measure the dynamic pressure because the air always has static pressure.
So you have to measure the ram air pressure which is the sum of the dynamic and static pressure and then remove the static pressure which is measured by static port.


How can I quit using Stack Overflow?

Question: I am spending most of my time on Stack Overflow, earning reputation and badges. This is causing me to be late on some of my tasks. How I can stop using Stack Overflow?
Comment: You can always checkout but you can never leave...
Comment: Call your doctor. Tell them "I'm addicted to a website". No need to explain which one. They'll give you advices about how to progressively get your life back. // I'm not joking.
Comment: @brasofilo If you stop drinking every day, you might have a problem...
Comment: @Arvindraja I can assure you I was not joking. Addiction is a very serious issue.
Comment: Voting to re-open: Of course this is opinion based. That's basically the point of discussions on Meta.
Comment: Related MSEs: https://meta.stackexchange.com/questions/4004/how-can-i-keep-from-getting-addicted-to-stack-overflow , https://meta.stackexchange.com/questions/91609/how-do-i-prevent-a-stack-overflow-addiction
Comment: Just like you stop drinking; one day at a time.
Comment: @Moritz Therapist, not doctor.
Comment: @Dukeling Where I live, you have to tell your doctor/physician first, and they will redirect you to a therapist. I guess it works differently in other places.
Comment: If you're really serious about it, you can request that your account be deleted.
Comment: @Moritz - haha, you people are making great fun.
Comment: @Dukeling - Not at all. Just I asked for the sake of getting others openion on this.
Comment: @Moritz - I agree altogether. As Cerbrus commented in his answer i'll take care it. Even I have busy schedule I am spending some time here that's why this idea came in my mind to ask question.
Answer: Close the browser tab.
That's all there is to it. Just do it.
Comment: Disclaimer: This answer is sponsored by Nike.
Comment: The deeper meaning in this answer is "Discipline". That's not something we can give you. That's something _you_ have to take care of.
Comment: I do, but it just keeps opening again...
Comment: @Script47 did you ever succeeded doing so for something that society encourages or at least accepts (like participating in charity events or drinking coffee)? SO is very bad for quitting cold turkey if you are developer - participation is considered "help others" and you rarely can keep it from not showing up in search results...
Comment: @Script47 That's why the green tick seems familiar to me .. it should black in this case
Comment: Thank for your creative answer. :)
Comment: We can only show you the door *(and we're pretty good at it, according to some people)*, but you have to walk through it.
Comment: _"Something about red and blue pills, and rabbit holes"_
Comment: @Script47 - The comment of Cerbrus seemed quite convincing to me.
Comment: If that would work for any addiction for sizable number of people life would be so much easier... While I don't think this is really that useful advice I don't see how SO can provide better suggestion as real on-topic answer (unfortunately).
Comment: Exactly! I agree altogether.
Comment: @Dukeling yeh that happens when your browsers start page is Stack Overflow :D
Comment: @AlexeiLevenkov closing it off right away is like going ['cold turkey'](https://en.m.wikipedia.org/wiki/Cold_turkey) and that has worked quite well.
Comment: @AlexeiLevenkov the only issue here is that the OP is going after badges and rep which is causing them problems IRL. Therefore if we take the suggestion that someone posted above of deleting their account *and* going cold turkey from the account based stuff (answering, flagging, chasing badges etc) then they can still use SO as a "guest" user with no ability of answering or doing those tasks which previously caused them issues. With their account (read: hard work) being deleted, that might quench the temptation to start again.
Answer: A few years ago, I asked a similar question. At the time, my problem wasn't that the site prevented me from doing my job, but rather that it felt like a waste of time to pursue trinkets on the site. It is a serious problem—especially for people who are prone to addiction. I found myself embarrassed to discuss how much time I spent answering questions, which opened my eyes to the depths I'd fallen to.
There are some technical solutions, such as logging out of the site and unsubscribing from email notifications. (Not in that order, of course.) I found it helped to shift my efforts to other sites on the network that exercise different parts of my brain. If you are a professional programmer, spending some time thinking about travel or learning about biology might be a better distraction than doing more programming work on Stack Overflow. (Though it does have the downside of putting pings from SO in your topbar. Maybe use an alternate account instead?)
I'm no psychologist and I wouldn't give advice over the internet if I were. Instead, I encourage you to seek out people you can talk to. If your work has a counselling benefit, that might be a good thing to take advantage of. There may be other resources available in your community. Even just talking about it with someone—a friend or coworker—could be of help.
We face a similar concern with moderators who often feel responsible for the site and don't know how to leave. It's been on my heart to find ways to give people permission to quit a site. While that might seem to run counter to the company's goals, I think it's necessary in the long run. Avoiding stealth lock-in is a mature strategy to building a great business. After all, if people know they can take time off, they won't be as worried about coming back in the future.
Answer: Put a picture of someone that would be concerned if your success was put in jeopardy near your monitor. My kids work for me, but it could be any family member or friend that is involved in your life, or even a pet that depends on you.
It helps get a little more determination together to avoid tendencies that aren't good for your long-term goals. I used that method to cut back on SO / Twitter / Reddit some time ago, and continue to keep my .. err .. little Minecraft problem ... in check with it.
Ultimately you do have to just close the tab, and simplistically, that is it, but sometimes it helps to have a trick to overcome compulsive behavior, even if it's just for the sake of a little extra confidence.
Comment: Dear @TimPost, sorry to bother but, at your request: [_if you haven't heard anything from me about this in a month you should definitely get after me in comments._](https://meta.stackoverflow.com/questions/288274/please-implement-clause-7b-of-the-cc-by-sa-license/288276#288276)
Answer: I totally understand. I have no answer, but have faced the same problem, so will tell you what I did.
I faced this agony time ago, it's an addictive site. Let's face it, it's not a "bad" place to be hooked on.
Some years ago I was active on quite a few sites and I found it hard to close the browser. I took some time off the sites (actually closed my accounts and I wouldn't recommend this, as I came back) and it was quite a difficult void to fill. I came back and instead of resisting my use of them,  I leant into it. I became active in SOCVR and Charcoal which eventually led to me now moderating on two sites.
I have several Stack Exchange sites on my favourites bookbar and have a little ritual when returning online or from doing other non Stack related activities (like working). I'll reward myself with Stack activity as a break when I've achieved a self projected "milestone" in my work.

I check the pets site for mod flags.
Then answer any pings from across the network.
I then go  to the Stack Overflow moderator flag queue. Will handle some flags and then check meta (the queue and some posts), then return to the flag queue.
I then rejoin my favourite chat rooms.
Repeat and rinse.

I do this many times throughout the day (and night if I'm awake). I enjoy it. I also try to post one pet picture or meme into the litter box every day (I usually do this after feeding my horses, as I have fresh pics). I sometimes ask or answer questions on Pets or Stack Overflow (meta or main).
One thing I did do to curb my site use, when I was a member of Charcoal, I  joined every Stack Exchange site so I could flag spam. When I finally felt overloaded in my activities, I deleted most of my network accounts and kept the handful that I really enjoy the most or are most relevant to my work. Note I put enjoyment before work? As to me, that's what this is about for me. I enjoy it and I'm learning. A really nerdy thing to be pleased about hey?
Don't forget, it's not all hard work and bristles on here. We're allowed to have fun. I've been thoroughly enjoying the answers to this thread Happy 10th anniversary Stack Overflow! Commence ... au festival!. Especially the suggestion to win Jon Skeet for a day (he's willing to do housework!). Goes against every humanitarian law I'm sure.  We have a running thread of the mathematical marvels on this answer. It's nice to have a pocket on the site where we're light again.  We all need to remember to enjoy the site. For that I embrace your question. It's refreshing in a plethora of complaints to have someone who can't stay away.
Comment: @Cerbrus I would add that this answer is encouraging him to use the site more and more until he become a moderator and have more things to do ...
Comment: @TemaniAfif the problem is not the site, it's procrastination. People will find other things to delay things they're avoiding, it's still not the site. Often when you're on a diet you'll think about the thing you tell yourself you cannot have. If you allow yourself to have it, it loses its power and you want it less. However this is getting too deep now. :D
Comment: So, for a TL;DR, how does this help the OP reduce his site usage? You're basically answering: _"I was in the same boat, and ended up using the site more"_
Comment: Maybe hanging out in SOCVR en Charcoal make you realize how much garbage is posted hourly and that onslaught causes you to quit. I like the reasoning.
Comment: @YvetteColomb so let's hope the OP will get it this way ;)
Comment: @TemaniAfif it beats reading facebook memes! :D
Comment: @TemaniAfif sometimes there is no problem, it's in the resisting there is a problem. People often are bound up by what they think they "should" be doing. Do what makes you happy (do I need to add the disclaimer as long as it's not destructive?). Answers do not have to be linear or yes and no.  Sometimes it pays to think outside the box. I'm also giving the OP and other readers avenues to join into chat rooms and enjoy the community. What we post here if for a wider audience than the OP and voters, always.
Comment: OP: _"because of that some of my tasks getting late."_ I'm not sure using the site more is the right answer here.
Comment: @Cerbrus it is a trick ... ;)
Comment: yes but he has a problem " *because of that some of my tasks getting late.* " .. you probably found  a way to deal with all this and it's very good but it's not the same for him
Comment: @usr2564301 you're aware that's a joke?
Answer: Block the site with program and password, which you will forget, so you can't open it anymore.
Answer: How ironic is this question with the current events happening: "How can I quit using StackOverflow?"
Account deletion.

How can I quit using Stack Overflow?


Is Lester Crest from Grand Theft Auto 5 Supposed to be Zero From Grand theft auto San Andreas?

Question: As soon as I saw the character in a cutscene of GTAV I noticed he seems to be a 'nerd' with glasses. And he somewhat talks like somebody I've seen in previous GTA games.
I've thought to myself "is that meant to be Zero from grand theft auto san andreas?".
I've been online and searched for the answer, but I found nothing, so if anyone has sources or know the answer could I please know?...It's really bugging me.
Comment: Possible duplicate of [Do any of the characters from GTA: San Andreas make an appearance in GTA 5?](https://gaming.stackexchange.com/questions/131218/do-any-of-the-characters-from-gta-san-andreas-make-an-appearance-in-gta-5)
Answer: Rockstar has addressed this before. Check the Other Characters section of this GTA III Q&A.

El Burro is referenced as he was also referenced in GTA 1, so it felt appropriate that he should cross "universes" – the "universes" are the worlds interpreted at different definitions, 2d, 3d and high definition, so we felt brands and radio / back ground characters would exist in both, but 3 dimensional characters would not. This is the logic (as far as it could be considered logical) behind it – so no, we don't believe any GTA3 characters could exist in the GTA4 universe.

As the quote says, the GTA series has been rebooted twice.
2D Universe: GTA/GTA London (1969/1961)/GTA 2
3D Universe: GTA III/Vice City/San Andreas/Advance/Liberty City Stories/Vice City Stories
HD Universe: GTA IV/Episodes from Liberty City/Chinatown Wars/GTA V/Online
Zero is a 3D Universe character, and Lester is an HD Universe character. They don't exist in each other's universes, so they're not the same person.
Answer: I don't think you're going to find any sources that say "Person A is not Person B".  It kind of goes without saying.  It sounds like they are just using a similar character archetype.
Comment: thanks @bwarner. I was also asking if "Person A is Person B" But I suppose you're way means the same, in some cases.
Comment: @SiIverTongue: since bwarner posted that answer, they will be notified of any and all comment replies, and the @ reply was unnecessary. More info [here](http://meta.stackexchange.com/a/43020). Welcome to Stack Exchange!
Answer: Lester is not Zero and vice versa. Proof: Lester had and has physical disabilities since he was born when Zero did not have any.
Answer: I think it's possible, even if they're in different, "universes." I think at least it should be noticed that they're into the same things, both like anonymity, similar voices, both wear glasses, same race and hair color.
Being that San Andreas is set in the 90s and GTA V set in more modern times, Lester could be an older Zero.
Rockstar says that brands and background characters share universes, such as Lazlow who is a radio personality we hear on in III-San Andreas. We finally meet him in person in GTA V. The thing that should be defined is what exactly counts as a, "background," character in the instance of Rockstar's explanation. I think there is a possibility that Lester and Zero are one and the same, even with comments from Rockstar possibly saying otherwise.
Answer: I definitely believe Lester is actually Zero for many reasons, starting with that they are both exactly similar. GTA SA was set in the 80s and features a young Zero (who doesnt actually have a real name) whereas Lester in GTA 5 (set in today) features a character which would suit the age. Lester could also have changed his name for security reasons, especially as Zero aids and talks you through your first big heist in GTA SA, EXTREMELY similar to Lester... Too similar
Comment: SA was actually set in 1992.
Comment: Those points are exactly why I asked :p it just seems too obvious' but since Rockstar has yet to announce that this is the case, for sure we can never know.


How long should chicken wait in eggs before applying bread crumbs?

Question: To get the bread crumbs to stick to the chicken, I coat the chicken with eggs. I then put the bowl in the refrigerator. How long should I wait before taking the chicken out of the eggs and rubbing the bread crumbs on them?
Comment: Chickens wait in eggs 21 days.
Comment: Why do you think you need to wait?
Comment: @TFD there is also spices in the mix.
Comment: And...you need to wait because? The recipe says so,  or you are trying to pre-prepare for a big event, or ...?
Comment: @TFD for the spices and egg to get absorbed by the chicken was my thinking.
Comment: @Sobachatina You'll have a devil of a time applying bread crumbs to them after that long though..
Answer: Spices or egg do not get absorbed into chicken, or any other protein in any significant manner given any safe amount of time
Some amount of sodium from a brine will get absorbed, but this is generally for different reasons, and is not a requirement for crumbed chicken
The easiest and safest method is to dredge in flour, dip in egg, dredge in crumbs, and cook (deep fry, pan fry, oven etc) all in one sequence of steps
The flour sticks to chicken well, and become a glue to hold the egg when it gets wet and hot during cooking. Egg alone will not stick well to chicken, see this post. The egg will stick to the flour well, and bread crumbs or Panko will stick to egg well see this post
For food safety reasons prepared foods should not be sitting around for too many hours. The normal process is to prepare and then cook. Also you should not save flour of crumbs for another day see this post
In my experience; it is best to allow the chicken to warm up a bit after being removed from the fridge, e.g. rest on bench 30 minutes before you plan to cook. Make sure the chicken is not wet, damp is OK. Line up your flour, egg, and crumb mixtures a short distance away from your cooking device of choice (for speed, simplicity, and safety). And in one continuous process; flour dredge, egg dip, crumb dredge, and then cook
Any waiting will generally cause coating failures. You do not need to be fast, but you don't want to have it sitting around. You fingers and kitchen will be messy, so no point stopping, get it all done in one go
Comment: @Noldor130884 You dredge in flour primarily to remove any surface moisture, so that the egg sticks better.
Comment: why the flour before the egg?
Comment: The procedure described by TFD is the correct one. If you really want to "marinate" the chicken, you should apply only the spices some hours before.
When ready to cook, apply flour-egg-breadcrumb and fry.
Comment: personally, I found that while egg sticks better after dredging in flour, the crust is more likely to fall off during cooking afterwards, so I usually skip this step. Not as thick crumb crust, but stays on the meat more firmly.
Answer: As I always see my mother, she just coat it with egg then apply breadcrumbs and directly place it in the hot frying oil. Waiting is just for spicing or seasoning to allow the meat catching spices flavors.


How do I coat popcorn with flavor?

Question: There are commercial flavored popcorn (i.e. BetterMade) that aren't topped with flavor but coated like a potato chip.  How do I re-create that coating at home?  Specifically, I'm a fan or the 'hot' style coating (bbq, buffalo chicken, jalapeno, flame).  I've tried oils, tossing in a bowl, spraying from a bottle, but no luck  - it's just regular popcorn with a little chili powder sticking to each kernel.
Comment: Similar: http://cooking.stackexchange.com/questions/5772/how-to-make-movie-theatre-like-popcorn
Answer: How you are popping your corn makes a difference.
Air popped corn with flavoring added afterwards may be healthier but it is difficult to make flavorings adhere.
Using an agitated oil popper and putting the flavoring infused in the oil will make the difference. The flavors will be part of the kernel and not just stuck to the outside.
Lately I've seen several table top, agitated oil poppers at places like costco for reasonable prices.
Answer: Anyone ever try just popping with your regular oil, but 50/50 mixed with India Mustard oil,
and then before dumping the popcorn into the oil, add 1 tsp of Turmeric powder, and 1 tsp of
Reshampatti chilly powder ( hot India ground chilli ) in with the popping corn ?
When it pops, you get a hot curry taste, and an atomic yellow colored corn.
Salt with unflavored regular popcorn salt, or, powdered India "Black Salt" for an unusual taste sensation.
Dave
Comment: That sounds delicious Dave. Welcome to Seasoned Advice.
Answer: A method I like to use is to pop the corn in a large steel frying pan, and adding the seasonings into the oil right before the kernels begin to pop. My frying pan ratio is 1TB olive oil per 1/4 cup of popcorn, and also up to 1tsp of seasonings into that, sometimes a tad more onto the popcorn after it has been popped. Use a lighter olive oil if you want less of that bold flavor, but olive oil is definitely nice because a) of the flavor and b) it can nicely withstand heat and thereby pops the corn quickly.
The basic process here starts with getting the pan hot, then adding oil, then kernels, and lastly the seasoning. The flavoring is trickier because you don't want it in the oil for too long because it can take on too dark of a charred flavor if you add it too soon. Some seasonings suffer more from being in the oil too long (like garlic), and some don't work well with this method at all (like the Nacho Cheese). If you can have your flavoring at the ready, wait until the very first kernel pops, and then throw the seasonings on and stir it vigorously into the oil - put the lid back on promptly so you don't loose the popcorn as the kernels pop.
Because of the flavors you mention, I highly recommend you try the Kernel Seasons Cajun. What's nice about all their flavors is the fine grind helps maximize coating, your primary concern, though it still doesn't all stick. My favorite is to pop with Cajun and sprinkle on some Nacho Cheese afterwards - yum. Another favorite in our house is a homemade powdered rosemary salt.
Answer: I've had great success infusing butter with flavor and then putting it and the popcorn in a plastic tub and shaking it for a few minutes.
Answer: To start, coat the bottom of a medium sized pot with canola oil.
-Cover the pot and pop the corn on medium heat
-Add ~4 tablespoons of soy sauce (I drizzle it over the popcorn in a big bowl, trying to get as many pieces as possible, but you do not want to drench it!)
-Take a handful of baker's yeast and sprinkle it over the soy sauced popcorn
et voila!
Answer: A search for "popcorn coating" at the patent office turned up several possibilities. This one (# 4,767,635 - 1988) seems like it might be adaptable to home use:

A free-flowing uniformly flavorant coated unpopped corn and method of preparation thereof wherein the unpopped corn is essentially oil and fat-free and retains a substantial amount of added salt and flavorant upon popping in a hot air popper comprising unpopped corn coated with an adherent flavoring consisting essentially of an edible adhesive, e.g. gelatin, an edible salt and optional colorants and flavors.
Answer: I use spray on vegetable oil which is a good and light adhesive, plus add extra taste to flavoring.

How do I coat popcorn with flavor?