Tutorial by Examples: ect

Assume you've initialized a project with the following directory structure: /build app.js Then you add everything so you've created so far and commit: git init git add . git commit -m "Initial commit" Git will only track the file app.js. Assume you added a build step to your applicat...
Groovy has access to all java classes, in fact Groovy classes ARE Java classes and can be run by the JVM directly. If you are working on a Java project, using Groovy as a simple scripting language to interact with your java code is a no-brainer. To make things even better, nearly any Java class ca...
(This pitfall applies equally to all primitive wrapper types, but we will illustrate it for Integer and int.) When working with Integer objects, it is tempting to use == to compare values, because that is what you would do with int values. And in some cases this will seem to work: Integer int1_1 =...
Properties can be set when an object is instantiated. var redCar = new Car { Wheels = 2, Year = 2016, Color = Color.Red };
In the most basic form, it is possible to select a single variable from a table by calling the object's get_var method passing in an SQL query. global $wpdb; $user = $wpdb->get_var( "SELECT ID FROM $wpdb->users WHERE user_email='[email protected]'" ); It is very important to note that...
class sample{ public function __construct(){ add_action('init', array($this, 'samp') ); } public function samp(){ // must be public!! echo 'i did something'; } } new sample();
generate sample DF In [39]: df = pd.DataFrame(np.random.randint(0, 10, size=(5, 6)), columns=['a10','a20','a25','b','c','d']) In [40]: df Out[40]: a10 a20 a25 b c d 0 2 3 7 5 4 7 1 3 1 5 7 2 6 2 7 4 9 0 8 7 3 5 8 8 9 6 8 4 8 1 ...
C++11 In C++11, compilers are required to implicitly move from a local variable that is being returned. Moreover, most compilers can perform copy elision in many cases and elide the move altogether. As a result of this, returning large objects that can be moved cheaply no longer requires special ha...
Use module_info on Erlang modules you wish to inspect: iex> :math.module_info [module: :math, exports: [pi: 0, module_info: 0, module_info: 1, pow: 2, atan2: 2, sqrt: 1, log10: 1, log2: 1, log: 1, exp: 1, erfc: 1, erf: 1, atanh: 1, atan: 1, asinh: 1, asin: 1, acosh: 1, acos: 1, tanh...
Often times you will want to have events for your objects. function spanOver(d,i){ var span = d3.select(this); span.classed("spanOver",true); } function spanOut(d,i){ var span = d3.select(this); span.classed("spanOver", false); } var div = d3.select('#divID')...
Some of the additional attributes are parsed by the npm website like repository, bugs or homepage and shown in the infobox for this packages { "main": "server.js", "repository" : { "type": "git", "url": "git+https:/...
The ls command has several options that can be used together to show more information. Details/Rights The l option shows the file permissions, size, and last modified date. So if the root directory contained a dir called test and a file someFile the command: user@linux-computer:~$ ls -l Would ...
Once you have Sails installed, just type $ sails new <project_name> This will create a skeleton Sails project in a new folder called <project_name>. You can also create a new project in an empty folder by typing $ sails new
A list of references to members of a group, such as a static table of contents. <ul role="directory"> <li><a href="/chapter-1">Chapter 1</a></li> <li><a href="/chapter-2">Chapter 2</a></li> <li><a ...
Suppose you have many changes in one or more files but from each file you only want to commit some of the changes, you can select the desired changes using: git add -p or git add -p [file] Each of your changes will be displayed individually, and for each change you will be prompted to choose...
A simple context tree (containing some common values that might be request scoped and included in a context) built from Go code like the following: // Pseudo-Go ctx := context.WithValue( context.WithDeadline( context.WithValue(context.Background(), sidKey, sid), time.Now().A...
Matplotlib supports both object-oriented and imperative syntax for plotting. The imperative syntax is intentionally designed to be very close to Matlab syntax. The imperative syntax (sometimes called 'state-machine' syntax) issues a string of commands all of which act on the most recent figure or a...
First, ensure you have imported sessions from flask from flask import session To use session, a Flask application needs a defined SECRET_KEY. app = Flask(__name__) app.secret_key = 'app secret key' Sessions are implemented by default using a cookie signed with the secret key. This ensures t...
It is very rare that you'll ever want to use Select or Activate in your code, but some Excel methods do require a worksheet or workbook to be activated before they'll work as expected. If you're just starting to learn VBA, you'll often be suggested to record your actions using the macro recorder, t...
package main import ( "fmt" "io/ioutil" ) func main() { files, err := ioutil.ReadDir(".") if err != nil { panic(err) } fmt.Println("Folders in the current directory:") for _, fileInfo := range files { ...

Page 26 of 99