Cannot implicitly convert type ‘System.Collections.Generic.List< >‘ to ‘System.Collections.Generic.IList< >‘

Assuming InvoiceMaster derives from or implements InvoiceHD, and that you’re using C# 4 and .NET 4 or higher, you can just use generic variance: This uses the fact that an IEnumerable<InvoiceMaster> is an IEnumerable<InvoiceHD> because IEnumerable<T> is covariant in T. Another way to solve it would be to change the declaration of MstDtl to use explicit typing: (I’d also suggest following regular C# naming, where local variables start with … Read more

Where are the ampersand and vertical bar characters used in Python?

The wikipedia page is wrong, I’ve corrected it. | and & are not boolean operators, even though they are eager operators, which just means that they are not short circuit operators. As you probably know, here’s how the python and and or operators work: As far as I know, python has no eager boolean operators, they would have to be explicitly coded, for instance like … Read more

cin.ignore(numeric_limits::max(), ‘\n’)

This line ignores the rest of the current line, up to ‘\n’ or EOF – whichever comes first: ‘\n’ sets the delimiter, i.e. the character after which cin stops ignoring numeric_limits<streamsize>::max() sets the maximum number of characters to ignore. Since this is the upper limit on the size of a stream, you are effectively telling cin that there is no limit to the number of … Read more

What is the difference between “px”, “dip”, “dp” and “sp”?

From the Android Developer Documentation: px> Pixels – corresponds to actual pixels on the screen. in> Inches – based on the physical size of the screen.> 1 Inch = 2.54 centimeters mm> Millimeters – based on the physical size of the screen. pt> Points – 1/72 of an inch based on the physical size of the screen. dp or dip> Density-independent Pixels – an abstract unit that … Read more

How to run only one unit test class using Gradle

To run a single test class Airborn’s answer is good. With using some command line options, which found here, you can simply do something like this. From version 1.10 of gradle it supports selecting tests, using a test filter. For example, For multi-flavor environments (a common use-case for Android), check this answer, as the –tests argument will be unsupported and … Read more