Tutorial by Examples

C++11 offers tools that enhance the functionality of RAII-encapsulated OpenGL objects. Without C++11 features like move semantics, such objects would have to be dynamically allocated if you want to pass them around, since they cannot be copied. Move support allows them to be passed back and forth li...
PermissionUtil is a simple and convenient way of asking for permissions in context. You can easily provide what should happen in case of all requested permissions granted (onAllGranted()), any request was denied (onAnyDenied()) or in case that a rational is needed (onRational()). Anywhere in your A...
By default, routes only respond to GET requests. You can change this behavior by supplying the methods argument to the route() decorator. from flask import request @app.route('/login', methods=['GET', 'POST']) def login(): if request.method == 'POST': do_the_login() else: ...
A feature that has near zero variance is a good candidate for removal. You can manually detect numerical variance below your own threshold: data("GermanCredit") variances<-apply(GermanCredit, 2, var) variances[which(variances<=0.0025)] Or, you can use the caret package to find...
If a feature is largely lacking data, it is a good candidate for removal: library(VIM) data(sleep) colMeans(is.na(sleep)) BodyWgt BrainWgt NonD Dream Sleep Span Gest 0.00000000 0.00000000 0.22580645 0.19354839 0.06451613 0.06451613 0.06451613 Pred ...
Closely correlated features may add variance to your model, and removing one of a correlated pair might help reduce that. There are lots of ways to detect correlation. Here's one: library(purrr) # in order to use keep() # select correlatable vars toCorrelate<-mtcars %>% keep(is.numeric) ...
By default all enum values are resolved to numbers. Let's say if you have something like enum MimeType { JPEG, PNG, PDF } the real value behind e.g. MimeType.PDF will be 2. But some of the time it is important to have the enum resolve to a different type. E.g. you receive the value fr...
Create groovy file by path $JENKINS_HOME/init.groovy.d/basic-security.groovy In Ubuntu 16 Jenkins home directory places in /var/lib/jenkins Place in file next code #!groovy import jenkins.model.* import hudson.security.* def instance = Jenkins.getInstance() def hudsonRealm = new...
Open Jenkins default config file and add in JAVA_ARGS next key -Djenkins.install.runSetupWizard=false In Ubuntu 16 default file places in /etc/default/jenkins Create groovy file by path $JENKINS_HOME/init.groovy.d/basic-security.groovy In Ubuntu 16 Jenkins home directory places in /var/li...
(This assumes MySQL has been installed and that sudo is being used.) Generating a CA and SSL keys Make sure OpenSSL and libraries are installed: apt-get -y install openssl apt-get -y install libssl-dev Next make and enter a directory for the SSL files: mkdir /home/ubuntu/mysqlcerts cd /home...
If you want to match a backslash in your regular expression, you'll have to escape it. Backslash is an escape character in regular expressions. You can use '\\' to refer to a single backslash in a regular expression. However, backslash is also an escape character in Java literal strings. To make a...
The update pattern in D3 version 3 A correct understanding of how the “enter”, “update” and “exit” selections work is fundamental for properly changing the dataviz using D3. Since D3 version 3 (actually, since version 2), this snippet could set the transitions for both “enter” and “update” selecti...
Use the ls() commands to find objects by name: freds = cmds.ls("fred") #finds all objects in the scene named exactly 'fred', ie [u'fred', u'|group1|fred'] Use * as a wildcard: freds = cmds.ls("fred*") # finds all objects whose name starts with 'fred' # [u'fred', u'freder...
Using canvas elements HTML provides the canvas element for building raster-based images. First build a canvas for holding image pixel information. var canvas = document.createElement('canvas'); canvas.width = 500; canvas.height = 250; Then select a context for the canvas, in this case two-di...
To add the BottomNavigationView follow these steps: Add in your build.gradle the dependency: compile 'com.android.support:design:25.1.0' Add the BottomNavigationView in your layout: <android.support.design.widget.BottomNavigationView xmlns:android="http://schemas.andro...
The web server serves the user based on the request sent by the browser but how the user will tell the browser what he/she is looking for, that's when we need URL. Every web page on the internet has got a URL that can be bookmarked, copied, shared, and saved for future reference. In single page Back...
<!DOCTYPE HTML> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/> <script type="text/javascript" charset="utf-8" src="c...
To externalise a distributed systems configuration Spring Cloud Config provides server and client-side support needed for externalising and centralising your configuration. To get started quickly you could use Spring Initializr to bootstrap your server. Add the Config Server dependency to automatic...
To get started quickly you could use Spring Initializr to bootstrap your client. Add the Config Client to automatically generate a project with the needed dependencies. Or you could add the dependency manually to an existing Spring Cloud application. <dependency> <groupId>org.spri...
Detailed instructions on getting lambda set up or installed.

Page 1000 of 1336