Tutorial by Examples: c

custom_module.info name = Custom Module description = Creates a block containing a custom output. core = 7.x custom_module.module /** * Initiates hook_block_info. * * Registers the block with Drupal. */ function custom_module_block_info() { $blocks = array(); //Registers the ...
Simple form, validation and submission functions to create a "mailing list" feature. This can then be applied to either the basic page or basic block examples. Assumes you have created a table in the drupal database called 'mailing_list' with the fields first name, last name and email ad...
Can be used in conjunction with the custom form example to create a table in the drupal database for a Mailing List feature. This example was made by creating the table directly in my development database, then created the data for hook_schema() using the Schema module. This allows for automatic t...
component file @Component({ selector: 'example-test-compnent', template: '<div> <div>{{user.name}}</div> <div>{{user.fname}}</div> <div>{{user.email}}</div> </div>' }) ex...
Requirements: NodeJS : Download page npm or yarn Run the following commands with cmd from new directory folder: npm install -g @angular/cli or yarn global add @angular/cli ng new PROJECT_NAME cd PROJECT_NAME ng serve Open your browser at localhost:4200
just use your cmd: You can use the ng generate (or just ng g) command to generate Angular components: Component: ng g component my-new-component Directive: ng g directive my-new-directive Pipe: ng g pipe my-new-pipe Service: ng g service my-new-service Class: ng g class my-new-classt...
In angular-cli.json at outDir key you can define your build directory; these are equivalent ng build --target=production --environment=prod ng build --prod --env=prod ng build --prod and so are these ng build --target=development --environment=dev ng build --dev --e=dev ng build --dev ng ...
Whenever you FIND a record you can aquire a lock of it. NO-LOCK: Used for read only operations. If you do a FIND <record> NO-LOCK you cannot in any way modify the record. FIND FIRST Customer NO-LOCK NO-ERROR. EXCLUSIVE-LOCK: Used for updates and deletes. If you do this you will "own&...
You can define multiple indices for each temp-table. If you need them - define them. Basically an index matching your query and/or sort order will help performance! DEFINE TEMP-TABLE ttWithIndex NO-UNDO FIELD field1 AS INTEGER FIELD field2 AS CHARACTER FIELD field3 AS LOGICAL IN...
@sorted = sort @list; @sorted = sort { $a cmp $b } @list; sub compare { $a cmp $b } @sorted = sort compare @list; The three examples above do exactly the same thing. If you don't supply any comparator function or block, sort assumes you want the list on its right sorted lexically. This is ...
@sorted = sort { $a <=> $b } @list; Comparing $a and $b with the <=> operator ensures they are compared numerically and not textually as per default.
This is probably the most famous example of a sort optimization making use of Perl's functional programming facilities, to be used where the sort order of items depend on an expensive function. # What you would usually do @sorted = sort { slow($a) <=> slow($b) } @list; # What you do to ma...
The traditional technique to make sort ignore case is to pass strings to lc or uc for comparison: @sorted = sort { lc($a) cmp lc($b) } @list; This works on all versions of Perl 5 and is completely sufficient for English; it doesn't matter whether you use uc or lc. However, it presents a problem ...
Host: server.example.com HTTP/1.1 GET /authorize?response_type=token&client_id=[APP_KEY]&state=[OPTIONAL_STATE] &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb&scope=[OPTIONAL_SCOPES] Source
Find VideoView in Activity and add video into it. VideoView videoView = (VideoView) .findViewById(R.id.videoView); videoView.setVideoPath(pathToVideo); Start playing video. videoView.start(); Define VideoView in XML Layout file. <VideoView android:id="@+id/videoView" ...
keytool -genkey -v -keystore my-app-key.keystore -alias my-app-alias -keyalg RSA -keysize 2048 -validity 10000 Use a password when prompted
react-native bundle --platform android --dev false --entry-file index.android.js \ --bundle-output android/app/src/main/assets/index.android.bundle \ --assets-dest android/app/src/main/res/
ensure you have java 6 or above and that the JAVA_HOME environment variable is set. download the latest flink binary here: wget flink-XXXX.tar.gz If you don't plan to work with Hadoop, pick the hadoop 1 version. Also, note the scala version you download, so you can add the correct maven...
This example is the same as WordCount, but uses the Table API. See WordCount for details about execution and results. Maven To use the Table API, add flink-table as a maven dependency: <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-table_2.11&...
Maven Add the dependencies flink-java and flink-client (as explained in the JVM environment setup example). The code public class WordCount{ public static void main( String[] args ) throws Exception{ // set up the execution environment final ExecutionEnvironment env = E...

Page 700 of 826