Tutorial by Examples: e

This will teach you how to make your first project using IDEA. Launch IDEA, and click Create New Project from the startup screen: Click Next on the next screen. We're creating a simple Java project, so we don't need any addons or extras to this project Use the next screen to create the Java H...
A series is a one-dimension data structure. It's a bit like a supercharged array, or a dictionary. import pandas as pd s = pd.Series([10, 20, 30]) >>> s 0 10 1 20 2 30 dtype: int64 Every value in a series has an index. By default, the indices are integers, running fro...
function isEven(n:Number):Boolean { return ((n & 1) == 0); } Examples: isEven(1); // false isEven(2); // true isEven(1.1); // false isEven(1.2); // false isEven(2.1); // true isEven(2.2); // true
function isOdd(n:Number):Boolean { return ((n & 1) == 1); } Examples: isOdd(1); // true isOdd(2); // false isOdd(1.1); // true isOdd(1.2); // true isOdd(2.1); // false isOdd(2.2); // false
Simple example of how to create a custom plugin and DSL for your gradle project. This sample uses one of the three possible ways of creating plugins. The three ways are: inline buildSrc standalone plugins This example shows creating a plugin from the buildSrc folder. This sample will crea...
You can destructure nested vectors: (def my-vec [[1 2] [3 4]]) (let [[[a b][c d]] my-vec] (println a b c d)) ;; 1 2 3 4
Detailed instructions on getting openerp set up or installed in Debian/Ubuntu. To install from source code, we need Python 2.7, Git and a PostgreSQL database: $ sudo apt-get install git python-pip python2.7-dev -y $ sudo apt-get install postgresql -y $ sudo su -c "createuser -s $(whoami)&qu...
var alphabet:Vector.<String> = new <String>[ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", &q...
6.0 Since C# 6.0 it is possible to use string interpolation in place of String.Format. string name = "John"; string lastname = "Doe"; Console.WriteLine($"Hello {name} {lastname}!"); Hello John Doe! More examples for this under the topic C# 6.0 features: Stri...
The Flex compiler (mxmlc) is one of the most important parts of the Flex SDK. You can edit AS3 code in any text editor you like. Create a main class file that extends from DisplayObject. You can trigger builds at the command line as follows: mxmlc -source-path="." -default-size [width in...
To round a value to the nearest multiple of x: function roundTo(value:Number, to:Number):Number { return Math.round(value / to) * to; } Example: roundTo(8, 5); // 10 roundTo(17, 3); // 18
Imagine the following XML: <root> <element>hello</element> <another> hello </another> <example>Hello, <nested> I am an example </nested>.</example> </root> The following XPath expression: //*[text() = 'hel...
To make a Haskell program executable you must provide a file with a main function of type IO () main :: IO () main = putStrLn "Hello world!" When Haskell is compiled it examines the IO data here and turns it into a executable. When we run this program it will print Hello world!. If y...
Output some information about a known remote: origin git remote show origin Print just the remote's URL: git config --get remote.origin.url With 2.7+, it is also possible to do, which is arguably better than the above one that uses the config command. git remote get-url origin
List all the existing remotes associated with this repository: git remote List all the existing remotes associated with this repository in detail including the fetch and push URLs: git remote --verbose or simply git remote -v
The static method Date.now returns the number of milliseconds that have elapsed since 1 January 1970 00:00:00 UTC. To get the number of milliseconds that have elapsed since that time using an instance of a Date object, use its getTime method. // get milliseconds using static method now of Date co...
This command is useful if you want to serve a single site in a directory and not the entire directory. cd ~/Projects/my-blog/ valet link awesome-blog Valet will create a symbolic link in ~/.valet/Sites which points to your current working directory. After running the link command, you can acce...
cd ~/Projects valet park This command will register your current working directory as a path that Valet should search for sites. Now, any Laravel project you create within your "parked" directory will automatically be served using the http://folder-name.dev convention.
In a Service Provider register method we can bind an interface to an implementation: public function register() { App::bind( UserRepositoryInterface::class, EloquentUserRepository::class ); } From now on, everytime the app will need an instance of UserRepositoryInterface, Larave...
We can use the Service Container as a Registry by binding an instance of an object in it and get it back when we'll need it: // Create an instance. $john = new User('John'); // Bind it to the service container. App::instance('the-user', $john); // ...somewhere and/or in another class... ...

Page 206 of 1191