Tutorial by Examples: l

Here is an example of usage with a database. On the page where the CAPTCHA will be shown you'll have something like this: $this->load->helper('captcha'); $vals = array( 'img_path' => './captcha/', 'img_url' => 'http://example.com/captcha/' ); $cap = create_captc...
It's a common request to be able to handle a double-click on a row in a RadGridView. The solution proposed by Telerik (http://demos.telerik.com/silverlight/#GridView/ClickEvents ) is based around code behind: this.grid.AddHandler(GridViewCellBase.CellDoubleClickEvent, new EventHandler<RadRouted...
Packages are collections of R functions, data, and compiled code in a well-defined format. Public (and private) repositories are used to host collections of R packages. The largest collection of R packages is available from CRAN. Some of the most popular R machine learning packages are the following...
from sklearn import svm X = [[1, 2], [3, 4]] #Training Samples y = [1, 2] #Class labels model = svm.SVC() #Making a support vector classifier model model.fit(X, y) #Fitting the data clf.predict([[2, 3]]) #After fitting, new data can be classified by using predict()
Intercepted method: public class ExampleService implements Example { @MyAnnotation public doHomework() { System.out.println("working"); } } Annotation: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface MyAnnotation {} ...
These three map functions are equivalent, so use the variation that your team finds most readable. val numberNames = Map(1 -> "One", 2 -> "Two", 3 -> "Three") // 1. No extraction numberNames.map(it => s"${it._1} is written ${it._2}" ) // 2....
Let's say, we have an array: Item = {-1, 0, 3, 6}. We want to construct SegmentTree array to find out the minimum value in a given range. Our segment tree will look like: The numbers below the nodes show the indices of each values that we'll store in our SegmentTree array. We can see that, to sto...
Import libraries (language dependency: python 2.7) import tensorflow as tf import numpy as np from sklearn.datasets import fetch_mldata from sklearn.model_selection import train_test_split load data, prepare data mnist = fetch_mldata('MNIST original', data_home='./') print "MNIST data,...
There are many online video tutorials for maya, python and pyqt. Which will give you access to some in depth knowledge of maya and python programming in maya. Some are covered with pyqt also. Here is some and feel free to add more here. https://www.udemy.com/python-for-maya/learn/v4/overview By D...
Collection Operators can be used in a KVC key path to perform an operation on a “collection-type” property (i.e. NSArray, NSSet and similar). For example, a common operation to perform is to count the objects in a collection. To achieve this, you use the @count collection operator: self.array = @[@...
Most of the time we like to get the total number of occurrence of a column value in a table for example: TABLE NAME : REPORTS ReportNameReportPriceTest10.00 $Test10.00 $Test10.00 $Test 211.00 $Test10.00 $Test 314.00 $Test 314.00 $Test 4100.00 $ SELECT ReportName AS REPORT ...
public class SimpleLoginView extends CustomComponent implements View, Button.ClickListener { public static final String NAME = "login"; private final TextField user; private final PasswordField password; private final Button loginButton; public SimpleLoginView() { setS...
public class SimpleLoginUI extends UI { @Override protected void init(VaadinRequest request) { // // Create a new instance of the navigator. The navigator will attach // itself automatically to this view. // new Navigator(this, this); // // The initial log ...
public class SimpleLoginMainView extends CustomComponent implements View { public static final String NAME = ""; Label text = new Label(); Button logout = new Button("Logout", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { ...
In C++, code must be declared or defined before usage. For example, the following produces a compile time error: int main() { foo(2); // error: foo is called, but has not yet been declared } void foo(int x) // this later definition is not known in main { } There are two ways to resolve...
Here a Turtle Graphics Ninja Twist: import turtle ninja = turtle.Turtle() ninja.speed(10) for i in range(180): ninja.forward(100) ninja.right(30) ninja.forward(20) ninja.left(60) ninja.forward(50) ninja.right(30) ninja.penup() ninja.setposit...
The following Codes can be found from Weka course Given iris.arff is loaded in weka, inside Weka Explorer's R console or Weka KnowledgeFlow's R Scripting, you can play with the following codes to make beautiful plots: library(ggplot2) ggplot(rdata, aes(x = petallength)) + geom_density() ...
Implement ICloneable in a class with a twist. Expose a public type safe Clone() and implement object Clone() privately. public class Person : ICloneable { // Contents of class public string Name { get; set; } public int Age { get; set; } // Constructor public Person(string...
The implementation of ICloneable for a struct is not generally needed because structs do a memberwise copy with the assignment operator =. But the design might require the implementation of another interface that inherits from ICloneable. Another reason would be if the struct contains a reference t...
type Props = { posts: Array<Article>, dispatch: Function, children: ReactElement } const AppContainer = ({ posts, dispatch, children }: Props) => ( <div className="main-app"> <Header {...{ posts, dispatch }} /> {children} </...

Page 655 of 861