Tutorial by Examples: er

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...
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...
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...
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
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...
Gson does not support inheritance out of the box. Let's say we have the following class hierarchy: public class BaseClass { int a; public int getInt() { return a; } } public class DerivedClass1 extends BaseClass { int b; @Override public int getI...
The first thing to do is to add the service to AndroidManifest.xml, inside the <application> tag: <application ...> ... <service android:name=".RecordingService" <!--"enabled" tag specifies Whether or not the service can ...
filter returns a list of each item in the given list for which the given predicate returns a non-#f value. ;; Get only even numbers in a list > (filter even? '(1 2 3 4)) '(2 4) ;; Get all square numbers from 1 to 100 > (filter (lambda (n) (integer? (sqrt n))) (range 1 100)) '(1 4 9 16 ...
The function in this example returns true if two line segments are intersecting and false if not. The example is designed for performance and uses closure to hold working variables // point object: {x:, y:} // p0 & p1 form one segment, p2 & p3 form the second segment // Retur...
Task Build -depends Clean { "Build" } Task Clean -ContinueOnError { "Clean" throw "throw on purpose, but the task will continue to run" } Task default -Depends Build
1..10 | foreach-object { $fileName = "file_name_$_.txt" Write-Progress -Activity "Copying files" -Status "$($_*10) %" -Id 1 -PercentComplete ($_*10) -CurrentOperation "Copying file $fileName" 1..100 | foreach-object { ...
# Set The Formatting $xmlsettings = New-Object System.Xml.XmlWriterSettings $xmlsettings.Indent = $true $xmlsettings.IndentChars = " " # Set the File Name Create The Document $XmlWriter = [System.XML.XmlWriter]::Create("C:\YourXML.xml", $xmlsettings) # Write the XML ...
config.paths.html represents the path to your HTML file. gulp.task("watch", function() { gulp.watch(config.paths.html, ["html"]); }); The task should be added to default as well: gulp.task("default", ["html", "watch"]);
The qsort() standard library function is a good example of how one can use void pointers to make a single function operate on a large variety of different types. void qsort ( void *base, /* Array to be sorted */ size_t num, /...
JSON_VALUE function enables you to take a data from JSON text on the path specified as the second argument, and use this value in any part of the select query: select ProductID, Name, Color, Size, Price, JSON_VALUE(Data, '$.Type') as Type from Product where JSON_VALUE(Data, '$.Type') = 'part' ...
If some JSON text might not be properly formatted, you can remove those entries from query using ISJSON function. select ProductID, Name, Color, Size, Price, JSON_VALUE(Data, '$.Type') as Type from Product where JSON_VALUE(Data, '$.Type') = 'part' and ISJSON(Data) > 0
If you have a "child table" formatted as JSON collection and stored in-row as JSON column, you can unpack this collection, transform it to table and join it with parent row. Instead of the standard JOIN operator, you should use CROSS APPLY. In this example, product parts are formatted as ...

Page 218 of 417