Tutorial by Examples

SQLite uses dynamic typing and ignores declared column types: > CREATE TABLE Test ( Col1 INTEGER, Col2 VARCHAR(2), -- length is ignored, too Col3 BLOB, Col4, -- no type required Col5 FLUFFY BUNNIES -- use whatever you want ); > ...
You define a keyword argument in a method by specifying the name in the method definition: def say(message: "Hello World") puts message end say # => "Hello World" say message: "Today is Monday" # => "Today is Monday" You can define multip...
2.1 Required keyword arguments were introduced in Ruby 2.1, as an improvement to keyword arguments. To define a keyword argument as required, simply declare the argument without a default value. def say(message:) puts message end say # => ArgumentError: missing keyword: message say ...
You can define a method to accept an arbitrary number of keyword arguments using the double splat (**) operator: def say(**args) puts args end say foo: "1", bar: "2" # {:foo=>"1", :bar=>"2"} The arguments are captured in a Hash. You can manip...
C++17 A storage class specifier that hints to the compiler that a variable will be heavily used. The word "register" is related to the fact that a compiler might choose to store such a variable in a CPU register so that it can be accessed in fewer clock cycles. It was deprecated starting ...
Returns control from a function to its caller. If return has an operand, the operand is converted to the function's return type, and the converted value is returned to the caller. int f() { return 42; } int x = f(); // x is 42 int g() { return 3.14; } int y = g(); // y is 3 If re...
A keyword that is part of certain integer type names. When used alone, int is implied, so that signed, signed int, and int are the same type. When combined with char, yields the type signed char, which is a different type from char, even if char is also signed. signed char has a range that inclu...
A type specifier that requests the unsigned version of an integer type. When used alone, int is implied, so unsigned is the same type as unsigned int. The type unsigned char is different from the type char, even if char is unsigned. It can hold integers up to at least 255. unsigned can also be ...
By "class", we mean a type that was defined using the class or struct keyword (but not enum struct or enum class). Even an empty class still occupies at least one byte of storage; it will therefore consist purely of padding. This ensures that if p points to an object of an empty class...
SQLite has no separate data type for date or time values. ISO8601 strings The built-in keywords CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP return strings in ISO8601 format: > SELECT CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP; CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP --------...
The static storage class specifier has three different meanings. Gives internal linkage to a variable or function declared at namespace scope. // internal function; can't be linked to static double semiperimeter(double a, double b, double c) { return (a + b + c)/2.0; } // exported to c...
This is very similar to using an Application subclass and overriding the attachBaseContext() method. However, using this method, you don't need to override attachBaseContext() as this is already done in the MultiDexApplication superclass. Extend MultiDexApplication instead of Application: package...
Automapper can be installed from nuget running the following command in Package Manager Console: Install-Package AutoMapper Then it can be included in different files within the project it has been installed to by using directives: using AutoMapper;
Unlike a parallel for-loop (parfor), which takes the iterations of a loop and distributes them among multiple threads, a single program, multiple data (spmd) statement takes a series of commands and distributes them to all the threads, so that each thread performs the command and stores the results....
Using Alternatives Many Linux distributions use the alternatives command for switching between different versions of a command. You can use this for switching between different versions of Java installed on a machine. In a command shell, set $JDK to the pathname of a newly installed JDK; e.g....
Given a DataFrame with MultiIndex columns # build an example DataFrame midx = pd.MultiIndex(levels=[['zero', 'one'], ['x','y']], labels=[[1,1,0,],[1,0,1,]]) df = pd.DataFrame(np.random.randn(2,3), columns=midx) In [2]: df Out[2]: one zero y x ...
Start with a standard DataFrame df = pd.DataFrame(np.random.randn(2,3), columns=['a','b','c']) In [91]: df Out[91]: a b c 0 -0.911752 -1.405419 -0.978419 1 0.603888 -1.187064 -0.035883 Now to change to MultiIndex, create a MultiIndex object and assign it to df....
MultiIndex can also be used to create DataFrames with multilevel columns. Just use the columns keyword in the DataFrame command. midx = pd.MultiIndex(levels=[['zero', 'one'], ['x','y']], labels=[[1,1,0,],[1,0,1,]]) df = pd.DataFrame(np.random.randn(6,4), columns=midx) In [86]: df Out[86]: ...
Dependencies can be added for specific product flavors in a similar fashion as build configurations. android { ... productFlavors { flavor1 { //... } flavor2 { //... } } } dependencies { flavor1Compile 'com.and...
You can use the archivesBaseName to set the name of apk. For example: defaultConfig { .... project.ext.set("archivesBaseName", "MyName-" + defaultConfig.versionName); } You will obtain this output. MyName-X.X.X-release.apk

Page 729 of 1336