Tutorial by Examples

First we need to reference the Styles we want to use. <link rel="stylesheet" href="[file path]/kendo.common.min.css" /> <link rel="stylesheet" href="[file path]/kendo.[Theme].min.css" /> Now most of the controls use the [Theme], given in the a...
{!join from=personid to=id fromIndex=AddressCore}address:Address1 So if you have two cores that look like this: PersonCore - id, name AddressCore - id, address, personid This will find all PersonCore documents at a specific address
This is a shell session showing how to create a "Hello world" program and run it with Cargo: $ cargo new hello --bin $ cd hello $ cargo run Compiling hello v0.1.0 (file:///home/rust/hello) Running `target/debug/hello` Hello, world! After doing this, you can edit the progra...
It is often useful for debugging purposes to find the root cause of an error. In order to examine an error value that implements std::error::Error: use std::error::Error; let orig_error = call_returning_error(); // Use an Option<&Error>. This is the return type of Error.cause(). le...
$ git log -L 1,20:index.html commit 6a57fde739de66293231f6204cbd8b2feca3a869 Author: John Doe <[email protected]> Date: Tue Mar 22 16:33:42 2016 -0500 commit message diff --git a/index.html b/index.html --- a/index.html +++ b/index.html @@ -1,17 +1,20 @@ <!DOCTYPE HTML> ...
pass is a null statement for when a statement is required by Python syntax (such as within the body of a for or while loop), but no action is required or desired by the programmer. This can be useful as a placeholder for code that is yet to be written. for x in range(10): pass #we don't want t...
You can use an environment filter to change the author of commits. Just modify and export $GIT_AUTHOR_NAME in the script to change who authored the commit. Create a file filter.sh with contents like so: if [ "$GIT_AUTHOR_NAME" = "Author to Change From" ] then export GIT_A...
Validates a value is a valid IP address var_dump(filter_var('185.158.24.24', FILTER_VALIDATE_IP)); var_dump(filter_var('2001:0db8:0a0b:12f0:0000:0000:0000:0001', FILTER_VALIDATE_IP)); var_dump(filter_var('192.168.0.1', FILTER_VALIDATE_IP)); var_dump(filter_var('127.0.0.1', FILTER_VALIDATE_IP)); ...
Screen shot: Option 1 (pure adb) The shell adb command allows us to execute commands using a device's built-in shell. The screencap shell command captures the content currently visible on a device and saves it into a given image file, e.g. /sdcard/screen.png: adb shell screencap /sdcard/screen.png...
4.4 Recording the display of devices running Android 4.4 (API level 19) and higher: adb shell screenrecord [options] <filename> adb shell screenrecord /sdcard/demo.mp4 (press Ctrl-C to stop recording) Download the file from the device: adb pull /sdcard/demo.mp4 Note: Stop the scre...
In Python 3, PEP 404 changes the way imports work from Python 2. Implicit relative imports are no longer allowed in packages and from ... import * imports are only allowed in module level code. To achieve Python 3 behavior in Python 2: the absolute imports feature can be enabled with from __futu...
Since Unity 5.2.5 it's possible to use RuntimeInitializeOnLoadMethodAttribute to execute initialization logic bypassing MonoBehaviour order of execution. It provides a way to create more clean and robust implementation: using UnityEngine; sealed class GameDirector : MonoBehaviour { // Beca...
The reason you do not have to override Awake, Start, Update and other method is because they are not virtual methods defined in a base class. The first time your script gets accessed, the scripting runtime looks through the script to see if some methods are defined. If they are, that information is...
This function casts a ray from point origin in direction direction of length maxDistance against all colliders in the scene. The function takes in the origin direction maxDistance and calculate if there is a collider in front of the GameObject. Physics.Raycast(origin, direction, maxDistance); F...
Example method in controller @RequestMapping(value = "/test") public String showCheckbox(Model model) { boolean myBooleanVariable = false; model.addAttribute("myBooleanVariable", myBooleanVariable); return "sample-checkbox"; } View: sample-checkbox....
To forbid null values in your table columns, add the :null parameter to your migration, like this: class AddPriceToProducts < ActiveRecord::Migration def change add_column :products, :float, null: false end end
You may want to nest cached fragments inside other cached fragments. This is called Russian doll caching. The advantage of Russian doll caching is that if a single product is updated, all the other inner fragments can be reused when regenerating the outer fragment. As explained in the previous sec...
Query caching is a Rails feature that caches the result set returned by each query. If Rails encounters the same query again for that request, it will use the cached result set as opposed to running the query against the database again. For example: class ProductsController < ApplicationControl...
In order to have google maps work properly with turbolinks, add the javascript tag directly to the layout header rather than including it in a view. # app/views/layouts/my_layout.html.haml !!! %html{:lang => 'en'} %head - # ... = google_maps_api_script_tag The google_maps_api_s...
Suppose, your users and/or groups have profiles and you want to display address profile fields on a google map. # app/models/profile_fields/address.rb class ProfileFields::Address < ProfileFields::Base # Attributes: # label, e.g. "Work address" # value, e.g. "Willy-Bran...

Page 364 of 1336