Tutorial by Examples: c

library(dplyr) library(nycflights13) There are several verbs most commonly used in dplyr to modify datasets. select Select tailnum, type, model variables from the dataframe planes: select(planes, tailnum, type, model) ## # A tibble: 3,322 × 3 ## tailnum type mode...
interface Mockable { bool DoSomething(); } var mock = new Mock<Mockable>(); mock.Setup(x => x.DoSomething()).Returns(true); var result = mock.Object.DoSomething(); //true
public class BasicJavaBean implements java.io.Serializable{ private int value1; private String value2; private boolean value3; public BasicJavaBean(){} public void setValue1(int value1){ this.value1 = value1; } public int getValue1(){ ...
Adding a icon to your tray-bar let tray = null; let mainWindow = null; let user = null; app.on('ready', () => { /** * Tray related code. */ const iconName = 'icon.png'; const iconPath = path.join(__dirname, iconName); tray = new Tray(iconPath); tray.setT...
Helper functions are used in conjunction with select to identify variables to return. Unless otherwise noted, these functions expect a string as the first parameter match. Passing a vector or another object will generate an error. library(dplyr) library(nycflights13) starts_with starts_with al...
One needs the predicted probabilities in order to calculate the ROC-AUC (area under the curve) score. The cross_val_predict uses the predict methods of classifiers. In order to be able to get the ROC-AUC score, one can simply subclass the classifier, overriding the predict method, so that it would a...
In Controller: $this->load->model('your_model'); $data['model'] = $this->your_model; In view: $model->your_method;
You must to add to web.xml a configuration tag like this: <context-param> <param-name>facelets.SKIP_COMMENTS</param-name> <param-value>true</param-value> </context-param> Now you can use normal HTML comments tag <!-- and --> <!-- <...
First lets create a vector called Vector1: set.seed(123) Vector1 <- rnorm(20) And add missing data to it: set.seed(123) Vector1[sample(1:length(Vector1), 5)] <- NA Now we can use the is.na function to subset the Vector Vector1 <- Vector1[!is.na(Vector1)] Now the resulting vect...
There might be times where you have a data frame and you want to remove all the rows that might contain an NA value, for that the function complete.cases is the best option. We will use the first 6 rows of the airquality dataset to make an example since it already has NAs x <- head(airquality) ...
A constant expression is an expression that yields a primitive type or a String, and whose value can be evaluated at compile time to a literal. The expression must evaluate without throwing an exception, and it must be composed of only the following: Primitive and String literals. Type ca...
ll | grep ^- | awk -F"." '{print $2 "." $3}' | awk -F":" '{print $2}' | awk '{$1=""; print $0}' | cut -c2- | awk -F"." '{print "mkdir ""$1"";mv ""$1"."$2"" ""$1"""}' >...
In Apache Spark while doing shuffle operations like join and cogroup a lot of data gets transferred across network. Now, to control the number of partitions over which shuffle happens can be controlled by configurations given in Spark SQL. That configuration is as follows: spark.sql.shuffle.partiti...
git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' \ --prune-empty --tag-name-filter cat -- --all Add your file with sensitive data to .gitignore to ensure that you don't accidentally commit it again. echo "YOUR-FILE-WITH-SE...
BFG Repo cleaner is an alternative to git filter-branch. It can be used to remove sensitive data or large files that were committed wrongly like binaries compiled from the source. It is written in Scala. Project website: BFG Repo Cleaner Requirements The Java Runtime Environment (Java 7 or above ...
Objects become eligible for garbage collection (GC) if they are no longer reachable by the main entry point(s) in a program. GC is usually not performed explicitly by the user, but to let the GC know an object is no longer needed a developer can: Dereference / assign null someFunction { var ...
Normally the jvm's garbage collection (gc) is transparent to the user (developer/engineer). GC tuning is normally not required unless the user faces a memory leak or has an application that requires large amount of memory - both of which eventually lead to an out-of-memory exception which compels t...
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Background.png"]];
1- Define Your own custom Block typedef void(^myCustomCompletion)(BOOL); 2- Create custom method which takes your custom completion block as a parameter. -(void) customMethodName:(myCustomCompletion) compblock{ //do stuff // check if completion block exist; if we do not check it will ...
The sync() method reads and fetched the model data Backbone.sync = function(method, model) { document.write("The state of the model is:"); document.write("<br>"); //The 'method' specifies state of the model document.write(method +...

Page 656 of 826