Tutorial by Examples: ti

Files written to with the w command are created/truncated before any commands are run. $ sed 'w created-file' < /dev/null && ls created-file && rm created-file created-file From the standard: Each wfile shall be created before processing begins. Implementations shall suppo...
Up navigation is done in android by adding android:parentActivityName="" in Manifest.xml to the activity tag. Basically with this tag you tell the system about the parent activity of a activity. How is it done? <uses-permission android:name="android.permission.INTERNET" ...
The following example is tested on Windows 8 pro 64-bit operating system with python 2.7 and scrapy v 1.2. Let assume that we have already installed the scrapy framework. MySQL database that we will use in the following tutorial CREATE TABLE IF NOT EXISTS `scrapy_items` ( `id` bigint(20) UNSIGN...
The System.Collections.Immutable NuGet package provides immutable collection classes. Creating and adding items var stack = ImmutableStack.Create<int>(); var stack2 = stack.Push(1); // stack is still empty, stack2 contains 1 var stack3 = stack.Push(2); // stack2 still contains only one, st...
Setup To start unit testing your Android project using JUnit you need to add the JUnit dependency to your project and you need to create a test source-set which is going to contain the source code for the unit tests. Projects created with Android Studio often already include the JUnit dependency an...
Implementation of the Caesar cipher. This implementation performs the shift operation only on upper and lower case alphabets and retains the other characters (such as space as-is). The Caesar cipher is not secure as per current standards. Below example is for illustrative purposes only ! Refer...
The HTML5 file API allows you to restrict which kind of files are accepted by simply setting the accept attribute on a file input, e.g.: <input type="file" accept="image/jpeg"> Specifying multiple MIME types separated by a comma (e.g. image/jpeg,image/png) or using wild...
The following code example implements the Caesar cipher and shows the properties of the cipher. It handles both uppercase and lowercase alpha-numerical characters, leaving all other characters as they were. The following properties of the Caesar cipher are shown: weak keys; low key space; the...
To create an explosion, the following method signatures may be used: boolean createExplosion(double x, double y, double z, float power); boolean createExplosion(double x, double y, double z, float power, boolean setFire); boolean createExplosion(double x, double y, double z, float power, ...
The following methods can be used to generate a tree naturally (as if it was grown from a sapling) into the world. boolean generateTree(Location loc, TreeType type); boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate); Location is where you want the tree to spawn ...
When working with components, such as vertices or uv points, Maya defaults to returning a colon-separated range rather than individual items: print cmds.ls('pCube1.vtx[*]') # get all the vertices in the cube # [u'pCube1.vtx[0:7]'] You can use ls with the flatten option to force Maya to expan...
Where we came from Sometimes we can't provide all of the required metadata needed for the XmlSerializer framework in attribute. Suppose we have a base class of serialized objects, and some of the derived classes are unknown to the base class. We can't place an attribute for all of the classes which...
Let's say, you have already created a segment tree. You are required to update the values of the array, this will not only change the leaf nodes of your segment tree, but also the minimum/maximum in some nodes. Let's look at this with an example: This is our minimum segment tree of 8 elements. To...
XmlView: <mvc:View controllerName="sap.m.sample.ListCounter.List" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"> <List headerText="Products" items="{products>/Products}"> <!-- Template of ...
What is tidyverse? tidyverse is the fast and elegant way to turn basic R into an enhanced tool, redesigned by Hadley/Rstudio. The development of all packages included in tidyverse follow the principle rules of The tidy tools manifesto. But first, let the authors describe their masterpiece: The t...
In normal mode: gg go to top = then G
Full list of options: ls -a list all files including hidden file starting with '.' ls --color colored list [=always/never/auto] ls -d list directories - with ' */' ls -F add one char of */=>@| to enteries ls -i list file's inode index number ls -l list with long form...
New repository can be created with two different options: 1. Using command line Execute following command. It will create a directory for the repository, but parent path has to be present. i.e. in the following example, /var/svn should already be there, while it will create my_repository directory...
Redis has a Windows port provided by 'Microsoft Open Technologies'. You can use the msi installer found on: https://github.com/MSOpenTech/redis/releases After installation completes you can see 'Redis' is a Windows service (and it's status should be "Started") To write an 'Hello world'...
Scatterplot You have two vectors and you want to plot them. x_values <- rnorm(n = 20 , mean = 5 , sd = 8) #20 values generated from Normal(5,8) y_values <- rbeta(n = 20 , shape1 = 500 , shape2 = 10) #20 values generated from Beta(500,10) If you want to make a plot which has the y_val...

Page 388 of 505