Tutorial by Examples: comp

Given a Day, we can perform simple arithmetic and comparisons, such as adding: import Data.Time addDays 1 (fromGregorian 2000 1 1) -- 2000-01-02 addDays 1 (fromGregorian 2000 12 31) -- 2001-01-01 Subtract: addDays (-1) (fromGregorian 2000 1 1) -- 1999-12-31 addDays (-1) (fromGregorian...
With Parallel List Comprehensions language extension, [(x,y) | x <- xs | y <- ys] is equivalent to zip xs ys Example: [(x,y) | x <- [1,2,3] | y <- [10,20]] -- [(1,10),(2,20)]
A few pre-requisites in the build.gradle for vectors to work all the way down to API 7 for VectorDrawables and API 13 for AnimatedVectorDrawables (with some caveats currently): //Build Tools has to be 24+ buildToolsVersion '24.0.0' defaultConfig { vectorDrawables.useSupportLibrary = true ...
Use tf.nn.sparse_softmax_cross_entropy_with_logits, but beware that it can't accept the output of tf.nn.softmax. Instead, calculate the unscaled activations, and then the cost: logits = tf.matmul(state_below, U) + b cost = tf.nn.sparse_softmax_cross_entropy_with_logits(logits, labels) In this c...
# The following shell function will be used to generate completions for # the "nuance_tune" command. _nuance_tune_opts () { local curr_arg prev_arg curr_arg=${COMP_WORDS[COMP_CWORD]} prev_arg=${COMP_WORDS[COMP_CWORD-1]} # The "config" option takes a file arg, so ...
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...
You can expose values from JSON column as computed columns: CREATE TABLE ProductCollection ( Id int identity primary key, Data nvarchar(max), Price AS JSON_VALUE(Data, '$.Price'), Color JSON_VALUE(Data, '$.Color') PERSISTED ) If you add PERSISTED computed column, value from JSON tex...
CommandUsageaboutShort information about ComposerarchiveCreate an archive of this composer packagebrowseOpens the package's repository URL or homepage in your browser.clear-cacheClears composer's internal package cache.clearcacheClears composer's internal package cache.configSet config optionscreate...
NULL is a special case when it comes to comparisons. Assume the following data. id someVal ---- 0 NULL 1 1 2 2 With a query: SELECT id FROM table WHERE someVal = 1 would return id 1 SELECT id FROM table WHERE someVal <> 1 would return id 2 SELECT id FROM tabl...
The HTTP message body can be compressed (since HTTP/1.1). Either by the server compresses the request and adds a Content-Encoding header, or by a proxy does and adds a Transfer-Encoding header. A client may send an Accept-Encoding request header to indicate which encodings it accepts. The most com...
It is possible to compress an HTTP response message body more than once. The encoding names should then be separated by a comma in the order in which they were applied. For example, if a message has been compressed via deflate and then gzip, the header should look like: Content-Encoding: deflate, g...
The client first sends a request with an Accept-Encoding header that indicates it supports gzip: GET / HTTP/1.1\r\n Host: www.google.com\r\n Accept-Encoding: gzip, deflate\r\n \r\n The server may then send a response with a compressed response body and a Content-Encoding header that specifies...
ARRAY CREATE TABLE array_data_type( c_array array<string>) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' COLLECTION ITEMS TERMINATED BY '&'; Create data.csv with data: arr1&arr2 arr2&arr4 Put data.csv in /tmp folderand load this data in Hive LOAD DATA LOCAL I...
Ruby moves up on ancestors chain of an object. This chain can contain both modules and classes. Same rules about moving up the chain apply to modules as well. class Example end module Prepended def initialize *args return super :default if args.empty? super end end module Fi...
The @switch annotation tells the compiler that the match statement can be replaced with a single tableswitch instruction at the bytecode level. This is a minor optimization that can remove unnecessary comparisons and variable loads during runtime. The @switch annotation works only for matches again...
This creates a simple archive of a folder : tar -cf ./my-archive.tar ./my-folder/ Verbose output shows which files and directories are added to the archive, use the -v option: tar -cvf ./my-archive.tar ./my-folder/ For archiving a folder compressed 'gzip', you have to use the -z option : ta...
This is relevant for apps that implement a BootListener. Test your app by killing your app and then test with: adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME -n your.app/your.app.BootListener (replace your.package/your.app.BootListener with proper ...
lessc [options] <source> [destination] The above command is used to compile Less files in the command line. Options are the various settings that the compiler should use either during compilation or after compilation. Options include -x or --compress for compressing or minifying the output ...
using System.ComponentModel.DataAnnotations.Schema; [ComplexType] public class BlogDetails { public DateTime? DateCreated { get; set; } [MaxLength(250)] public string Description { get; set; } } public class Blog { ... public BlogDetails BlogDetail { get...
Exec sp_configure 'backup compression default',1 GO RECONFIGURE;

Page 17 of 34