Tutorial by Examples

Assume your data examples are already read to a python's variable and you would like to read it n times, in batches of given size: import numpy as np import tensorflow as tf data = np.array([1, 2, 3, 4, 5]) n = 4 To merge data in batches, possibly with random shuffling, you can use tf.train.b...
The following are the steps that you will need to follow to setup mysql datasource in JBoss AS 7. Download the MySQL jdbc zip file from here: Create a directory mysql inside /jboss-as-7.1.1.Final/modules/com Inside that create a directory structure like the following: /jboss-as-7.1.1.Final/m...
OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. It was built for various purpose such as machine learning, computer vision, algorithm, mathematical operations, video capturing, image processing etc. Over the years it has become ve...
Objective C: view.backgroundColor = [UIColor redColor]; Swift: view.backgroundColor! = UIColor.redColor() Swift 3 view.backgroundColor = UIColor.redColor
The <header> element represents introductory content for its nearest ancestor sectioning content or sectioning root element. A <header> typically contains a group of introductory or navigational aids. Note: The header element is not sectioning content; it doesn’t introduce a new secti...
The <footer> element contains the footer part of the page. Here is an example for <footer> element that contain p paragraph tag. <footer> <p>All rights reserved</p> </footer>
local collections are not allowed in select statements. Hence the first step is to create a schema level collection. If the collection is not schema level and being used in SELECT statements then it would cause "PLS-00642: local collection types not allowed in SQL statements" CREATE OR R...
When mapping our entities to database table names we rely on a @Table annotation. But if we have a naming convention for our database table names, we can implement a custom physical naming strategy in order to tell hibernate to calculate table names based on the names of the entities, without explic...
from flask import Flask, render_template, redirect, url_for app = Flask(__name__) @app.route('/') def main_page(): return render_template('main.html') @app.route('/main') def go_to_main(): return redirect(url_for('main_page'))
# ... # same as above @app.route('/welcome/<name>') def welcome(name): return render_template('main.html', name=name) @app.route('/login', methods=['GET', 'POST']) def login(): if request.method == 'POST': # ... # check for valid login, assign username ...
Multiton can be used as a container for singletons. This is Multiton implementation is a combination of Singleton and Pool patterns. This is an example of how common Multiton abstract Pool class can be created: abstract class MultitonPoolAbstract { /** * @var array */ protec...
This pattern can be used to contain a registered Pools of Singletons, each distinguished by unique ID: abstract class MultitonRegistryAbstract { /** * @var array */ protected static $instances = []; /** * @param string $id */ final protected function ...
In bash, you have to quote arguments in order to preserve white space: # bash function print_first_argument { echo "$1" } argument="has white space" print_first_argument "$argument" In Zsh, you don't need the quotes, because of different evaluation orde...
To use auto layout we need to enable a boolean flag in storyboard. Its shown in the below image. After this we can use auto layout in our storyboard. There is another option if we want to use size classes or not. Size class is also a helpful option in auto layout which helps us to design for differe...
A pattern rule is indicated by a single % character in the target. The % matches a non-empty string called the stem. The stem is then substituted for every % that appears in the prerequisite list. For example, this rule: %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ Will match any target ending ...
If a target matches multiple pattern rules, make will use the one whose prerequisites exist or can be built. For example: %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ %.o: %.s $(AS) $(ASFLAGS) $< -o $@ Will compile foo.c to foo.o or assemble foo.s to foo.o, depending on which one of foo...
If the target pattern doesn't contain slashes, make will remove the directory part from the target it's trying to build before matching. The directory will then be put in front of the stem. When the stem is used to build the target name and prerequisites, the directory part is stripped from it, the ...
Pattern rules can have multiple targets but, unlike normal rules, the recipe is responsible for making all the targets. For example: debug/%.o release/%.o: %.c $(CC) $(CFLAGS_DEBUG) -c $< -o debug/$*.o $(CC) $(CFLAGS_RELEASE) -c $< -o release/$*.o Is a valid rule, which will buil...
Introduced in iOS 9, all endpoints must adhere to the HTTPS specification. Any endpoints not using SSL will fail with a warning in the console log. To your application it will appear that the internet connection failed. To configure exceptions: Place the following in your Info.plist file: Allow...
To enable the ripple animation in a CardView, add the following attributes: <android.support.v7.widget.CardView ... android:clickable="true" android:foreground="?android:attr/selectableItemBackground"> ... </android.support.v7.widget.CardView>

Page 931 of 1336