Tutorial by Examples: o

This class enables a programmer to create an object and protect its confidentiality with a cryptographic algorithm. Given any Serializable object, one can create a SealedObject that encapsulates the original object, in serialized format (i.e., a "deep copy"), and seals (encrypts) its seri...
SignedObject is a class for the purpose of creating authentic runtime objects whose integrity cannot be compromised without being detected. More specifically, a SignedObject contains another Serializable object, the (to-be-)signed object and its signature. //Create a key KeyPairGenerator keyGen...
Transformations alter a given point's starting position by moving, rotating & scaling that point. Translation: Moves a point by a distanceX and distanceY. Rotation: Rotates a point by a radian angle around it's rotation point. The default rotation point in Html Canvas is the top-left origin ...
Canvas allows you to context.translate, context.rotate and context.scale in order to draw your shape in the position & size you require. Canvas itself uses a transformation matrix to efficiently track transformations. You can change Canvas's matrix with context.transform You can change Canv...
Spark uses lazy evaluation; that means it will not do any work, unless it really has to. That approach allows us to avoid unnecessary memory usage, thus making us able to work with big data. A transformation is lazy evaluated and the actual work happens, when an action occurs. Example: In [1]: li...
You want to combine arrays into one. For example, you have fruits = ['Broccoli', 'Carrots'] spices = ['Thyme', 'Cinnamon'] and you want to combine them into ingredients = ['Broccoli', 'Carrots', 'Thyme', 'Cinnamon'] Method 1 - using .concat ingredients = fruits.concat spices Method 2 -...
Detailed instructions on getting windows-azure-storage set up or installed.
Make sure the following dependency is added to your app's build.gradle file under dependencies: compile 'com.android.support:support-core-ui:24.2.0' Then add the SwipeRefreshLayout in your layout: <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipe_refresh_layo...
Block strings can be used to hold formatted or indentation-sensitive text (or, if you just don't feel like escaping quotes and apostrophes). The indentation level that begins the block is maintained throughout, so you can keep it all aligned with the body of your code. html = """ ...
While the if ()... else statement allows to define only one (default) behaviour which occurs when the condition within the if () is not met, chaining two or more if () ... else statements allow to define a couple more behaviours before going to the last else branch acting as a "default", i...
Plenty has been written about Python's GIL. It can sometimes cause confusion when dealing with multi-threaded (not to be confused with multiprocess) applications. Here's an example: import math from threading import Thread def calc_fact(num): math.factorial(num) num = 600000 t = Threa...
In most object oriented languages, allocating memory for an object and initializing it is an atomic operation: // Both allocates memory and calls the constructor MyClass object = new MyClass(); In Objective-C, these are separate operations. The class methods alloc (and its historic sibling allo...
Use the following piece of code to set the badge number from within your application (suppose someNumber has been declared before): Objective-C [UIApplication sharedApplication].applicationIconBadgeNumber = someNumber; Swift UIApplication.shared.applicationIconBadgeNumber = someNumber In order ...
There's an installation guide for running a JIRA Server under Windows or Linux / Mac ( see Installing JIRA applications) For local testing there's an SDK, which starts a JIRA test instance and can be used to develop JIRA Plugins (see Set up the Atlassian Plugin SDK and Build a Project)
import React, { Component } from 'react' import { View, Text, AppRegistry } from 'react-native' class Example extends Component { render () { return ( <View> <Text> I'm a basic Component </Text> </View> ) } } AppRegistry.registe...
These components will have changing States. import React, { Component } from 'react' import { View, Text, AppRegistry } from 'react-native' class Example extends Component { constructor (props) { super(props) this.state = { name: "Sriraman" } } render ...
As the name implies, Stateless Components do not have any local state. They are also known as Dumb Components. Without any local state, these components do not need lifecycle methods or much of the boilerplate that comes with a stateful component. Class syntax is not required, you can simply do con...
Consider the following example: public final class Person { private final String firstName; private final String lastName; public Person(String firstName, String lastName) { this.firstName = (firstName == null) ? "" : firstName; this.lastName = (lastN...
[Header( "My variables" )] public string MyString; [HideInInspector] public string MyHiddenString; [Multiline( 5 )] public string MyMultilineString; [TextArea( 2, 8 )] public string MyTextArea; [Space( 15 )] public int MyInt; [Range( 2.5f, 12.5f )] public float MyFlo...
[DisallowMultipleComponent] [RequireComponent( typeof( Rigidbody ) )] public class AttributesExample : MonoBehaviour { [...] } [DisallowMultipleComponent] The DisallowMultipleComponent attribute prevents users adding multiple instances of this component to one GameObject. [Requi...

Page 589 of 1038