23 Dec: Must Read Codes [11-15]
We are sharing few must read codes/concepts which are required now and then. Each of these codereads doesn’t require a full length descriptive article so combining them into groups of five.
We have two properties in CSS to hide the elements but there is a difference in their behavior such as
if we use ‘Visibility:Hidden;’ : element will NOT be visible but will take its space on the page.
if we use ‘Display:None;’ : element will NOT be visible and also in addition to that, will NOT take up space on the page. This makes page lighter.
A jagged array is an array of arrays and is declared as
It is jagged array where first square bracket is a one-dimensional array and contains two arrays where each one of them internally contains 4 arrays.
A multidimensional array is declared as
string[ , ] mularray;
It is multidimensional array where ‘,’ separates it to two dminesions containing 2 and 4 elemnts respectively.
To Count number of tables in a SQL Server database
SELECT COUNT(*) from information_schema.tables
WHERE table_type = ‘base table’
Garbage collection occurs when one of the following conditions is true:
1.The system has low physical memory.
2. The memory that is used by allocated objects on the managed heap surpasses an acceptable threshold. This means that a threshold of acceptable memory usage has been exceeded on the managed heap. This threshold is continuously adjusted as the process runs.
3. The GC.Collect method is called. In almost all cases, you do not have to call this method, because the garbage collector runs continuously. This method is primarily used for unique situations and testing.
A property is classified according to the accessors used as follows:
1.A property with a get accessor only is called a read-only property. You cannot assign a value to a read-only property.
2.A property with a set accessor only is called a write-only property. You cannot reference a write-only property except as a target of an assignment.
3.A property with both get and set accessors is a read-write property.