What is the difference between lambdas and delegates in the .NET Framework?

Question: I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference.
Comment: By "delegates" do you mean delegate types, or anonymous delegates?  They are also different.
Comment: possible duplicate of [delegate keyword vs. lambda notation](http://stackoverflow.com/questions/299703/delegate-keyword-vs-lambda-notation)
Comment: why people make his question so complicated? Just answer what is a delegate and what is a lambda. Give as much explanation as possible and let him choose whatever is appropriate for him.
Answer: They are actually two very different things. "Delegate" is actually the name for a variable that holds a reference to a method or a lambda, and a lambda is a method without a permanent name.
Lambdas are very much like other methods, except for a couple subtle differences.

A normal method is defined in a "statement" and tied to a permanent name, whereas a lambda is defined "on the fly" in an "expression" and has no permanent name.
Some lambdas can be used with .NET expression trees, whereas methods cannot.

A delegate is defined like this:
delegate Int32 BinaryIntOp(Int32 x, Int32 y);

A variable of type BinaryIntOp can have either a method or a lambda assigned to it, as long as the signature is the same: two Int32 arguments, and an Int32 return.
A lambda might be defined like this:
BinaryIntOp sumOfSquares = (a, b) => a*a + b*b;

Another thing to note is that although the generic Func and Action types are often considered "lambda types", they are just like any other delegates.  The nice thing about them is that they essentially define a name for any type of delegate you might need (up to 4 parameters, though you can certainly add more of your own).  So if you are using a wide variety of delegate types, but none more than once, you can avoid cluttering your code with delegate declarations by using Func and Action.
Here is an illustration of how Func and Action are "not just for lambdas":
Int32 DiffOfSquares(Int32 x, Int32 y)
{
  return x*x - y*y;
}

Func<Int32, Int32, Int32> funcPtr = DiffOfSquares;

Another useful thing to know is that delegate types (not methods themselves) with the same signature but different names will not be implicitly casted to each other.  This includes the Func and Action delegates.  However if the signature is identical, you can explicitly cast between them.
Going the extra mile....  In C# functions are flexible, with the use of lambdas and delegates.  But C# does not have "first-class functions".  You can use a function's name assigned to a delegate variable to essentially create an object representing that function.  But it's really a compiler trick.  If you start a statement by writing the function name followed by a dot (i.e. try to do member access on the function itself) you'll find there are no members there to reference.  Not even the ones from Object.  This prevents the programmer from doing useful (and potentially dangerous of course) things such as adding extension methods that can be called on any function.  The best you can do is extend the Delegate class itself, which is surely also useful, but not quite as much.
Update: Also see Karg's answer illustrating the difference between anonymous delegates vs. methods & lambdas.
Update 2: James Hart makes an important, though very technical, note that lambdas and delegates are not .NET entities (i.e. the CLR has no concept of a delegate or lambda), but rather they are framework and language constructs.
Comment: You're right.  I had the sentence structured different during writing ("C# functions are not actually first-class objects") and forgot to change that.  Thanks!
Comment: Good explanation. Although I think you mean "first-class functions", not "first-class objects". :)
Comment: *A normal method is defined in a "statement"* A statement is an action in the sequence of an imperative program, possibly based on an expression. Isn't a method-definition a different grammatical structure? Method-definition isn't listed in https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/statements
Comment: Actually, it is stated in Microsofts documentation that lambdas are delegates.

`Again, lambdas are just delegates, which means that they can be used as an event handler without any problems, as the following code snippet illustrates.`

- https://learn.microsoft.com/en-us/dotnet/standard/delegates-lambdas
Answer: The question is a little ambiguous, which explains the wide disparity in answers you're getting.
You actually asked what the difference is between lambdas and delegates in the .NET framework; that might be one of a number of things. Are you asking:

What is the difference between lambda expressions and anonymous delegates in the C# (or VB.NET) language?
What is the difference between System.Linq.Expressions.LambdaExpression objects and System.Delegate objects in .NET 3.5?
Or something somewhere between or around those extremes?

Some people seem to be trying to give you the answer to the question 'what is the difference between C# Lambda expressions and .NET System.Delegate?', which doesn't make a whole lot of sense.
The .NET framework does not in itself understand the concepts of anonymous delegates, lambda expressions, or closures - those are all things defined by language specifications. Think about how the C# compiler translates the definition of an anonymous method into a method on a generated class with member variables to hold closure state; to .NET, there's nothing anonymous about the delegate; it's just anonymous to the C# programmer writing it. That's equally true of a lambda expression assigned to a delegate type.
What .NET DOES understand is the idea of a delegate - a type that describes a method signature, instances of which represent either bound calls to specific methods on specific objects, or unbound calls to a particular method on a particular type that can be invoked against any object of that type, where said method adheres to the said signature. Such types all inherit from System.Delegate.
.NET 3.5 also introduces the System.Linq.Expressions namespace, which contains classes for describing code expressions - and which can also therefore represent bound or unbound calls to methods on particular types or objects. LambdaExpression instances can then be compiled into actual delegates (whereby a dynamic method based on the structure of the expression is codegenned, and a delegate pointer to it is returned).
In C# you can produce instances of System.Expressions.Expression types by assigning a lambda expression to a variable of said type, which will produce the appropriate code to construct the expression at runtime.
Of course, if you were asking what the difference is between lambda expressions and anonymous methods in C#, after all, then all this is pretty much irelevant, and in that case the primary difference is brevity, which leans towards anonymous delegates when you don't care about parameters and don't plan on returning a value, and towards lambdas when you want type inferenced parameters and return types.
And lambda expressions support expression generation.
Comment: Great info!  You inspired me to fire up reflector and look at the IL.  I didn't know lambdas resulted in generated classes, but it makes perfect sense now that I think about it.
Answer: One difference is that an anonymous delegate can omit parameters while a lambda must match the exact signature. Given:
public delegate string TestDelegate(int i);

public void Test(TestDelegate d)
{}

you can call it in the following four ways (note that the second line has an anonymous delegate that does not have any parameters):
Test(delegate(int i) { return String.Empty; });
Test(delegate { return String.Empty; });
Test(i => String.Empty);
Test(D);

private string D(int i)
{
    return String.Empty;
}

You cannot pass in a lambda expression that has no parameters or a method that has no parameters. These are not allowed:
Test(() => String.Empty); //Not allowed, lambda must match signature
Test(D2); //Not allowed, method must match signature

private string D2()
{
    return String.Empty;
}

Answer: Delegates are equivalent to function pointers/method pointers/callbacks (take your pick), and lambdas are pretty much simplified anonymous functions.  At least that's what I tell people.
Comment: Exactly! There is no "difference". They are two inherently different things.
Answer: A delegate is a function signature; something like
delegate string MyDelegate(int param1);

The delegate does not implement a body.
The lambda is a function call that matches the signature of the delegate. For the above delegate, you might use any of;
(int i) => i.ToString();
(int i) => "ignored i";
(int i) => "Step " + i.ToString() + " of 10";

The Delegate type is badly named, though; creating an object of type Delegate actually creates a variable which can hold functions -- be they lambdas, static methods, or class methods.
Comment: When you create a variable of type MyDelegate, that isn't really it's runtime type.  The runtime type is Delegate.  There's compiler tricks involved in how delegates, lambdas, and expression trees compile, which I think cause the code imply things that aren't true.
Answer: Short version:
A delegate is a type that represents references to methods. C# lambda expression is a syntax to create delegates or expression trees.
Kinda long version:
Delegate is not "the name for a variable" as it's said in the accepted answer.
A delegate is a type (literally a type, if you inspect IL, it's a class) that represents references to methods (learn.microsoft.com).

This type could be initiated to associate its instance with any method with a compatible signature and return type.
namespace System
{
    // define a type
    public delegate TResult Func<in T, out TResult>(T arg);
}

// method with the compatible signature
public static bool IsPositive(int int32)
{
    return int32 > 0;
}

// initiated and associate
Func<int, bool> isPositive = new Func<int, bool>(IsPositive);

C# 2.0 introduced a syntactic sugar, anonymous method, enabling methods to be defined inline.
Func<int, bool> isPositive = delegate(int int32)
{
    return int32 > 0;
};

In C# 3.0+, the above anonymous method's inline definition can be further simplified with lambda expression
Func<int, bool> isPositive = (int int32) =>
{
    return int32 > 0;
};

C# lambda expression is a syntax to create delegates or expression trees. I believe expression trees are not the topic of this question (Jamie King about expression trees).
More could be found here.
Answer: I don't have a ton of experience with this, but the way I would describe it is that a delegate is a wrapper around any function, whereas a lambda expression is itself an anonymous function.
Answer: A delegate is always just basically a function pointer.  A lambda can turn into a delegate, but it can also turn into a LINQ expression tree.  For instance,
Func<int, int> f = x => x + 1;
Expression<Func<int, int>> exprTree = x => x + 1;

The first line produces a delegate, while the second produces an expression tree.
Comment: That is true, but the *difference* between them is that *they are two completely different concepts*. This is like comparing apples and oranges. See Dan Shield's answer.
Answer: lambdas are simply syntactic sugar on a delegate. The compiler ends up converting lambdas into delegates.
These are the same, I believe:
Delegate delegate = x => "hi!";
Delegate delegate = delegate(object x) { return "hi";};

Comment: neither of these examples compile. Even if you change the name of the instance of `Delegate` from 'delegate', which is a keyword.
Answer: A delegate is a reference to a method with a particular parameter list and return type.  It may or may not include an object.
A lambda-expression is a form of anonymous function.
Answer: A delegate is a Queue of function pointers, invoking a delegate may invoke multiple methods. A lambda is essentially an anonymous method declaration which may be interpreted by the compiler differently, depending on what context it is used as.
You can get a delegate that points to the lambda expression as a method by casting it into a delegate, or if passing it in as a parameter to a method that expects a specific delegate type the compiler will cast it for you. Using it inside of a LINQ statement, the lambda will be translated by the compiler into an expression tree instead of simply a delegate.
The difference really is that a lambda is a terse way to define a method inside of another expression, while a delegate is an actual object type.
Answer: It is pretty clear the question was meant to be "what's the difference between lambdas and anonymous delegates?" Out of all the answers here only one person got it right - the main difference is that lambdas can be used to create expression trees as well as delegates.
You can read more on MSDN: http://msdn.microsoft.com/en-us/library/bb397687.aspx
Answer: Delegates are really just structural typing for functions.  You could do the same thing with nominal typing and implementing an anonymous class that implements an interface or abstract class, but that ends up being a lot of code when only one function is needed.
Lambda comes from the idea of lambda calculus of Alonzo Church in the 1930s.  It is an anonymous way of creating functions. They become especially useful for composing functions
So while some might say lambda is syntactic sugar for delegates, I would says delegates are a bridge for easing people into lambdas in c#.
Answer: Some basic here.
"Delegate" is actually the name for a variable that holds a reference to a method or a lambda
This is a anonymous method -
(string testString) => { Console.WriteLine(testString); };

As anonymous method do not have any name we need a delegate in which we can assign both of these method or expression. For Ex.
delegate void PrintTestString(string testString); // declare a delegate

PrintTestString print = (string testString) => { Console.WriteLine(testString); };
print();

Same with the lambda expression. Usually we need delegate to use them
s => s.Age > someValue && s.Age < someValue    // will return true/false

We can use a func delegate to use this expression.
Func< Student,bool> checkStudentAge = s => s.Age > someValue && s.Age < someValue ;

bool result = checkStudentAge ( Student Object);

Answer: Lambdas are simplified versions of delegates.  They have some of the the properties of a closure like anonymous delegates, but also allow you to use implied typing.  A lambda like this:
something.Sort((x, y) => return x.CompareTo(y));

is a lot more concise than what you can do with a delegate:
something.Sort(sortMethod);
...

private int sortMethod(SomeType one, SomeType two)
{
    one.CompareTo(two)
}

Comment: You mean lambdas are like simplified anonymous methods (not delegate). Like methods (anonymous or not), they can be assigned to a delegate variable.
Answer: Heres an example I put up awhile on my lame blog.  Say you wanted to update a label from a worker thread.  I've got 4 examples of how to update that label from 1 to 50 using delegates, anon delegates and 2 types of lambdas.
 private void button2_Click(object sender, EventArgs e)
     {
         BackgroundWorker worker = new BackgroundWorker();
         worker.DoWork += new DoWorkEventHandler(worker_DoWork);
         worker.RunWorkerAsync();
     }

     private delegate void UpdateProgDelegate(int count);
     private void UpdateText(int count)
     {
         if (this.lblTest.InvokeRequired)
         {
             UpdateProgDelegate updateCallBack = new UpdateProgDelegate(UpdateText);
             this.Invoke(updateCallBack, new object[] { count });
         }
         else
         {
             lblTest.Text = count.ToString();
         }
     }

     void worker_DoWork(object sender, DoWorkEventArgs e)
     {
         /* Old Skool delegate usage.  See above for delegate and method definitions */
         for (int i = 0; i < 50; i++)
         {
             UpdateText(i);
             Thread.Sleep(50);
         }

         // Anonymous Method
         for (int i = 0; i < 50; i++)
         {
             lblTest.Invoke((MethodInvoker)(delegate()
             {
                 lblTest.Text = i.ToString();
             }));
             Thread.Sleep(50);
         }

         /* Lambda using the new Func delegate. This lets us take in an int and
          * return a string.  The last parameter is the return type. so
          * So Func<int, string, double> would take in an int and a string
          * and return a double.  count is our int parameter.*/
         Func<int, string> UpdateProgress = (count) => lblTest.Text = count.ToString();
         for (int i = 0; i < 50; i++)
         {
             lblTest.Invoke(UpdateProgress, i);
             Thread.Sleep(50);
         }

         /* Finally we have a totally inline Lambda using the Action delegate
          * Action is more or less the same as Func but it returns void. We could
          * use it with parameters if we wanted to like this:
          * Action<string> UpdateProgress = (count) => lblT…*/
         for (int i = 0; i < 50; i++)
         {
             lblTest.Invoke((Action)(() => lblTest.Text = i.ToString()));
             Thread.Sleep(50);
         }
     }

Answer: I assume that your question concerns c# and not .NET, because of the ambiguity of your question, as .NET does not get alone - that is, without c# - comprehension of delegates and lambda expressions.
A (normal, in opposition to so called generic delegates, cf later) delegate should be seen as a kind of c++ typedef of a function pointer type, for instance in c++ :
R (*thefunctionpointer) ( T ) ;

typedef's the type thefunctionpointer which is the type of pointers to a function taking an object of type T and returning an object of type R. You would use it like this :
thefunctionpointer = &thefunction ;
R r = (*thefunctionpointer) ( t ) ; // where t is of type T

where thefunction would be a function taking a T and returning an R.
In c# you would go for
delegate R thedelegate( T t ) ; // and yes, here the identifier t is needed

and you would use it like this :
thedelegate thedel = thefunction ;
R r = thedel ( t ) ; // where t is of type T

where thefunction would be a function taking a T and returning an R. This is for delegates, so called normal delegates.
Now, you also have generic delegates in c#, which are delegates that are generic, i.e. that are "templated" so to speak, using thereby a c++ expression. They are defined like this :
public delegate TResult Func<in T, out TResult>(T arg);

And you can used them like this :
Func<double, double> thefunctor = thefunction2; // call it a functor because it is
                                                // really as a functor that you should
                                                // "see" it
double y = thefunctor(2.0);

where thefunction2 is a function taking as argument and returning a double.
Now imagine that instead of thefunction2 I would like to use a "function" that is nowhere defined for now, by a statement, and that I will never use later. Then c# allows us to use the expression of this function. By expression I mean the "mathematical" (or functional, to stick to programs) expression of it, for instance : to a double x I will associate the double x*x. In maths you write this using the "\mapsto" latex symbol. In c# the functional notation has been borrowed : =>. For instance :
Func<double, double> thefunctor = ( (double x) => x * x ); // outer brackets are not
                                                           // mandatory

(double x) => x * x is an expression. It is not a type, whereas delegates (generic or not) are.
Morality ? At end, what is a delegate (resp. generic delegate), if not a function pointer type (resp. wrapped+smart+generic function pointer type), huh ? Something else ! See this and that.
Answer: Well, the really oversimplified version is that a lambda is just shorthand for an anonymous function.  A delegate can do a lot more than just anonymous functions: things like events, asynchronous calls, and multiple method chains.
Comment: lambdas can be used as event handlers;

    button.Click += (sender, eventArgs) => { MessageBox.Show("Click"); }

and called asynchronously

    new System.Threading.Thread(() => Console.Write("Executed on a thread")).Start();


How many order triple (a,b,c) are there such that $a.b.c \le 1000$

Question: How many order triple of positive integers (a,b,c) are there such that $a\leq b\leq c$ and $a\cdot b \cdot c \leq 1000$?
I have no idea how to attack this type of problem. Can anyone help. Thanks in advance.
Comment: 1) Zero is not positive, and 2) if zero were allowed, there would be infinitely many solutions.
Comment: What does $a.b.c$ mean? Multiplication?
Comment: @sigmabe Yes it is multiplication.
Answer: In general, the number of positive integer solutions to $abc\le N$ with $a\le b\le c$ can be computed as
$$C(N)=\sum_{a=1}^{\lfloor\sqrt[3]{N}\rfloor}\sum_{b=a}^{\lfloor\sqrt{N/a}\rfloor}(\lfloor N/ab\rfloor-b+1)$$
Alternatively, let
$$T=\lfloor\sqrt[3]N\rfloor,\quad
D=\sum_{n=1}^\sqrt{N}\left\lfloor{N\over n^2}\right\rfloor,
\quad\text{and}\quad
S=\sum_{n=1}^N\sigma(n)\left\lfloor{N\over n}\right\rfloor$$
where $\sigma(n)$ is the number of divisors of $n$. Then
$$C(N)={S+3D+2T\over6}$$
The latter formula is obtained by counting unordered triples.  Basically, $T$ counts the number of triples $(a,a,a)$ with $a^3\le N$, $D$ counts the number of triples $(a,a,c)$ with $a^2c\le N$, and $S$ counts the number of triples $(a,b,c)$ with $abc\le N$: that is, there are $\sigma(n)$ pairs $(a,b)$ such that $ab=n$, and for each such pair there are $\lfloor N/n\rfloor$ possible values of $c$.
To give a very simple example, if $N=4$, then $T=1$, $D=4+1=5$, and
$$S=1\cdot4+2\cdot2+2\cdot1+3\cdot1=4+4+2+3=13,$$
so
$$C(4)={13+3\cdot5+2\cdot1\over6}={13+15+2\over6}=5,$$ which agrees with the explicit list of ordered triples $(1,1,1),(1,1,2),(1,1,3),(1,1,4)$, and $(1,2,2)$.  For a number like $N=1000$, however, the first, nested-sum formula is probably easier to compute, since there are only a few hundred terms altogether and you don't have to compute $\sigma(n)$ for a thousand values of $n$.
Answer: You should find conditions to reduce the problem.
Firstly observe $a \leq 10$, because $a^3 \leq a \cdot b \cdot c$.
Another condition to reduce the problem is $b \leq \sqrt{1000} \approx 32$, in fact you have the stronger condition $b \leq \sqrt{1000/a}$.
Perhaps this gives you a manageable number of cases of possible pairs $(a,b)$. For each pair you have to find the number of integers on the interval $[b,1000/ab]$, and take the sum.
Comment: Small correction - the interval should be closed, since the inequalities are not strict. Not sure who downvoted you though, your solution is correct.
Comment: Corrected, thank you.
Answer: These are the maximum triplet for each possibility of $a$ (the first)
$1\times 31\times 32,\;2\times 22\times 22,\;3\times 18\times 18,\;4\times 15\times 16,\;5\times 14\times 14,\;6\times 12\times 13,\;7\times 11\times 12,\;8\times 11\times 11,\;9\times 10\times 11,\;10\times 10\times 10$
and then the number of combinations allowed for each of the previous cases
$3550+1106+505+263+146+76+38+17+6+1=5\,708$
For instance if $a=1$ then you can have $1\times 1\times 1, 1 \times 1\times 2\ldots$ up to $1\times 1\times 1000$ plus $1 \times 2 \times 2, 1\times 2 \times 3\ldots$ up to $1\times 2\times 500$ and so on
It's not that easy. I applied brute force with Mathematica function
<code>pp = FindInstance[a b c <= 1000 && 0 < a <= b <= c, {a, b, c},
  Integers, 10000]
</code>
Hope this helps
Answer: It might help if you think about a slightly simpler problem - how many pairs of positive integers $b,c$ satisfy $bc \le n$ for $b \le c$ and $n$ being some other positive integer. You should be able to express this as a sum - find the number of possible values of $c$ for a given $b$, then sum over all possible values of $b$. Note that $b^{2} \le bc \le n$.
Then you just go the next step up - sum this over all possible values of $a$, with $n = 1000/a$. $a$ can only take one of a few values, which you can again find since $a^{3} \le abc \le 1000$. You should get a nested sum, which I believe you'd then just have to compute (but it might simplify).


Are there any languages with the equivalent of "both" for three items?

Question: Referring to this question it seems that English does not have the equivalent of "both" for three items. Although it would seem to be a useful word, I am unaware of its existence in any languages. Is there any language that has such a word?
Comment: _Both_ is just a suppletive term for _*all two._ Duals have irregular forms like suppletives more often than plurals, but less often than singulars.
Comment: But there is also a category of *trial* in some languages ...
Comment: Yes, but it doesn't usually mean _three_; it's more a small group vs an unlimited plural. Usually it's called "paucal". And it's normally an inflection, not a suppletive quantifier.
Comment: Hmm.  On the other hand, if there aren't languages with a paucal quantifier (meaning roughly "each member of this small group") then that's an interesting gap.
Answer: American Sign Language has this.
Valli, Clayton & Lucas, Ceil. 1995. Linguistics of American Sign Language: An Introduction. 2nd ed. Washington, DC: Gallaudet University Press. page 101
Comment: Very interesting - but I can't find the reference in the book you pointed to?
Comment: Top paragraph: "... referring to more than one person could also be signed using a number handshape, so that the pronoun could be glossed as TWO-OF-THEM,  or THREE-OF-THEM, or ..." Or you could try here: http://belindavicars.com/grammar/numerical_pronouns.htm
Answer: It appears that Hindi has a generic form that accommodates any number at all.

Number Hindi word  Adj
2      do          donõ
3      teen        teenõ
4      chaar       chaarõ

However, as the numbers get bigger, it appears§ to be more idiomatic to switch to a form that's similar to English.
tum chaarõ ladke mere saath aaoo.
All four of you boys come with me.
tum saare chalis ladke mere saath aaoo.
All forty of you boys come with me.
§ — I speak the language fluently, but I'm not a native speaker.
Comment: Are you sure it is nasal? Just asking, I am a native speaker, but never actually studied the language, so I am not sure. (Also, I know using the letter 'd' for the retroflex 'r' is a common convention, but it still confuses me.)
Comment: @QuintusCaesius In writing, I have seen both तीनो / तीनों, both चरो / चरों, etc. Even dictionaries use both forms like here: https://www.collinsdictionary.com/dictionary/hindi-english/%E0%A4%9A%E0%A4%BE%E0%A4%B0%E0%A5%8B%E0%A4%82-%E0%A4%93%E0%A4%B0.
Comment: oh, because normally I don't nasalise that specific suffix when speaking.
Answer: Thai ทั้ง [tʰáŋ] is often used for this purpose.
Also, กัน [gan] (one another), e.g. ต่อกัน [tò-gan] (mutually).
I guess, most (if not all) isolating languages would have such a word, and most likely it would be the same as "together", "also", or "one another".
Also, Hebrew has dual and triple inflection forms for certain nouns.
Comment: `ทั้ง` is used for exactly three items? Or for "two or more" items?
Comment: No, Hebrew does not have a triple inflection form. The example given on the page that you link to shows that the triple form is the regular plural form, in contrast to the dual form which is unique.
Comment: "Two or more". To specify a certain number of objects, they say `ทั้งสอง` (all-two), `ทั้งสาม` (all-three), and so on - but almost never in colloquial speak.
Comment: Ah so it's pretty much the same as in English then, rather than a special "trial" word akin to "both". )-:
Comment: As for Hebrew, "both" is just "two of" (שני\שתי), and for three items you just say "three of" (שלושת\שלוש).
Answer: When I was studying Generalized Quantifier Theory as part of a Formal Semantics class a few years ago in college, this came up. If I recall correctly, the professor said that there weren't any languages which had a quantifier that had an identical meaning to both, but for the number 3. I don't think there was any real backing up of that assertion.
Certainly there are no major languages that I know of that have this property.
Answer: Yes. In Georgian (ქართული) language the word "both" is derived from the word "two" and you can do the same for all numbers, as well as for three.
Answer: In Pashto, درې واړه [ˈd̪reˑ.wɑ̟̈ɳə] exactly means 'both for three items'. (It can be used for both humans and inanimate objects.)
Answer: The common form in Spanish is los dos.  (Ambos is a bit formal.)
You can just as easily say los tres.
And there are many sayings, songs, soap operas and even hotel names with felices los quatro.
Comment: @OmarL Looks can be deceiving.  The English phrase *the two* is not and cannot be used in the way that *los dos* most commonly is.
Comment: Looks like a parallel to the English phrasing "the two", not "both".
Comment: As the first comment under the question states, the most equivalent English phrase is *all two*.


Where can I find the right combination for these pillars in Shroud Hearth Barrow?

Question: I'm in Shroud Heart Barrow and encountered the infamous pillars, but I have no idea where the solution is to be found.

Any suggestions on how to continue?
Answer: Take a look at this video from youtube: Shroud Hearth Barrow. The interesting part starts around 6:00. The door from the screenshot seems unlocked, and in the room behind that door is the answer. The right combination from left to right is: "Whale, Hawk, Snake, Whale". This will lower the bridge.
Comment: I did the same thing as the asker: I assumed the door was locked and didn't bother trying to open it.
Answer: Go through door at the top of ramp. Kill that guy. Stand on activation trigger. All the stones will start to rotate. Keep stepping on the activator until all symbols can be seen. Only one symbol can be seen at a time.
Answer: If there is a body on top of the trigger which drops the bridge, the bridge won't drop.  Try using shout to move any bodies off of the trigger if the bridge won't drop even with the correct combination.
Answer: Dolphin, Eagle, Snake, and Dolphin.
You can find the clue when you enter that door in front of you in the screenshot. Just step on the circular platform and the cover to each door will be revealed.
You can find more details in this video.
Comment: That's a 20 minute video.  If you're going to link to Youtube, at least link to the relevant part of the video.
Comment: @fbueckert That still doesn't make the answer not useful. This answer also explains a lot more than the other ones
Answer: There's a trick to this room. There's a chain on the bottom level of the room, it opens a useless portcullis into a room on the stream. That portcullis has to be Closed before the bridge will come down!
Answer:
Whale Hawk Snake Whale

That is the correct combination. Also, beyond the door, watch out because it's like lair of Draurgs and Skeletons. The big guy is the last one at the top.
Answer: The correct combination is "fish bird snake fish", going from left to right.
Comment: This answer doesn't contribute anything new.


Hiding during render doesn't seem to be working

Question: Just did my first animation, so I may have done something wrong. Have a character with cartoon eyes, non-spherical, so I went with 3 eyelid covers anchored to the head bone and mirrored to do a step animation of a blink with the camera 'disable in render' on the lids. Worked fine in the stationary test but when I moved the character for the body animation the hidden eyelid cover showed on the eye although it didn't do the mirror for the other eye. When it came time to do the blink, the eyelids appeared in mid-air above the origin. Using versions 3.4 and 3.5
Answer: Figured it out. I applied the mirror to the eyelids and the problem went away. Unfortunately, it also screwed up my keyframes, so I have to do the animation all over again.


osgi-karaf-multiple versions of service and camel route

Question: One of the benefits of OSGi is Versioning as explained here. As per the documentation, OSGi can host different versions of "same jar" and let the other applications access them accordingly.
I have been given a task to leverage the same properties of OSGi (I am using Apache-Karaf container) using Camel routes.
I have to deploy multiple versions of a service and have Camel, route to the proper one based on the request. I extensively searched google but I haven't found a suitable example :(
Please throw me any pointers or guide me to an example.
Update
By service, I mean osgi bundle service which is defined like this
  <osgi:service ref="transformService">
        <osgi:interfaces>
            <value>demo.service.TransformService</value>
        </osgi:interfaces>
  </osgi:service>

I have followed the steps provided in this tutorial to create a service called transformService and TransformServiceImpl is the implementation class for this service.
Now let's say I will modify TransformServiceImpl and release it as new version (by updating my version in pom.xml). Also, I will install both the versions, that is,  demo.service-0.1.jar and demo.service-0.2.jar in Karaf (which is OK with Karaf). In this case how can I route to a particular version of service ?
Can I create 2 osgi:reference which points to same service but different versions? Something like this?
 <osgi:reference id="myTransformV0.1" version="0.1" interface="demo.service.TransformService"/>
 <osgi:reference id="myTransformV0.2" version="0.2" interface="demo.service.TransformService"/>

And use them in routes?
 <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
      <from uri="timer://myTimer?fixedRate=true&period=10000"/>
         <choice>
                <when ...> <bean ref="myTransformV0.1" method="transform"/>
                <otherwise> <bean ref="myTransformV0.2" method="transform"/>
         </choice>
      <to uri="log:ExampleRouter"/>
    </route>
  </camelContext>

Comment: Can you put a queue in the middle and push your message to the queue with a property on it stating what version you need to handle it?  Then you could create a subscriber for each version that applied a filter to each message so that they only processed messages for their version?  I am not sure if you are running in Fuse or have a A-MQ easily available
Answer: OSGi versioning is different from the Service versioning. I think the key question is how can you access these camel route with different version.
If your camel route provides RESTful service, it could be easy to provide different version by using different url, such as "/service/v1", "/service/v2". But it is not same with the OSGi versioning, you still need to do some work to fill the gap.
Comment: Thank you @WillemJiang for your response. What I meant by services is osgi bundle service. I have updated the question. Hope it is clear now.
Comment: I'm not sure if osgi:reference support version, but if you are using blueprint, you can define a filter which specify the version  that the service could expose.
Comment: Thanks again :) .. osgi:reference does not support version, I put that just for the sake of question. I will explore blueprint..


Can the spell Create Undead be used on the remains of a Skeleton that was itself created with the spell Animate Dead, or vice versa?

Question: The rules for the spell Animate Dead specify that "A destroyed skeleton or zombie [animated with that spell] can't be animated again [presumably via that spell]". The rules for the spell Create Undead merely specify needing a dead body. Could one kill a humanoid, cast Animate Dead on its remains to create a Skeleton, then when that Skeleton is slain cast Create Undead to raise a Morgh from the remains of the Skeleton? How about vice versa?
Answer: No.
We'll just put some relevant quotes at the top here, pulled from the respective spells.  From animate dead:

Targets: one or more corpses touched
A skeleton can be created only from a mostly intact corpse or skeleton.
A destroyed skeleton or zombie can't be animated again.

And from create undead:

Target: one corpse

Animate dead clearly states that you need an intact corpse and that you can't reanimate a destroyed skeleton or zombie- that's presumably because, when you destroy a skeleton or zombie, you no longer have an intact corpse to work with.  It's also possible this is due to negative energy limitations on corpses, or any number of flavorful causes- the end result is the same.  Once your undead creature is destroyed, you are left with a pile of bone and/or flesh that can't be animated again with animate dead.
Create undead specifically cites animate dead and has the same target- it is reasonable to conclude that the target, like animate dead, must be intact, though it isn't explicitly stated.  Regardless, so long as create undead operates as a more powerful version of animate dead, it operates by the same constraints unless otherwise noted.  You could try arguing that without the explicit "no destroyed undead can be used to make more undead" line in the spell, you should be able to pull it off- but I doubt you'll get far with that argument.
You can be stopped even faster by the specialized requirements of some of the undead in create undead, as they specifically state they require a humanoid corpse... and destroyed skeletons would, at best, be an undead corpse.
Comment: I like the logic of a destroyed skeleton/zombie being an "undead corpse." +1.


multiple preinstalled programs with similar jobs

Question: I have unity, gnome-shell and xubuntu on my laptop. They all have their favorite preinstalled programs it seems. Do I really need three text editors for example? Could I remove two and just have the other desktops use the one I keep? It seems as though I could get rid of all video playback programs as well and just use vlc for example. Am I going to mess something up? I am new to all this.
Comment: I'm in a similar position :) I'm not aggressively removing stuff because I get the impression that different DEs have different "default" favorites, be they browsers, text editors, etc. I'm using the days remaining to see which DE I'm most comfortable with and then, when 12.10 is ready, I'm going to have just that one as a clean install.
Answer: I would be careful with removing seemingly superfluous programs. Other packages, even unrelated ones coming with the DE might depend on them. On LXDE for instance you can't remove lxterminal (≙ gnome-terminal) or leafpad (≙ gedit) without deleting essential packages such as lxrandr, lxinput and other ones.
Save for these dependency issues there is no reason why you shouldn't be able to remove  duplicate applications. Just make sure that you can configure the DE to use a replacement of your choice, e.g. gnome-calculator instead of galculator.
If it's not the wasted disk space that bothers you, but clutter in the respective DEs menus, you can always add the OnlyShowIn= parameter to the application launchers in question. See here for a tutorial on Kubuntu entries.


Consistency of ReLU gradient

Question: In Goodfellow et al.'s Deep Learning, the authors write, "rectified linear units use the activation function $g(z) = \max\{0,z\}$... The gradients are not only large but consistent" (187). What does it mean for a gradient to be consistent? I always understood consistency to mean that for an estimator of a parameter, the estimator converges in probability to the true parameter value as the number of data points goes to infinity. How does this definition relate to the gradient? Does this mean that if you use SGD, the stochastic gradient converges to the true gradient as the number of data points goes to infinity, and if so, isn't this a general property of SGD rather than of ReLU?
Answer: The word "consistent" here doesn't have the technical meaning of the consistency of a statistical estimator. My read is that "consistent" has plan English meaning.
When $x$ is positive, the gradient for $\text{ReLU}(x)$ is 1, otherwise it's 0. In other words, I think he means that the gradient is either 0 or 1, and not any other value.  This interpretation seems likely given the complete context of the passage:

These [ReLU] units are easy to optimize because they are so similar to linear units. The only difference between a linear unit and a rectified linear unit is that a rectified linear unit outputs zero across half its domain. This makes the derivatives through a rectified linear unit remain large whenever the unit is active. The gradients are not only large but also consistent. The second derivative of the rectifying operation is 0 almost everywhere, and the derivative of the rectifying operation is 1 everywhere that the unit is active.

We can compare this to something like $\tanh(x)$, which has a gradient that varies in $x$, so in that sense the $\tanh$ gradient is not "consistent," but always changing.
Answer: He's referring to how ReLU isn't bounded from above, which allows the training process to handle all (positive) activation of a neuron according to how activated it is, as opposed to tanh for example which provides 0 gradient when "saturated" by large values.  ReLU is good for convolutional neural networks for example because the process looks for the presence of features as it scans across an image, which manifests as large outputs of the matrix convolution operation.  If we used a bounded activation function, we'd be discarding all the information that tells us how "large" of a presence some feature had vs another arbitrary presence.

Consistency of ReLU gradient


what is the default working directory for adb push/pull and how do I change it?

Question: I pulled out a file from the android sdcard using adb and it seems it goes to c:\documents and settings\userName by default. I don't know how it got set to this folder since this is not where adb is installed, but probably has got something to do with the fact that both the workspace and .android folders are located here. How do I change this default location for pull command of adb?
Answer: The default directory for adb pull or adb push seems to be the current directory (aka . ).
If you issue a command such as the following, not specifying the target directory
adb pull /boot.txt

the file (provided it exists) will be copied to the current directory.
Windows users:
Take notice of the following: If you are using Windows (Vista or newer), chances are that if the current directory requires elevated privileges to write on, Windows will silently replicate the directory structure of your current directory in a special folder called VirtualStore and will copy your files in it.
The full path for VirtualStore is: %LOCALAPPDATA%\VirtualStore, which most likely will translate into C:\Users\<account_name>\AppData\Local\VirtualStore.
So, in the following scenario,
C:\> cd "C:\Program Files (x86)\MyCustomADBInstallLocation"
C:\Program Files (x86)\MyCustomADBInstallLocation> adb pull /boot.txt

your file boot.txt will end up in this folder
C:\Users\<account_name>\AppData\Local\VirtualStore\Program Files (x86)\MyCustomADBInstallLocation\

Comment: thanks. v interesting. My stuff ended up in C:\Users\\[user]\AppData\Local\VirtualStore\Program Files (x86)\Android\android-sdk\platform-tools\
Comment: And how to change this current directory?
Answer: you can mention the destination location for adb push/pull, see example:-

adb push a.txt /data/local
adb pull /data/local/a.txt .

. means present directory.
or

adb pull /data/local/a.txt C:\

Hope this helps.
Comment: `adb pull /data/local/a.txt C:\ ` doesn't work. Pull works only to default directory
Comment: what is the error you are getting when you specify local dir? There is nothing like pull works only to default directory. From adb help- `adb pull [-a] ... `. See example-  `C:\>adb pull /sdcard/b C:\work\
[100%] /sdcard/b`
Comment: Yep, just tried it and it worked. However, not for root directory (`C:\ ` or `D:\ `), only if I specify 2nd-level+ dir. You should edit your answer accrodingly.
Answer: i'm using linux, and noticed that if i opened the terminal as root, its opened @ home. when i pull items, it dumps to that repository, meaning to my "home" directory. will try opening terminal in a different folder and running adb pull from there to see if that makes the files dump to the folder terminal is opened in.
Comment: what was the result after your experiment?


How are flying drones and unmanned vehicled used for exploring volcanoes?

Question: And what kind of vehicles and drones are used or are planned for now and for near future?
Comment: The question suggests there is a certain type, or certain criteria. I doubt that there are. The drone market is wide, young, and constantly changing, so anything that will do the job... For the same reason, saying anything about the near future is pure guesswork.
Answer: Here's a partial answer:
The Trail by Fire expedition 1.5 -- "We're a team of young volcanologists planning to measure the entire flux of gases emitted by volcanoes along the Nazca subduction zone." -- driving through South America has "a fleet of quadcopters with gas sensing and sampling capabilities, establishing a remote presence in the volcanic plumes we encounter along the Trail by Fire."
On their sponsors page they list the science payload for each of three Matrix quadcopters (more details about the mechanisms and some custom kit are on the page), which are used because of the difficulty and hazard of climbing to the vents along the mountain chain and sampling the plumes:

An Ocean Optics Flame UV-DOAS spectrometer for SO2 measurements
A multigas sensor built by INGV (Italy)
A gas collector to bring plume gas to the Delta Ray Spectrometer

There's also a bit of drone footage included in the videos on their blog page.
Note that their goal is specifically to understand the gases: "Our objective is to provide the first accurate and large-scale estimate of the flux of volatile species (H2O, H2, CO2, CO, SO2, H2S, HCl, HF, and more) emitted by volcanoes of the Nazca subduction zone."
(Disclaimer: I only know about this because one of the researchers worked for my institution during last year's initial expedition. A review of the literature may show more published uses of drones and UAVs beyond simply shooting video.)


Are Shimano saint pedals suitable for trail / xc use?

Question: Thinking of buying the Whyte t129s, but not sure what flat pedals would be most suited for the xc / trail riding I'll be using it for. I looked at Nukeproof Neutrons and DMR V8s - prefer the look of the Saints, but worried they might be more DH/FR-focused and heavy on the climbs.
Comment: The saints are 500g and a most of the super light clipless ones on weight weenies are ~120g. For 380g, it's not worth worrying about. Your body weight fluctuates by more than this. (Says the man who just bought a carbon seatpost).
Comment: @alex: But (hopefully) your body weight is not going round and round :)......
Answer: In the shortest way of answering this, yes, they will be suitable for trail/xc use.
All flat pedals are relatively the same. They only differ in the amount of pins, contact area, weight and their thickness.
You'll want something on the thin side for trail use, as you'll be pedaling quite a bit more than if you were on a downhill bike. This will help to reduce the amount of pedal strikes.
The weight is probably the biggest difference between all of the flat pedals. It is totally up to you as to what you find acceptable. For everyday trail use, the Saints should be fine and they should last quite a long while.
Answer: I think he is worried about the bearings being stickier than a trail specific pedal would be.
if he wants buttery smoothe pedals, downhill pedals are the wrong thing.
If you can handle losing a little energy/power to the bearings of a pedal, then the downhill pedals will be ok.
Comment: yes- that's certainly one concern. Would you recommend anything in particular over the Saints for trail use?
Comment: I can't recommend anything since I run clip pedals on my mtb.
The best would be to go to a shop that has extensive pedal selection (or at least two different style of platform pedal, such as DH and a regular flat pedal) feel how east/difficult it would be to turn the pedal.


How can Tanjiro become a Hashira in Demon slayer?

Question: How can a demon slayer become a hashira? What are the requirements? Is there any exam conducted to become hashira? No one has defeated 12th upper demon before, so I believe that is not the condition.
Comment: Slight correction, it is untrue to say none of the 12 demon moons have been felled before, quite a few of them have fallen over time, mostly assorted members of the Lower Ranks (ranks 7-12) but at least one of the Upper Ranks has also fallen. It was noted that it has been over 100 years since the last time an Upper Rank was killed but numerous members of the Lower Ranks have been killed by Hashira over time
Answer: You are not needed to kill a upper demon to become a Hashira if you can fulfill the other condition.

To be a member of the Hashira, a Demon Slayer must be among the strongest combatants in the entirety of the Demon Slayer Corps. There are two known methods (both extremely difficult) that allow one to prove that they are worthy of becoming a Hashira: the first method is to accumulate a demon kill count of at least 50 as a Kinoe-ranked Demon Slayer, or slay a member of the Twelve Kizuki. The second method is being a Tsuguko of a Hashira, which requires immense talent.
https://kimetsu-no-yaiba.fandom.com/wiki/Hashira
Comment: tanjiro defeated upper moon will he become hashira?
Comment: @SayedMohdAli that would be Manga spoilers. Anyways, he didn't defeated UMDs alone as he had help from fellow Hashiras.


From what guitar tuning downwards do you stop needing a bass player in a metal context?

Question: With people tuning seven-string guitars do Drop G or using 8 and nine-string guitars and the playing in "genres" like Djent becoming more and more rhythm focused I've been wondering about the bass players job in the band. I've heard Tosin Abbasi say that with his 8-string he already is in the bass register. So I was wondering from what tuning onward (or downward) you're actually making a bass player obsolete.
Comment: Frankly, being a bassist myself, I'd be more inclined towards sacking the guitarist ;) For a fine example, see Royal Blood - https://www.youtube.com/results?search_query=royal+blood Check out the live sets to see they can also do it live.
Comment: Seems like a matter of opinion to me. Do you ever "need" a bass player? Standard bass tuning is an octave below guitar, so another way to look at is that as soon as you have an E an octave below the low E in standard guitar tuning, you have access to all the notes a four string bass in standard tuning can play.
Comment: The Doors didn't need one (live).
Comment: I was assuming that we all agree that a bass player is needed in a metal context. I just wanted to know if that changes when guitar players tune insanely low.
Comment: You always need a bassist. Especially for metal. Bass compliments the guitar and adds other frequencies and harmonics that even make the guitar sound better and more complete
Answer: Normal bass is a full octave below a guitar. So if you're playing drop G on a 7 or 8 string, you're pretty close to the bottom of a standard 4 string bass. A 5 string bass will have a low B. So the simplest answer is that they're already there.
However, that really only accounts for the pitch of the instrument. There are two other things to account for:
First, bass and guitar usually combine to create music across multiple octaves and when the two instruments are too close in pitch, things start to sound a bit muddy. So you want a wide spectrum of pitches as a rule (and variety in your tones and rhythms too). If you are trying to replace the bass with a single guitar, you're going to lose the ability to fill out the band. However you could use a second guitarist in to higher registers, with different tone, and rhythmic variations.
Second, tone is pretty dependent on string thickness and tension. When you add strings to a guitar, they're generally much thinner than bass so that you can still support a reasonable action on your higher strings. Further, when you tune down, you lose tension on the string. These two things combine for a flabby sound that has a hard time achieving punch. So even in scenarios where the guitar is in to bass territory, the bass is often used to add punch and attack to the sound.
So it's more complicated than just the octave you're in. However, people do all sorts of things against the grain successfully, so it's certainly possible, but there are good reasons why there's normally a bass player. Funnily enough, I came across an interesting video of a guitarist playing both the bass and guitar parts just this morning (albeit with a pedal rather than low strings and drop tuning):
Answer: yossarian has mentioned why a bass might be tonally more appropriate than a guitar; I'll add that the string spacing (as well as the thicker, tauter strings) make certain percussive techniques easier on a bass.
Remember too that the standard-tuned bass is seen by many bassists as not going low enough - 5-string basses starting at B0 are common, with extended range bassists going down to F# below that or even C# below that.
There's also the separate question of, regardless of the instrument, the benefits you can get from having an instrument dedicated to playing a monophonic bassline. Two disadvantages of having one of the guitars doing bass duties are 1) the guitarist is probably also busy playing other notes, making him less able to perform the tight phrasing and particularly muting that a good bassline needs, and 2) if the guitar is going through distortion, the distorted mix of strings is liable to lead to a mushy sound with less distinct bass attack.


Success/Failure messages on top or bottom of the screen?

Question: When users upload a new profile picture for example, where should I put the "Picutre successfully updated" message? TikTok does it on top, while Telegram does it on the bottom of the screen. So what's better?
Thank you
Answer: Easiest way, at the top if the picture is automatically uploaded, at the bottom of the page (preferably after the update/save button) if the user has to click on a button to update their profile. For the latter, you'll want to use an appropriate message (e.g. Profile Updated).
The slightly "harder" way would be placing the message below the updated display picture if you upload automatically.
Answer: The action almost always follows the user's clicking a specific button.
The obviously best place to display a message is as close to this button as reasonably possible.
Far too many pages (i.e. at least one) display the result at the top or the bottom of the page, which might not even be within the viewport.
Answer: If you choose to display at the bottom the message needs to slide up from the bottom of the screen.
If you choose to display at the top the message needs to slide down from the top of the screen.
The animation will alert user's eyes immediately.


How to follow a (changing) log file in node.js

Question: OK this might appear to be an easy question but I couldn't find the answer from here so I am posting it in hope someone might have encountered the similar problem.
I need to monitor a symlink which points to a web server file (/var/log/lighttpd/error.log to be more specific, thanks to Linus G Thiel I figured out how to follow symlinks). I know I can set up fs.fileWatch to monitor it but I should also point out that the error.log file also got rotated at a specific time, depending on whatever the log daemon settings are. When that happens, fs.fileWatch stops working. I also know I can spawn a child process and run
tail -F ./symlink_to_error.log

from node to work around the problem caused by log rotation, but I prefer to use native node functions. Anyone can shed some light on this?
[ EDIT ]
Actually monitoring the actual log file works without any problem, even when the log file got rotated. The problem is actually caused by the symlink. The reason I am monitoring the symlink is because the actual log file name gets changed when the size reaches certain limit. /var/log/lighttpd/error.log is just given as an example. I have no control over how the log file is renamed but I do have a crontab that updates the symlink every minute that updates the symlink.
[ EDIT 2/28/2012 ]
Actually I am using the following method (through spawn)
tail -F ./symlink_to_error.log

in a log monitoring project that I am working on as it works quite reliably event though it's not as efficient as watchFile().
Answer: In addition to watching the symlink and/or its target file, watch the directory that contains the target log file and on the "change" event check to see if the log file has rolled to a different name.  If it has then setup a new file watcher on the new log file.
fs.watchFile(logDir, function(curr, prev) {
  if (curr.nlink != prev.nlink) {
    // The number of links in the directory has changed, now
    // see if there is a new log file and start watching it.
  }
});

Comment: Thanks for the answer maerics however it doesn't seem to work. I also tried changing the symlink from soft (should have pointed out in my question) to hard (because in your solution you are comparing number of hard links). I am thinking about 2 plan B's:
1) call fs.readlink on symlink at a scheduled interval, and watch realfile inside  its callback
2) set up a user signal (SIGUSR1 for example) trap in the node process and have the external process that updates the symlink fire that signal when symlink is changed. When node process gets that signal, run fs.readlink again to reflect the change.


Mirror not work correctly for stl imported file

Question: I have a troubleshoot with my blender file. I've upload a stl file in blender and when i apply a mirror modify to X axis i see 2 objects. I tried to change 3d cursor position, but not work.
Answer: By mirroring you don't get two different objects; it's still the same. The point on which your object is mirrored is not the 3D cursor but the origin of the object.

Change the Origin
If you want so set the origin to a specific point, mark the point with the 3D cursor, where you want to set it. Then hit Ctrl-Shift-Ctrl-C and click on Origin to 3D Cursor.

Alternative Way without changing the origin
One property of the Mirror modifier is called Mirror Object. Instead of mirroring the object at its own origin it will use the chosen object's.


how many children do you have a node I selected?

Question: I've been looking but have not located anything,  and I can know how many children have a node I selected?
Greetings and thank you....
Answer: I suppose you are working with a treeStore am I right?
If so, according the doc on NodeInterface you can use the attribute childNodes and use it as an array.
So childNodes.length.
Just a note, be careful if you use lazy loading, the childNodes might be empty if it's not loaded already.
Comment: that's exactly what happens, "Just a note, be careful if you use lazy loading, the childNodes might be empty if it's not loaded already.".

as I can correct it?.

Greetings and thank you....
Answer: If you want to keep the lazyLoading functionality, you need to do an expand before accessing childNodes (as this will cause asynchronous call, you'll need to do your count in the callback of expand method).
Else, you need to disable the lazyLoading by setting the following property in your tree store:
autoLoad: false,
rootVisible: false,
root: {
    expanded: false,
    children: []
// <- Inline root
}

Answer: that's exactly what happens, "Just a note, be careful if you use lazy loading, the childNodes might be empty if it's not loaded already.".
as I can correct it?.
Greetings and thank you....


How do I increase my speed on guitar?

Question: Are there any exercises  or some tips on how to improve speed? If yes then please tell me! I'm already fairly good at guitar. It's just that I'm struggling a bit with the speed of my fingers.
Comment: A recent video I've seen on exactly this topic. There may be some useful tips in there for you. https://www.youtube.com/watch?v=gGUbDU-jocQ
Comment: play excessively slowly, but try to move as fast as possible to the next fingering after playing the previous one. e.g. if `------>` is the time to move your hand/fingers between two positions, then play very slowly but instead of doing `(1) ---------------> (2)` do `(1) -->           (2)`. Guaranteed speed (and cleanliness) improvement in a short span.
Comment: Practicing with a metronome consistently is one of the most effective ways. Start slow, and increase as it becomes far too easy
Answer: Speed isn't about fretting faster.  It's about RELEASING faster.  If you release too slowly, then the muscles on the front and back of your hand fight, and you get that "try-hard tendinitis claw."
Thanks for accepting.  Maybe I can add a couple more points:

the way to know if you're overtrying is to check the back of your hand.  That should be relaxed, all the time.

none of the power should ever come from tightening your wrist.

your fingers should move independently.  Your palm should never feel tight or strained, ever.

the muscles in the web between your fingers is a pretty good tell, too: they should not be doing any of the work

Short version: If you focus on relaxing constantly, you'll find that the fingers move pretty darned fast on their own.
Comment: Do you know if the same principle of focusing on _releasing_ applies to other instruments as well?
Comment: Absolutely.  I don't play many different instruments, but I do play piano, and I can say that practicing a fast Chopin or Liszt passage with any tension at all is likely to lead to a trip to the doctor for Cortisol shots.
Comment: Did you mean *cortisone* shots?
Comment: Yeah I did.  I was in college about a million years ago. :D
Answer: There is a standard answer to this. It is fairly simple. You need to practice with a metronome.

First set the metronome for a much slower speed than the one the piece of music you are practising requires and which is just a bit quicker than you are comfortable with.
When this becomes comfortable increase the metronome speed by a small amount, say 5 beats per minute, and repeat.

Keep doing this and eventually you will reach the required speed.
Comment: I'm not an expert on this, but the speed picking gurus on the internet say that fast and slow playing are two different motions and techniques like walking and running. You don't learn to run by walking faster and faster. Or to play fast by playing slow faster. At some point a change of operating mode is required. Your suggested method may well work, if it's taken as "let the metronome and your feelings of comfort be your coach". But AFAIK, this doesn't always work. Some people hit a brick wall - they can't get any faster no matter how long they try, and cannot find out what the problem is.
Answer: How one picks is an important factor. Sometimes alternate picking is advantageous, but not always. Changing from one string to another, it's worth adressing whether the pick on the last string is going in the same direction as the next string. Last note on a G string works better when playing B string next if that stroke is down. It also makes the playing smoother. Fast by itself doesn't equal good. Fast and smooth is better. That's r.h.
L.h needs fingering to be examined, as often that can be improved: try out different fingering, but also consider if you need to change strings more often, or move up and down the same strings.
Guitars with lower actions are often easier to play fast and smooth as the strings are easier and quicker to press down.
Playing legato also speeds things up. There's no need to pluck every note - hammering on, pulling off, sliding, can help. As can hybrid picking, using fingers as well as pick. I find that particularly useful when playing consecutive notes on non-adjacent strings.
Comment: I came to the same conclusion too: hammer on and slide will not only make things faster, but often easier and it adds some expression too
Comment: And sweep picking is the absolute step change with regards to picking speed across multiple strings. Took me a while to get the basics right, but it more than doubled my speed straight away - and as I get better I'm getting even faster - and I could not have done that with any other picking technique.
Answer: Learning a Johnny Winter break 50 years ago from vinyl @ 16-2/3, I hit a speed wall trying to play every note. I then just focused on full speed with mistakes. That worked, Hurdle surmounted ... and it soon came together with fewer and fewer mistakes.
Comment: You may have unknowingly, just by intuition, used _chunking_, breaking down the fast sequences into "chunks", smaller manageable parts, and then focusing on getting the chunks accurately timed and cleaner. The alphabet is a good example, you don't learn A B C D E F G H I J K L M N ... as a continuous ubroken sequence, you break it into shorter segments. A B C D -- E F G -- H I J K -- L M N -- ... etc. Or however you split it. _Divide et impera_
Comment: Interesting. It seems to be the opposite of what's generally advised.
Answer: One reason for slowness is that we're not sure what happens next. So try to consider each phrase you play as a continuous gesture without hesitation, rather than as a series of individual notes. One hand position should lead unerringly to the next.
Answer: The way I was taught to practice and learn fast runs is to practice them in a dotted fashion. So let's say for a run of quavers, practice it as a run of "dotted quaver - semiquaver - dotted quaver - semiquaver - ...", and then as a run of "semiquaver - dotted quaver - semiquaver - dotted quaver - ..." (repeating the practice in each pattern several times before switching).
That way, you learn and practive the quick moves necessary, but there's enough "breathing space" between them so that mistakes don't accumulate. I've used this practice techique successfully in several pieces.
Answer: The way I teach speed development is to use two tactics together.
Many people will tell you "to get fast, practice slow".  This is true, because slow practice allows you to focus on your technique: distance = time.  At any given speed, the farther you are moving, the longer it will take.
So the first tactic is to practice slowly, and pay attention to minimizing distance.  Lift your fretting hand fingers as little as possible.  Make the strokes (with pick or finger) as short as possible.  By reducing the distance, you'll reduce the amount of time needed to complete the sound production.
But slow practice isn't the complete answer, because it doesn't help with the mental part, which is shortening your reaction time.  For this, the second tactic is needed...
Play at a speed you can execute perfectly.  Let's say it's 80bpm.  After playing it once, double the speed and try it at 160.  As soon as you make the first mistake, stop.  Set the metronome one mark faster than your first speed (so now you're at 84).  Do it again.  If you can do it without a mistake, go to 160, then try 88 after the first mistake.
By really forcing the tempo, the reduction to 84 will seem more manageable.  If you get it up to, say 92, and make a mistake, start it all over again at 80.  Over time this will improve your reaction.
But quick reaction without proper execution leads to sloppy performance, so you want the bulk of your speed work to be slow, and focused on technique.

How do I increase my speed on guitar?


Which Schema change scenario?

Question: My current schema looks like the following:
ID | DisplayVal
--   ----------
 1     1-H-3
 2     2-H-3
 3     3-J-4

In the above, the ID field is an IDENTITY INT field which is also used as and end user account Id.  The DisplayVal is what they see on the screen.
A new client has provided their own Account Id values, but they are alpha-numeric, so they can't just go into the IDENTITY field.  Here are my scenarios:  I am looking for a scenario that would offer the best maintainability, end user experience, magnitude and impact of changes and testing/QA impact.
My first scenario was to add an Account Number column that would be a VARCHAR(x) and accommodate all types of Account Numbers.  It would look like this:
ID | DisplayVal | AccountNumber
--   ----------   -------------
 1     1-H-3            1
 2     2-H-3            2
 3     3-J-4            3
 4     h389             h389
 5     h-400-x          h400

In the above, in the case of the first client, the seeded Identity which is the Account Id would be copied into the Account Number, but for the other client, there would still be a seeded Identity created, but their Account Number would be different and it may or may not match the Display Value.
My second scenario was to not add any columns and for clients that provide an Account Number, I would turn off IDENTITY INSERT and insert the new Id's and then turn identity insert back on.  If a client did not provide an Account Number, I would auto-generate one, obviously trying to avoid collisions.
The third scenario was basically to leave the new Account Number as a legacy Account Number and create new identity values for all new records. This would require the end-user to become familiar with a new Account Number.  It is probably the easiest, but not sure if there are any downsides.
If there is another scenario you know that would work well in this case, let me know.
Answer: You should not use business keys, like account id, as identity. Create a new id column and populate it either using an autoincrement field or a guid. Your users or other systems that interact with your system should not know/depend on this value.

Which Schema change scenario?


How can plugins have their own pages?

Question: My plugin needs to introduce a number of interfaces to Wordpress for the public traffic. What is the best way of introducing new interfaces?
Comment: I've added an answer below, but upon re-reading your question I think I might have misunderstood what you are asking. Are you asking how to create plugin specific pages in the "wp-admin" panel or creating front-facing pages like a profile page or contact page for example?
Comment: Creating admin pages is easy. I want to know how to create non-admin pages.
Comment: where, on wich point you will create pages; the post type page, also content on this post type?
Comment: Oh, so you mean you would like to create a standard page via your plugin like you would if you logged in, went to pages and then clicked add new, correct? Say for example your plugin is a custom login plugin and it creates a custom login page called "superplugin-login" I'll update my answer for you.
Comment: Please see my updated anwer, Am01 I think it's what you were asking for.
Answer: Believe it or not the WordPress official documentation has a great page covering this topic called Administration Menus. It also provides example code on how to use Wordpress hooks in your plugin code to add custom setting pages and other pages like that.
The page can be found here. Fire up the kettle and make yourself a coffee or tea before reading, because it is quite a large page. It even covers things like adding in forms and saving settings for your plugin that you can access.
** Update **
After further understanding what you were asking, it's apparent you want to create a Wordpress page from within your plugin, not an admin screen. Depending on whether or not you want to create it upon activation or when a user does a particular thing I'll assume you want to create it upon activation and remove it upon deactivation.
I did not add in code for deleting pages, you should be able to work that part out though. The following should add in a page upon activation of your plugin.
    <?php

    register_activation_hook(__FILE__, 'activate_plugin');
    register_deactivation_hook(__FILE__, 'deactivate_plugin');
    register_uninstall_hook(__FILE__, 'uninstall_plugin');

    function activate_plugin() {

        // This function creates the pages
        create_pages();
    }

    function deactivate_plugin() {

        // This function removes the pages
        remove_pages();
    }

    function uninstall_plugin() {

        // This function removes the pages
        remove_pages();
    }

    function create_pages() {

        // Create post object
        $_p = array();
        $_p['post_title']     = "Some page title";
        $_p['post_content']   = "This is content in a page added via a plugin. This was not added manually, run!";
        $_p['post_status']    = 'publish';
        $_p['post_type']      = 'page';
        $_p['comment_status'] = 'closed';
        $_p['ping_status']    = 'closed';
        $_p['post_category'] = array(1); // the default 'Uncategorised'

        $page_id = wp_insert_post($_p);

        if ( $page_id ) {

            return true;

        }

    }

    function remove_pages() {

        // Code in here to remove pages you added

    }

?>

If you have any questions or issues using the sample code post up what you're trying to accomplish and someone will sort you out. Good luck.
Answer: I'm not sure that Dwayne's answer on how to create a WordPress "Page" is what the poster is looking for.  Here are some disadvantages of creating a WordPress Page.

It may interfere with the site, for example start showing up on menus.
It is visible to the site admins, who may mess with it.
I think there are a lot of limitations to a Page, for example you don't have full control over the appearance and you can't really interact with the user.  (I'm not a WordPress expert, so I might be missing something here.)
It's overkill if you just want a simple page.

Based on the poster's desire for "interfaces to WordPress", I'm going to assume Am01 wants to create a "page" (lower-case), not a WordPress "Page"--ie, just some arbitrary PHP creating arbitrary HTML.
I had the same this problem.  I needed a callback URL for an OAuth login sequence.  Also, I wanted to create a self-contained test-bed page for my Plugin.  Here is how I did it:

Created a file foo.php in my plugin directory.
At the top, put
<?php
// HACK: initialize the WordPress environment, enough to use the Plugin
require_once( dirname(__FILE__) . '/../../../wp-load.php' );

Wrote my code below.  The code can make all normal calls to WordPress and the Plugin.
Refer to the page from the Plugin with plugins_url('foo.php', __FILE__).

This is unofficial!  One reason it is a hack is it hard-codes the location of wp-load.php.  If the plugin directory were in a non-default location, it might not work.  Also, the URL to the page is pretty ugly (/wp-content/...).
But I couldn't find an official or cleaner way to do this.  If someone has one, I'd be grateful for it!

How can plugins have their own pages?


Complex Exponential Sequence (Discrete-time exponentials) factor equalling 1?

Question: I'm reading page 10 of Schaum's ouTlines "Signals and Systems" by Hwei P. HSU, and I don't understand why this factor in the complex exponential sequence equals 1.

Consider the complex exponential sequence with frequency ($\Omega_{0} + 2\pi k$), where $k$ is an integer:
$e^{j(\Omega_{0} + 2\pi k)n} = e^{j\Omega_{0}n}e^{j2\pi kn} = e^{j\Omega_{0}n}$ $\quad$ $(1.56)$
since $e^{j2 \pi k n} = 1$.

My question: why does $e^{j2 \pi k n} = 1$ which, to my understand, would imply that $k$ is not just any integer but $0$ for this to be true since $j$ can't be $0$ and $n$ can't be $0$ because then $e^{j\Omega_{0}n}$ would also equal $1$.
The texts proceeds:

From Eq. $(1.56)$ we see that the complex exponential sequence at $\Omega_{0}$ is the same as that at frequencies ($\Omega_{0} \pm 2\pi$), ($\Omega_{0} \pm 4\pi$), and so on. Therefore, in dealing with discrete-time exponentials, we need only consider an interval of length $2\pi$ in which to choose $\Omega_{0}$.
Answer: $\exp(j2\pi kn) = \cos(2\pi kn) + j\sin(2\pi kn)$, where $\cos(2\pi kn) = 1$ for $kn \in \mathbb{Z}$, i.e., integer. And $\sin(2\pi kn) = 0$ for $kn \in \mathbb{Z}$. Thus $\exp(j2\pi kn) = \cos(2\pi kn) + j\sin(2\pi kn) = 1$ for $kn \in \mathbb{Z}$


Using Task with ASP.NET

Question: I am trying to get some asynchronous work done with the System.Threading.Tasks.Task class. The scenario is simple. I have a web app and in one button click event I start a Task which must run to check some outside service for a couple of minutes. It is not a heavy task. All it's going to do is send a request every 5 seconds and get a response. But it must do it for at least a couple of minutes. So, I don't want user to wait until this task gets job done. After I have started the task, I immediately return to the user saying that the task started and he/she will be informed when it is done. I wonder if this task I created will cause any problems, since I returned and ended the HTTP response.
Answer: This type of "asynchronous work" isn't possible by using the Task type. As I mention on my blog, async does not change the HTTP protocol; you still get one response per request, that's it!
The ideal ASP.NET app does not do any work outside of a request/response pair. There are ways to make it work (also described on my blog), but it's almost never recommended.
The proper solution is to split up the processing. A web site (or service) should start the processing by placing a request into persistent storage (e.g., Azure queue), a separate worker service (e.g., Azure worker role / Win32 service) would do the polling and put the results into persistent storage (e.g., Azure table), and the web site/service could poll that.
Answer: You can consider using message based service bus, and a good tutorial on MSDN Building
   Distributed Apps with NHibernate and Rhino Service Bus will be
   very useful.
Answer: If you just return from a standard asp.net request then wouldn't you expect the HttpResponse to end?  Starting up a task in itself won't hold the HttpResponse open, to that you'd need to stream your response and block on the server until your task is finished which is presumably not what you want to do?
Maybe you should look at some ajax on the client that periodically pings the server to see if the task has finished, or at HTML 5 push notifications if you know your browser is going to support it.
Comment: Firstly, thanks for your reply. Ending response is OK with me. I want to end it. I'm just wandering if it causes any other problem since the task I've started in my aspx class is still running. By the way triggering this functionality from client side is not an option in my case. It must be done in server side.
Answer: You can use this http://www.asp.net/web-forms/tutorials/aspnet-45/using-asynchronous-methods-in-aspnet-45 but imho ajax with web service much better

Using Task with ASP.NET


Are the second and third generations of matter required or optional?

Question: If the second and third matter families (so-called generations: muon, muon neutrino, tau, tau   neutrino, ...) didn't exist, would that affect how the universe runs? Are they optional or required?
Answer: This question can be split into two parts: How do three generations affect the way the universe runs within the standard model, and how do they affect beyond standard model physics?
It is likely that the three generations are important in beyond standard model physics and without them particle physics would be very different. However we do not have any definite idea about how that works so let's concentrate on standard model physics.
It is true that almost all physics that affects the way the universe runs depends on only the first generation of matter particles, i.e. the up and down quarks, electron and electron neutrino, plus the gauge bosons. Although we can now easily observe particles from the second generation i.e muons, strange particles and charm, these have almost no significance in chemistry or even main processes of nuclear physics. Hence their effect on how the universe runs is very small. The third generation has even less influence.
However there are some exceptions and possible exceptions.
(1) Muons are an important component of cosmic rays and it is now thought that cosmic rays can play an important part in weather and climate. There have been studies to observe correlations between muon flux and upper atmosphere temperature. Even if this is observed it does not necessarily mean that muons have a causal affect on weather but it is possible. Atmospheric muons could have other important influences such as gene mutation, but this is speculative as far as I know.
(2) CP violation can occur in the standard model at observable rates only through the CKM and PMNS mixing matrices for three generations. With only one or two generations CP violation in the standard model can only happen via unobservable non-perturbative effects. While CP violation does not have any affect on the way the universe runs now, it is thought to be essential in big bang cosmology in order to create an imbalance between matter and anti-matter. Without it all matter would have annihilated with antimatter as the universe cooled. However, it is not known if other CP violating processes from beyond standard model physics that do not depend on the three generations are more important.
(3) In calculations of particle masses and decay rates the existence of second generation particles as virtual particles has some effect. You could argue that the masses of protons and neutron might be slightly different etc if there were no muons etc.
(4) The three generations of neutrino have observable effects on decay rates of weak gauge bosons and also on cosmological parameters measured in the cosmic microwave background. Whether this affects the running of the universe in some significant way is another question.
(5) The top quark mass is an important factor affecting the stability of the vacuum and the allowable mass range of the Higgs boson for stability. You could therefore argue that the top quark and perhaps some of the other heavy flavour particles are needed to stop the vacuum decaying.
In several of these possibilities you could make the point that without the second and third generation the parameters of the standard model could be adjusted to produce the same effect, so it is not certain that the second and third generations have any real necessity in the running of the universe.
Comment: to elaborate on 5, if there were no higher generations then the Higgs would couple with the heaviest quark the d, which is 4.8 Mev, but the u is only 1/2 that and even the electron is 10%. I think this would mean that higher order contributions to cross sections and decays would be different by large factors. For example electromagnetic interactions which hold the atoms together would be affected, etc. I cannot easily envision a universe similar to ours under these conditions.
Comment: @annav The SM is still a renormalizable theory with only one generation, and below the kaon mass ($\sim 493\ \mathrm{MeV}$) you have an effective theory of light leptons and pions in both cases. So by adjusting the parameters you should be able to match the all the physics below that scale up to corrections of the order $E/m_K$ at the worst, right? In particular low energy EM wouldn't necessarily be affected. Can't remember ever hearing atomic physicists talk about having to include kaon loops... I don't know how protons and neutrons would be affected though. Possibly nontrivial stuff there.:)
Comment: Re the Higgs, that's an interesting question. Without the top around you might not be able to get away with a simple scalar Higgs, but might need a strongly coupled Higgs sector, something like technicolour? Unless you fiddle with the Higgs mass as well...
Answer: The a particle later to be known as the electron neutrino was proposed to exist by Wolfgang Pauli because physicists already knew then that it must exist--otherwise the known laws of conservation of energy, momentum and angular momentum would be violated. They were studying beta decay of neutrons: $n^0 → p^+ + e^−$, and found that while the charges conserved, the energy and momentums did not. A hypothetical particle was proposed to fill in these gaps (this is why scientific laws are so useful in that they have predictive quality). It was subsequently shown that just one particle which filled in all the gaps of beta decay existed--the electron neutrino (Cowan, Reines, 1956).
With the discovery of the electron neutrino, physicists were puzzled by how few were reaching earth from the sun's fusion reactions. From known values of solar radiation and knowledge of fusion mechanisms including beta decay, we were detecting way too few electron neutrinos--a big hole in our understanding (based on the Standard Solar Model) later known as the solar neutrino problem. It was again, another implied violation of conservation laws. A year later Fermi's assistant proposed that neutrinos change into different flavours (muon, tau neutrinos) just like quarks were known to do. It was just a matter of time that experimental physicists found the next generations of the neutrino.
As you may know this year's Nobel in physics was awarded to the people who hypothesized the Higgs boson, which had to exist in order to explain the masses of the W and Z bosons and in a way which did not conflict with gauge theory which was by then too successful to abandon.
To answer your question, yes there is a theoretical need for three generations of leptons to exist mostly due to the fact that the foundations of physics would collapse and everything else would follow. Instead we assume that everything does not collapse, that everything works, and we just have to discover what those things are that make everything work the way it works.
Answer: I guess protons need strange quarks. eg.
http://arxiv.org/abs/1203.4051


Is it better to skip OpenGL 2.X and start learning OpenGL 3.X?

Question: Are there huge differences in OpenGL 3.x vs 2.x? Is it waste of time learning OpenGL 2.x or are they both following the same concept?  I think i read somewhere that 2.x was state based and that 3.x was not, is that correct?
Answer: Be careful. OpenGL 3 deprecates a lot of functions, especially those of the early days of OpenGL. If you start with outdated tutorials (like most of NeHe), you will most probably become accustomed an outdated style of OpenGL 2.
There is no fixed function pipeline in OpenGL 3 (if you don't use the backward compatibility features). You have to use shaders. There is no glBegin/glEnd anymore. You have to use vertex buffers. Both are already available in OpenGL 2, but most tutorials start with glBegin/glEnd and setting OpenGL color properties. This is a very important difference.
OpenGL 2 provides countless ways to put something on the screen, each of which is covered in at least one popular tutorial. OpenGL 3 drops many of them, including the "beginners' subset" of OpenGL 2 (fixed function glBegin/glEnd). So if you want to target OpenGL 3 in the long term, go for it right from the start. There's nothing more demotivating than being stuck in a dead end.
Comment: With OpenGL 3, in meant the whole 3.x family, and the recently released 3.2 actually drops deprecated functions. See "What's New in OpenGL 3.2", http://www.opengl.org/documentation/current_version/ : "OpenGL 3.2 and the companion OpenGL Shading Language 1.50 add many new features, while simultaneously simplifying the API and shading language by removing legacy fixed-functionality interfaces deprecated in OpenGL 3.0."
Comment: OpenGL 3 doesn't drop anything. Deprecation means that it will be dropped in the future, not that it has been dropped. So long as one uses a full context, everything you're worrying about is still there.

I seriously doubt drivers will drop support for the fixed function pipeline for a very long time, considering how much existing software uses it.
Comment: Thanx Malte
This is what i was worried about. And even if something is still there i want to learn the best way of doing things and the glBegin/End stuff does not seem to be that. So do you know where to find any opengl 3.x tutorials that does not start with the deperecated stuff?
Comment: I afraid I don't. However, I can recommend the great OpenGL community at http://www.opengl.org/discussion_boards/ubbthreads.php . Probably some people in the beginners' forum know more about 3.x learning resources. And keep a copy of the official specification handy. Although it doesn't replace a tutorial, its well written and invaluable for corner cases.
Answer: They're almost entirely backwards compatible, so anything you learn with an older version is going to apply to the later versions just fine. If you have to 'aim' somewhere in particular, 2.0 is probably a good choice. If you look at the OpenGL Wikipedia page, you can see what was added to the various versions, and decide for yourself which features you think you'll need.
Comment: Man, people keep down voting me. Suck it up. I'll stand by this advice, particularly when there still isn't anyone whose popped up with GL 3 specific resources. You can learn shaders just fine working with 2.x, and if the method by which you feed geometry to GL even a small part of your task's difficulty, I wish I were in your shoes.
Answer: I am reading through "Learning Modern 3D Graphics Programming", and while I don't have hardware to actually use OpenGL 3 yet, it's helping me get the concepts straight in my mind such that I should be able to ditch 1.1-style and move to 3 once I do have hardware to work with.
http://www.arcsynthesis.org/gltut/
Answer: I think the modern shader only style is the future of OpenGL and real-time 3D graphics. I would suggest to start with OpenGL 3 right away. On the other hand the old-style deprecated OpenGL is easier to learn and it is easier to do simple things, without understanding the whole API.
But no matter if you skip the old-style fixed-function or not or if you use Direct3D or OpenGL, it is important that you also understand the principles and inner workings of a graphics pipeline, as I often (not always) see people, who have questions about OpenGL and why their code does not work and they seem to have no idea about computer graphics and what the respective OpenGL functions really do and mean.
EDIT: Also, have a look at this question for some book recommendations, depeding on you decision.
Answer: I find this tutorial very easy to follow and use and it is for OpenGL 3 http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Table-of-Contents.html. Other tutorials you can find useful :

Arcsynthesis GLUT tutorial
http://www.open.gl/
GLSL tutorial for opengl 2.X
Answer: Learn whatever has the most learning materials written about it. NeHe's tutorials are a good place to start.
I did a little OpenGL work a few months ago, and while I don't remember the version I was programming to, I can tell you that it's the concepts that are the most important.  This is especially true when you're just beginning and not dealing with shaders and whatnot.
(See Malte Clasen's answer.)
Comment: I consider this advice dangerous: Not dealing with shaders results in learning the deprecated fixed function pipeline. The subset you apparently began with is not available in OpenGL 3 anymore.
Comment: I agree , OpenGL has changed vastly since Nehe Tutorials. And if you  really want to take advantage of hardware acceleration , which most likely you will be insane to want to use OpenGL and not want to do this since there are tons more easy libraries out there to learn, Nehe will be of little use to you.


Rendering taking too long

Question: Rendering takes very long on my computer for very simple scenes. Even when I render just the start-up file, it takes 20 seconds. I rendered a torus, and it took the person doing a tutorial 6 seconds but it took me 1 minute and 52 seconds. My computer is relatively new, and I didn't change any settings. Any ideas on what I can do?
Square Sample isn't on.
Comment: Possible duplicate of [Why are my render times 30+ minutes, but other people's are ~3 minutes?](https://blender.stackexchange.com/questions/76149/why-are-my-render-times-30-minutes-but-other-peoples-are-3-minutes)
Comment: Apparently, single link answers are forbidden... but I can comment with one, and this solves your issue:  https://www.youtube.com/watch?v=8gSyEpt4-60  18 Ways to Speed Up Blender Cycles Rendering
Answer: If your computer has a decent graphics card, you could switch the the "render device" (at least I think it's called that) in the Render Properties panel to GPU Compute rather than CPU. GPUs are much better suited for rendering than CPUs are.
Comment: hmmm... I tried that. (I added an image above). But it's still taking a long time.How do you know if your computer has a decent graphics card? Thanks :).
Comment: Here's a video on how to find out what GPU you have! https://youtu.be/tDEvxjZG5ek You probably have a Nvidia graphics card, and in that case I'd consider anything above a GTX 720 to be pretty good. Although, I have like a GTX 650 or something around there and it's still faster than for rendering than my CPU. Another video that I saw recently was really helpful for me in reducing my render times, I highly recommend watching it might help you out. Just get prepared for a cringy intro! Lol https://youtu.be/8gSyEpt4-60
Answer: You can also render less samples. For a simple cube, 200 is enough or even already to much. See your settings in the sampling panel in the render tab. Default settings are 250 samples or so, that could be too much.

Rendering taking too long


Breeze SaveChanges partial fail

Question: I'm thinking at the following scenario: on the client-side you update two entities and you submit the POST with the json bundle. On the server side you do an interception and apply some business logic. The save works for one of the entities, however for the other one it fails. In your opinion what will be the correct solution and why: 1. should I do a rollback and return an exception on the client, or 2. commit the update for the 1st entity and return a message that the save worked only for one of the entities? I know that the guys from IdeaBlade consider the saveChanges as a single transaction(so all CRUD functionality goes in a single POST), so judging by this I think 1. should be correct approach. However I appreciate all reasoned opinions.Thanks!
Comment: It looks like these two entities can/should be saved independently. If this is your business logic, then why not submit two SaveChanges()?
Comment: Because I need a batch save.
Answer: Well it depends on what your doing. I bet you would save a lot of time developing if you just roll back. If you really want to though, you can return a list of failed and successful entities saved. Then the user (assuming the errors are user errors) can make the changes on the errored entities and commit only them again. This may become difficult though. Breeze attaches a state to each entity, which you will need now need to manage. So on the response, you'll need to figure out which entities failed and which succeeded, then update their state on the client, otherwise you'll resubmit commits that you don't need to. I think it would be a better investment on time to put this business logic on the client, then roll back on the server (and log the event so you can fix it) for the rare occasions errors occur. Does that help?
Comment: Your answer is good, however I want to see more answers before I accept one of them :)

Breeze SaveChanges partial fail


JQuery to find LI by text and UL by Class

Question: I am working with a list in SharePoint 2013 that creates an unordered list dynamically on mouseover (the List item ECB for those familiar with SharePoint).
The class name that is given has spaces added after at, 1 additional space for each menu item. I'm not sure if this affects the class property value in jquery so that is why I'm using the begins with notation.
I am needing to hide several menu items and I'm not getting alerts in my debug so I'm thinking my syntax is off.
I'm using this:
if($('ul[class^="ms-core-menu-list"] li[text="View Item"]') ! == null) {
  alert('F');
} else {
  alert('no F');
}

I do not get alerts so either my syntax is wrong and I need assistance with that or the menu item isn't created when this code executes, in which case I'm wondering how it is possible to get at these menu items using jquery as I'm unable to deploy code in my environment.
I've looked at a number of blogs over the past few days but nothing recommended comes close to working for me.
Thank you
Comment: can you post the html?
Comment: Do the li elements in your page actually have a `text` attribute or are you querying the text within the `li` tags?
Answer: If you're trying to find out if the page contains any li tags that with the text "View Item" that are children of ul tags with the class "ms-core-menu-list" you can use this selector:
$('li:contains("View Item")', $('ul.ms-core-menu-list')).length;

In the context of your example:
if($('li:contains("View Item")', $('ul.ms-core-menu-list')).length) {
  alert('F');
} else {
  alert('no F');
}

Answer: Use this :
if($('ul.ms-core-menu-list li[text="View Item"]').length==0)
...

Note that JQuery always returns a JQuery object which is not null.
Answer: The thing to remember about jQuery selectors is that they will always return an object. Even if you don't find anything, you are still given the jQuery API to call things like .hide(), .show(), etc. You won't get an error if you haven't selected anything when calling a jQuery method, you just won't have anything selected for the calls to act upon.
What you can do to infer if any elements are selected is by treating it like the psuedo-array that it is -- you can use .length.
In your case,
if ($('ul.ms-core-menu-list li[text="View Item"]').length > 0) {
  alert('F');
} else {
  alert('no F');
}