How to easily initialize a list of Tuples?

c# 7.0 lets you do this: var tupleList = new List<(int, string)> { (1, “cow”), (5, “chickens”), (1, “airplane”) }; If you don’t need a List, but just an array, you can do: var tupleList = new(int, string)[] { (1, “cow”), (5, “chickens”), (1, “airplane”) }; And if you don’t like “Item1” and “Item2”, you … Read more

Scala list concatenation, ::: vs ++

Legacy. List was originally defined to be functional-languages-looking: 1 :: 2 :: Nil // a list list1 ::: list2 // concatenation of two lists list match { case head :: tail => “non-empty” case Nil => “empty” } Of course, Scala evolved other collections, in an ad-hoc manner. When 2.8 came out, the collections were … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)