Tutorial by Examples: er

A single rest-parameter can be given with the keyword &REST after the required arguments. If such a parameter exists, the function can take a number of arguments, which will be grouped into a list in the rest-parameter. Note that the variable CALL-ARGUMENTS-LIMIT determines the maximum number of...
Keyword parameters can be defined with the &KEY keyword. They are always optional (see the Optional Parameters example for details of the definition). There may be multiple keyword parameters. (defun foobar (x y &key (z "Default" zp)) (format t "X (~s) and Y (~s) are requi...
The normal orElse method takes an Object, so you might wonder why there is an option to provide a Supplier here (the orElseGet method). Consider: String value = "something"; return Optional.ofNullable(value) .orElse(getValueThatIsHardToCalculate()); // returns "some...
A static member function is just like an ordinary C/C++ function, except with scope: It is inside a class, so it needs its name decorated with the class name; It has accessibility, with public, protected or private. So, if you have access to the static member function and decorate it correctl...
To access a member function of a class, you need to have a "handle" to the particular instance, as either the instance itself, or a pointer or reference to it. Given a class instance, you can point to various of its members with a pointer-to-member, IF you get the syntax correct! Of course...
To access a member of a class, you need to have a "handle" to the particular instance, as either the instance itself, or a pointer or reference to it. Given a class instance, you can point to various of its members with a pointer-to-member, IF you get the syntax correct! Of course, the poi...
A static member variable is just like an ordinary C/C++ variable, except with scope: It is inside a class, so it needs its name decorated with the class name; It has accessibility, with public, protected or private. So, if you have access to the static member variable and decorate it correctl...
sp_who2 This procedure can be used to find information on current SQL server sessions. Since it is a procedure, it's often helpful to store the results into a temporary table or table variable so one can order, filter, and transform the results as needed. The below can be used for a queryable v...
Declaring a generic interface interface IResult<T> { wasSuccessfull: boolean; error: T; } var result: IResult<string> = .... var error: string = result.error; Generic interface with multiple type parameters interface IRunnable<T, U> { run(input: T): U; } ...
class Result<T> { constructor(public wasSuccessful: boolean, public error: T) { } public clone(): Result<T> { ... } } let r1 = new Result(false, 'error: 42'); // Compiler infers T to string let r2 = new Result(false, 42); // Compiler infers T...
Simple constraint: interface IRunnable { run(): void; } interface IRunner<T extends IRunnable> { runSafe(runnable: T): void; } More complex constraint: interface IRunnble<U> { run(): U; } interface IRunner<T extends IRunnable<U>, U> { runSafe...
In interfaces: interface IRunner { runSafe<T extends IRunnable>(runnable: T): void; } In classes: class Runner implements IRunner { public runSafe<T extends IRunnable>(runnable: T): void { try { runnable.run(); } catch(e) { } ...
Create generic class instance: var stringRunnable = new Runnable<string>(); Run generic function: function runSafe<T extends Runnable<U>, U>(runnable: T); // Specify the generic types: runSafe<Runnable<string>, string>(stringRunnable); // Let typescript figu...
This will show the user type and permission path (which windows group the user is getting its permissions from). xp_logininfo 'DOMAIN\user'
Haskell supports a notion of class extension. For example, the class Ord inherits all of the operations in Eq, but in addition has a compare function that returns an Ordering between values. Ord may also contain the common order comparison operators, as well as a min method and a max method. The =&...
$this->helper('customer/data')->getAccountUrl(); OR Mage::helper('customer/data')->getAccountUrl();
You can redirect the debug output to a text file by adding a TextWriterTraceListener to the Debug.Listeners collection. public static void Main(string[] args) { TextWriterTraceListener myWriter = new TextWriterTraceListener(@"debug.txt"); Debug.Listeners.Add(myWriter); Deb...
return http://www.example.com/skin/frontend/{interface}/{theme}/images/my-image.jpg
Mage::getSingleton('admin/session')->getUser();
Mage::helper('customer')->getCustomer(); or Mage::getSingleton('customer/session')->getCustomer();

Page 85 of 417