Tutorial by Examples: amp

package main import ( "fmt" "log" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) type Person struct { Name string Phone string } func main() { session, err := mgo.Dial("server1.example....
;; returns 3 (+ 1 2) ;; returns 300 (+ 50 210 40) ;; returns 2 (/ 8 4)
app.module.ts import {routes} from "./app.routes"; @NgModule({ declarations: [AppComponent], imports: [BrowserModule, mainModule.forRoot(), RouterModule.forRoot(routes)], providers: [], bootstrap: [AppComponent] }) export class AppModule { } app.routes.t...
The following code illustrates how to do simple popup with Kivy. from kivy.app import App from kivy.uix.popup import Popup from kivy.lang import Builder from kivy.uix.button import Button Builder.load_string(''' <SimpleButton>: on_press: self.fire_popup() <SimplePopup>: ...
Follow following steps to try out a sample application on AWS ECS service as a proof of concept. Login to AWS management console and go to AWS service catalog - > Compute - > Ec2 Create a VM(EC2 instance) using amazon linux 64 bit OS, this we will use to configure docker, git, AWS ECS agen...
Online demo is here: http://ext4all.com/post/extjs-4-mvc-application-architecture.html Define a model: // /scripts/app/model/User.js Ext.define('AM.model.User', { extend: 'Ext.data.Model', fields: ['id', 'name', 'email'] }); Define a store with proxy: // /scripts/app/store/Users.js...
A simple sports2000 example: FIND FIRST Customer NO-LOCK WHERE CustNum = 1 NO-ERROR. IF AVAILABLE Customer THEN DO: DISPLAY Customer.NAME. END. ELSE DO: MESSAGE "No record available". END. FIRST - find the first record that matches the query NO-LOCK - don't lock the r...
var alertResult = await DisplayAlert("Alert Title", Alert Message, null, "OK"); if(!alertResult) { //do your stuff. } Here we will get Ok click action.
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...
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...
In addition to peoples.csv (see simple aggregation from a CSV) we have two more CSVs representing products and sales. sales.csv (people_id, product_id): 19,5 6,4 10,4 2,4 8,1 19,2 8,4 5,5 13,5 4,4 6,1 3,3 8,3 17,2 6,2 1,2 3,5 15,5 3,3 6,3 13,2 20,4 20,2 products.csv (id, n...
Parent component : import {Component} from '@angular/core'; @Component({ selector: 'parent-component', templateUrl: './parent-component.html' }) export class ParentComponent { users : Array<User> = []; changeUsersActivation(user : User){ user.changeButtonState(); } ...
Hello friends before start code we have need to declare dependency for access firebase ui component, so here is the dependency which you can put it in your gradel other wise you can add dependency as jar also. compile 'com.firebaseui:firebase-ui-database:0.4.0' Then after we are querying in fire...
An XSD that describe a contact information about a company is given below. <?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://NamespaceTest.com/CommonTypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" ...
First, let's create a template to be rendered! p Hello World, #{name}! Save this in a file ending with the .pug extension (you can call it anything you like, but we will use view.pug in the following code to compile it). All that's left to do, now, is compile that template! Create a JS script f...
function cryptPassword(password, callback) { bcrypt.genSalt(SALT_WORK_FACTOR, function(err, salt) { if (err) return callback(err); bcrypt.hash(password, salt, null, function(err, hash) { return callback(err, hash); }); }); } User.beforeCreate((user, options, ...
User.beforeCreate(function(user, options) { return hashPassword(user.password).then(function (hashedPw) { user.password = hashedPw; }); })
FlinkKafkaConsumer let's you consume data from one or more kafka topics. versions The consumer to use depends on your kafka distribution. FlinkKafkaConsumer08: uses the old SimpleConsumer API of Kafka. Offsets are handled by Flink and committed to zookeeper. FlinkKafkaConsumer09: uses the new ...
To use a custom schema, all you need to do is implement one of the SerializationSchema or DeserializationSchema interface. public class MyMessageSchema implements DeserializationSchema<MyMessage>, SerializationSchema<MyMessage> { @Override public MyMessage deserialize(byte[]...

Page 34 of 46