Tutorial by Examples: c

If we want to order the data differently for per group, we can add a CASE syntax to the ORDER BY. In this example, we want to order employees from Department 1 by last name and employees from Department 2 by salary. IdFNameLNamePhoneNumberManagerIdDepartmentIdSalaryHireDate1JamesSmith1234567890NUL...
We are so used to the name D3.js that it's possible to forget that D3 is actually DDD (Data-Driven Documents). And that's what D3 does well, a data-driven approach to DOM (Document Object Model) manipulation: D3 binds data to DOM elements and manipulates those elements based on the bounded data. Le...
git log --pretty=format:"%Cgreen%ci %Cblue%cn %Cgreen%cr%Creset %s" This will give a nice overview of all commits (1 per line) with date, user and commit message. The --pretty option has many placeholders, each starting with %. All options can be found here
It is not possible to add and commit an empty folder in Git due to the fact that Git manages files and attaches their directory to them, which slims down commits and improves speed. To get around this, there are two methods: Method one: .gitkeep One hack to get around this is to use a .gitkeep fil...
Arrow functions are lexically scoped; this means that their this Binding is bound to the context of the surrounding scope. That is to say, whatever this refers to can be preserved by using an arrow function. Take a look at the following example. The class Cow has a method that allows for it to pr...
Arrow functions do not expose an arguments object; therefore, arguments would simply refer to a variable in the current scope. const arguments = [true]; const foo = x => console.log(arguments[0]); foo(false); // -> true Due to this, arrow functions are also not aware of their caller/ca...
Arrow functions may implicitly return values by simply omitting the curly braces that traditionally wrap a function's body if their body only contains a single expression. const foo = x => x + 1; foo(1); // -> 2 When using implicit returns, object literals must be wrapped in parenthesis s...
Arrow functions can behave very similar to classic functions in that you may explicitly return a value from them using the return keyword; simply wrap your function's body in curly braces, and return a value: const foo = x => { return x + 1; } foo(1); // -> 2
xcrun uses the system default Xcode version (set via xcode-select) to locate and execute command line tools from the Xcode application bundle, e.g., llvm-cov. # Generate code coverage reports via llvm-cov # /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin xc...
Use Spliterators.spliterator() or Spliterators.spliteratorUnknownSize() to convert an iterator to a stream: Iterator<String> iterator = Arrays.asList("A", "B", "C").iterator(); Spliterator<String> spliterator = Spliterators.spliteratorUnknownSize(itera...
In this example we have only one object but it is shared between/executed on different threads. Ordinary usage of fields to save state would not be possible because the other thread would see that too (or probably not see). public class Test { public static void main(String[] args) { ...
Reduction is the process of applying a binary operator to every element of a stream to result in one value. The sum() method of an IntStream is an example of a reduction; it applies addition to every term of the Stream, resulting in one final value: This is equivalent to (((1+2)+3)+4) The reduc...
To initialize a static final fields that require using more than a single expression, a static initializer can be used to assign the value. The following example initializes a unmodifiable set of Strings: public class MyClass { public static final Set<String> WORDS; static {...
Sun / Oracle releases of Java SE come in two forms: JRE and JDK. In simple terms, JREs support running Java applications, and JDKs also support Java development. Java Runtime Environment Java Runtime Environment or JRE distributions consist of the set of libraries and tools needed to run and mana...
Orthogonal to the JRE versus JDK dichotomy, there are two types of Java release that are widely available: The Oracle Hotspot releases are the ones that you download from the Oracle download sites. The OpenJDK releases are the ones that are built (typically by third-party providers) from the Ope...
You can enhance your own classes with generics just like NSArray or NSDictionary. @interface MyClass<__covariant T> @property (nonnull, nonatomic, strong, readonly) NSArray<T>* allObjects; - (void) addObject:(nonnull T)obj; @end
In order to be able to work with C structs as Ruby objects, you need to wrap them with calls to Data_Wrap_Struct and Data_Get_Struct. Data_Wrap_Struct wraps a C data structure in a Ruby object. It takes a pointer to your data structure, along with a few pointers to callback functions, and returns a...
You can create custom views that can be integrated to your page thanks to those adjustment tools. Select File > New > File... > Forms > Forms ContentView (Xaml) and create a view for each specific layout : TabletHome.xamland PhoneHome.xaml. Then select File > New > File... > F...
Creating variables in VBScript can be done by using the Dim, Public, or Private statement. It is best practice to put at the top of the script "Option Explicit" which forces you to explicitly define a variable. You can declare one variable like this: Option Explicit Dim firstName O...
Source table RowABCD1CodeProductColourPrice21penred50032penblue-5043penred054pencilblue1765pencilgreen-1.5 to select all: = QUERY(A1:D5, "select *") or = QUERY(A1:D5, "select A, B, C, D") or convert data range into array and use this formula: = QUERY({A1:D5}, "sel...

Page 425 of 826