Tutorial by Examples: agg

Tagging an image is useful for keeping track of different image versions: docker tag ubuntu:latest registry.example.com/username/ubuntu:latest Another example of tagging: docker tag myApp:1.4.2 myApp:latest docker tag myApp:1.4.2 registry.example.com/company/myApp:1.4.2
Counting rows based on a specific column value: SELECT category, COUNT(*) AS item_count FROM item GROUP BY category; Getting average income by department: SELECT department, AVG(income) FROM employees GROUP BY department; The important thing is to select only columns specified in the GRO...
Suppose you have a hot observable for which you would love to keep the count of. It could be the IObservable<StockTick> and you want to keep count of the average trade volume. You can use Scan for that. var tradeVolume = stockTicks.Select(e => e.Price) .Scan(0.0m, (aggregated, newtick...
This code is to add and remove a value from a flagged enum-instance: [Flags] public enum MyEnum { Flag1 = 1 << 0, Flag2 = 1 << 1, Flag3 = 1 << 2 } var value = MyEnum.Flag1; // set additional value value |= MyEnum.Flag2; //value is now Flag1, Flag2 value...
Create your RecyclerView in your layout xml file: <android.support.v7.widget.RecyclerView android:id="@+id/recycleView" android:layout_width="match_parent" android:layout_height="match_parent" /> Create your Model...
Using the Library Database, we try to find the last book added to the database for each author. For this simple example we assume an always incrementing Id for each record added. SELECT MostRecentBook.Name, MostRecentBook.Title FROM ( SELECT Authors.Name, Books.Title, ...
Andrew Mao's solution. Average Aggregation Queries in Meteor Meteor.publish("someAggregation", function (args) { var sub = this; // This works for Meteor 0.6.5 var db = MongoInternals.defaultRemoteCollectionDriver().mongo.db; // Your arguments to Mongo's aggregation...
The Database Layer First, we want to set up the Data Distribution Protocol, to make sure that we can persist data to the database, and get it to the client. Three files need to be created... one on the server, one on the client, and one shared between both. // client/subscriptions.js Meteor.subsc...
Components define their own Messages, sent after emitted DOM Events, eg. CounterMsg from Parent-child communication type CounterMsg = Increment | Decrement | Reset The view of this component will send messages of CounterMsg type, therefore the view type signature is Html CounterMs...
Due to not being Excel-VBA exclusive contents this Example has been moved to VBA documentation. Link: Jagged Arrays (Arrays of Arrays)
Jagged Arrays NOT Multidimensional Arrays Arrays of Arrays(Jagged Arrays) are not the same as Multidimensional Arrays if you think about them visually Multidimensional Arrays would look like Matrices (Rectangular) with defined number of elements on their dimensions(inside arrays), while Jagged arra...
Since the release of Gradle 2.2, the use of the android-apt plugin is no longer used. The following method of setting up Dagger 2 should be used. For older version of Gradle, use the previous method shown below. For Gradle >= 2.2 dependencies { // apt command comes from the android-apt plu...
Using the mouse to drag an SVG element (or group of elements) can be accomplished by: Adding mousedown handler to starts the drag: adding a translation on the element to use during dragging (if needed), tracking mousemove events, and adding a mouseup handler to end the drag. During mousemove, tr...
The pipe (%>%) operator could be used in combination with dplyr functions. In this example we use the mtcars dataset (see help("mtcars") for more information) to show how to sumarize a data frame, and to add variables to the data with the result of the application of a function. librar...
What is a "Shape"? You typically save your shapes by creating a JavaScript "shape" object representing each shape. var myCircle = { x:30, y:20, radius:15 }; Of course, you're not really saving shapes. Instead, you're saving the definition of how to draw the shapes. Then put...
Most Canvas drawings are either rectangular (rectangles, images, text-blocks) or circular (circles). Circles & rectangles have mathematical tests to check if the mouse is inside them. This makes testing circles and rectangles easy, quick and efficient. You can "hit-test" hundreds of c...
See this Example for a general explanation of dragging Shapes around the Canvas. This annotated example shows how to drag images around the Canvas // canvas related vars var canvas=document.createElement("canvas"); var ctx=canvas.getContext("2d"); canvas.width=378; canvas.h...
Description The SQL standard provides two additional aggregate operators. These use the polymorphic value "ALL" to denote the set of all values ​​that an attribute can take. The two operators are: with data cube that it provides all possible combinations than the argument attributes o...
You can concatenate strings separated by delimiter using the string_agg() function. If your individuals table is: NameAgeCountryAllie15USAAmanda14USAAlana20Russia You could write SELECT ... GROUP BY statement to get names from each country: SELECT string_agg(name, ', ') AS names, country FROM ...
=QUERY(QUERY(A1:D6,"select C,SUM(D) group by C",1),"select Col2>0",1)

Page 2 of 4