“use database_name” command in PostgreSQL

When you get a connection to PostgreSQL it is always to a particular database. To access a different database, you must get a new connection. Using \c in psql closes the old connection and acquires a new one, using the specified database and/or credentials. You get a whole new back-end process and everything.

Convert char to int in C#

Interesting answers but the docs say differently: Use the GetNumericValue methods to convert a Char object that represents a number to a numeric value type. Use Parse and TryParse to convert a character in a string into a Char object. Use ToString to convert a Char object to a String object. http://msdn.microsoft.com/en-us/library/system.char.aspx

How can I represent a range in Java?

Apache Commons Lang has a Range class for doing arbitrary ranges. Guava Range has similar API. If you are just wanting to check if a number fits into a long value or an int value, you could try using it through BigDecimal. There are methods for longValueExact and intValueExact that throw exceptions if the value is too big for those precisions.

Difference between JA and JG in assembly

As Intel’s manual explains, JG interprets the flags as though the comparison was signed, and JA interprets the flags as though the comparison was unsigned (of course if the operation that set the flags was not a comparison or subtraction, that may not make sense). So yes, they’re different. To be precise, ja jumps if CF = 0 and ZF … Read more

What is the difference between a null array and an empty array?

Technically speaking, there’s no such thing as a null array; but since arrays are objects, array types are reference types (that is: array variables just hold references to arrays), and this means that an array variable can be null rather than actually pointing to an array: An empty array is an array of length zero; it has no elements: (and can never have elements, … Read more

jquery variable syntax [duplicate]

$self has little to do with $, which is an alias for jQuery in this case. Some people prefer to put a dollar sign together with the variable to make a distinction between regular vars and jQuery objects. example: These are declared as two different variables. It’s like putting underscore before private variables. A somewhat popular pattern … Read more