Tutorial by Examples: c

The following command lists out the queries that are currently being run on the server db.currentOp() The output looks something similar to this { "inprog" : [ { "opid" : "302616759", "active" : true, &...
It is used to duplicate a git repository from gerrit to anyway. Configuration file is $GERRIT_INSTALL/etc/replication.config. Config file example to clone MyRepo from gerrit to backupServer [remote "backup"] url = ProjectUrlOnBackupServer/${name} #Example backup.some.org:/pub/git/${...
Encapsulating an OpenGL object in C++98/03 requires obeying the C++ rule of 3. This means adding a copy constructor, copy assignment operator, and destructor. However, copy constructors should logically copy the object. And copying an OpenGL object is a non-trivial undertaking. Equally importantly,...
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...
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...
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...
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...
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...
Before the Julia 0.5, there is no way to use conditions inside the array comprehensions. But, it is no longer true. In Julia 0.5 we can use the conditions inside conditions like the following: julia> [x^2 for x in 0:9 if x > 5] 4-element Array{Int64,1}: 36 49 64 81 Source of the ...
To setup JVM options inside elastic beanstalk, your bundle file must be like this: -bundle.zip |--.ebextensions //do not forget the dot at the beginning of the name |--jvm.config |--java_app.jar And, the jvm.config file must be set like this: option_settings: ...
Maximum Path Sum is an algorithm to find out a path such that sum of element(node) of that path is greater than any other path. For example, let's we have a we a triangle as shown below. 3 7 4 2 4 6 8 5 9 3 In above triangle, find the maximum path which has ma...
public class Node { public int Value; public Node Left, Right; public Node(int item) { Value = item; Left = Right = null; } } class Res { public int Val; } public class MaximumPathSum { Node _root; int FindMaxUtil(Node node, Re...

Page 622 of 826