Tutorial by Examples: c

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 ); > ...
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...
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...
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
-- File counter.vhd -- The entity is the interface part. It has a name and a set of input / output -- ports. Ports have a name, a direction and a type. The bit type has only two -- values: '0' and '1'. It is one of the standard types. entity counter is port( clock: in bit; -- We ...
es = Elasticsearch(hosts=hosts, sniff_on_start=True, sniff_on_connection_fail=True, sniffer_timeout=60, sniff_timeout=10, retry_on_timeout=True)
Below is example of service decorator, overriding null date returned by service. angular.module('app', []) .config(function($provide) { $provide.decorator('myService', function($delegate) { $delegate.getDate = function() { // override with actual date object return new Date(...
To remove all elements from a Map, use the .clear() method: map.clear(); Example: const map = new Map([[1, 2], [3, 4]]); console.log(map.size); // 2 map.clear(); console.log(map.size); // 0 console.log(map.get(1)); // undefined
To check if a key exists in a Map, use the .has() method: map.has(key); Example: const map = new Map([[1, 2], [3, 4]]); console.log(map.has(1)); // true console.log(map.has(2)); // false
To enable code shrinking with ProGuard, add minifyEnabled true to the appropriate build type in your build.gradle file. android { buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile(‘proguard-android.txt'), 'pro...
To enable resource shrinking, set the shrinkResources property to true in your build.gradle file. android { ... buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'p...
All libraries come with resources that are not necessary useful to your application. For example Google Play Services comes with translations for languages your own application don’t even support. You can configure the build.gradle file to specify which resource you want to keep. For example: de...
Setting the state of an object graph (a collection of related entities) to Added is different than setting a single entity as Added (see this example). In the example, we store planets and their moons: Class model public class Planet { public Planet() { Moons = new HashSet<...

Page 451 of 826