How to select bottom most rows?
SELECT columns FROM ( SELECT TOP 200 columns FROM My_Table ORDER BY a_column DESC ) SQ ORDER BY a_column ASC
SELECT columns FROM ( SELECT TOP 200 columns FROM My_Table ORDER BY a_column DESC ) SQ ORDER BY a_column ASC
New keyword reference from MSDN: MSDN Reference Here is an example I found on the net from a Microsoft MVP that made good sense: Link to Original public class A { public virtual void One(); public void Two(); } public class B : A { public override void One(); public new void Two(); } B … Read more
It makes the function remember the value of the given variable ($has_run in your example) between multiple calls. You could use this for different purposes, for example: function doStuff() { static $cache = null; if ($cache === null) { $cache=”%heavy database stuff or something%”; } // code using $cache } In this example, the if … Read more
It’s used for “type aliases”. For example: type StringOrNumber = string | number; type DictionaryOfStringAndPerson = Dictionary<string, Person>; Reference: (edit: removed outdated link) TypeScript Specification v1.5 (section 3.9, “Type Aliases”, pages 46 & 47) Update: (edit: removed outdated link) Now on section 3.10 of the 1.8 spec. Thanks @RandallFlagg for the updated spec and link … Read more
Here’s the Clojure documentation for Keywords and Symbols. Keywords are symbolic identifiers that evaluate to themselves. They provide very fast equality tests… Symbols are identifiers that are normally used to refer to something else. They can be used in program forms to refer to function parameters, let bindings, class names and global vars… Keywords are … Read more
1: The problem in the example f :: State s a f = State $ \x -> y where y = … x … is the parameter x. Things in the where clause can refer only to the parameters of the function f (there are none) and things in outer scopes. 2: To use a … Read more
Option Infer must be on in order for this to function properly. If so, then omitting the type in VB.NET (Visual Basic 9) will implicitly type the variable. This is not the same as “Option Strict Off” in previous versions of VB.NET, as the variable is strongly-typed; it’s just done so implicitly (like the C# … Read more
The sole reason to use stackalloc is performance (either for computations or interop). By using stackalloc instead of a heap allocated array, you create less GC pressure (the GC needs to run less), you don’t need to pin the arrays down, it’s faster to allocate than a heap array, an it is automatically freed on … Read more
It’s syntactic sugar for basic scripts. Omitting the “def” keyword puts the variable in the bindings for the current script and groovy treats it (mostly) like a globally scoped variable: x = 1 assert x == 1 assert this.binding.getVariable(“x”) == 1 Using the def keyword instead does not put the variable in the scripts bindings: … Read more
See the reference for user-defined type guard functions for more information. function isString(test: any): test is string{ return typeof test === “string”; } function example(foo: any){ if(isString(foo)){ console.log(“it is a string” + foo); console.log(foo.length); // string function } } example(“hello world”); Using the type predicate test is string in the above format (instead of just … Read more