Tutorial by Examples

type Props = { posts: Array<Article>, dispatch: Function, children: ReactElement } const AppContainer = ({ posts, dispatch, children }: Props) => ( <div className="main-app"> <Header {...{ posts, dispatch }} /> {children} </...
DATA salary; /*define variables*/ raise=0.1; salary=50000; year=1; /*do loop*/ DO year=1 to 20 by 2; salary + salary*raise; output; /*generates an observation for each iteration of the do loop, optional*/ END; RUN;
Go to Explorer, Open iris.arff data, then go to CPython Scripting, Copy and Paste the following lines of codes into Python Scripts: hi = "Hello, CPython of Weka!" hello = hi.upper() iris = py_data info = iris.describe() To see output, go to Python Variables, select hi, for exa...
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...
The length of line-wrapping when using the l command is implementation defined. From the standard: Long lines shall be folded, with the point of folding indicated by writing a followed by a ; the length at which folding occurs is unspecified, but should be appropriate for the output device. ...
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...
// Initalize a new queue of integers var queue = new Queue<int>(); // Add some data queue.Enqueue(6); queue.Enqueue(4); queue.Enqueue(9); // Elements in a queue are stored in "first in, first out" order. // The queue from first to last is: 6, 4, 9 // View the next ele...
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 drop an Item somewhere in the world: Item dropItem(Location loc, ItemStack is); Item dropItemNaturally(Location loc, ItemStack is); dropItem means dropping an Item exactly at the location, returning an Item object. dropItemNaturally means dropping the Item ...
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...
Basic reading image from java import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.imgcodecs.Imgcodecs; //Load native library System.loadLibrary(Core.NATIVE_LIBRARY_NAME); //Mat object used to host the image Mat imageArray; //Read image file from vile system ima...
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...
Unary operators are operators with only one operand. Unary operators are more efficient than standard JavaScript function calls. Additionally, unary operators can not be overridden and therefore their functionality is guaranteed. The following unary operators are available: OperatorOperationExampl...

Page 1032 of 1336