Tutorial by Examples: and

Theme: A theme is required for material components to work properly within the application. Angular Material 2 provides four prebuilt themes: deeppurple-amber indigo-pink pink-bluegrey purple-green If you are using Angular CLI, you can import one of the prebuilt themes in style.css. @i...
Let's assume we have a Dogs application, then our model will be a Dog class. DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child("dogs"); This is how to send a Dog to the database, a new unique dog and set the dog with the key. String key = reference.push...
Using the dynamic variable %Random%, we can get a random integer from 0 to 32767. For example: echo %random% This obviously, returns an integer from 0 to 32767. But sometimes we want it to be in a specific range, say from 1 to 100. Generating Random Numbers Within Specific Range The basic me...
Unfortunately, batch does not have a built-in method to generate alphabets, but using %random% and for loop, we can 'generate' alphabets. This is a simple idea of how this works. set /a result=(%random%*26/32768)+1 for /f "tokens=%result%" %%I in ("A B C D E F G H I J K L M N O P...
The below example uses Android.Runtime.InputStreamInvoker and Android.Runtime.OutputStreamInvoker types obtain Java.IO.InputStream and Java.IO.OutputStream. Once we have a Java.IO.InputStream instance, we can use its .Available() method to get the number of available response bytes which we can use...
This example shows how to to display specific property in dropdown but bind with the whole object. autocomplete-overview-example.html: <md-input-container> <input mdInput placeholder="State" [(ngModel)]="selection" [mdAutocomplete]="auto" [formCo...
In iTunes Connect, click iTunes Connect in the top left corner of the window to get back to the main menu. Select Users and Roles, then click the Sandbox Testers tab. Click + next to the “Tester” title. Fill out the information and click Save when you’re done. You can make up a first and last nam...
The Boolean operators || and && will "short circuit" and not evaluate the second parameter if the first is true or false respectively. This can be used to write short conditionals like: var x = 10 x == 10 && alert("x is 10") x == 10 || alert("x is not 1...
Pseudorandom Distribution Accorinding to this Stack Overflow answer, user CherryDT pointed out this code: set /a num=%random% %% 100 does not give a uniform distribution. The internal dynamic variable %random% does gives a uniform distribution, but the above code will not be a uniformed random...
Handy method to initialise SolrJ client based on configuration properties; private void initSolrClient() { if (conf.kerberos().isEnabled()) { System.setProperty("java.security.auth.login.config", conf.kerberos().confPath()); HttpClientUtil.addConfigurer(new Krb5Http...
PSR-1 is an accepted recommendation and outlines a basic standard recommendation for how code should be written. It outlines naming convetions for classes, methods and constants. It makes adopting PSR-0 or PSR-4 recommendations a requirement. It indicates which PHP tags to use: <?php and &lt...
This is a compact guide about how to quickly create an R package from your code. Exhaustive documentations will be linked when available and should be read if you want a deeper knowledge of the situation. See Remarks for more resources. The directory where your code stands will be refered as ./, an...
In this example, three brief and comprehensive sub-examples are presented: Loading weights from available pre-trained models, included with Keras library Stacking another network for training on top of any layers of VGG Inserting a layer in the middle of other layers Tips and general rule-of-t...
To generate json user model with username, password_hash, email_id, created_at, updated_at, type mix phoenix.gen.json User users username:string email_id:string password_hash:string timestamps()
np.save and np.load provide a easy to use framework for saving and loading of arbitrary sized numpy arrays: import numpy as np a = np.random.randint(10,size=(3,3)) np.save('arr', a) a2 = np.load('arr.npy') print a2
To remove whitespace (spaces, tabs, newlines…) between HTML tags use spaceless tag: {% spaceless %} <div> <span>foo bar </span> </div> {% endspaceless %} {# produces output <div><strong>foo bar </strong></div> #} If you need ...
This is an example to explain the variations of load events. onload event <body onload="someFunction()"> <img src="image1" /> <img src="image2" /> </body> <script> function someFunction() { console.log("Hi! I am l...
This example grabs the Node.gitignore file from GitHub's gitignore repository, downloads it to your current working directory and renames it to .gitignore - all very typical actions for someone starting a new node.js project. $ curl http://github.com/github/gitignore/raw/master/Node.gitignore -o .g...
Using Intents to Load the Image from Gallery. Initially you need to have the permission <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> Use the Following Code to have the layout as designed follows. <?xml version="1.0" enco...
ng-repeat is the built-in directive provided by AngularJS, mostly used for listing the array elements on UI dynamically as per the changes in our model. Official "ng-repeat" docs can be found at : https://docs.angularjs.org/api/ng/directive/ngRepeat Also the most common error faced whil...

Page 152 of 153