Tutorial by Examples: ect

public class OnSwipeListener implements View.OnTouchListener { private final GestureDetector gestureDetector; public OnSwipeListener(Context context) { gestureDetector = new GestureDetector(context, new GestureListener()); } @Override public boolean onTouch(Vi...
public class GestureActivity extends Activity implements GestureDetector.OnDoubleTapListener, GestureDetector.OnGestureListener { private GestureDetector mGestureDetector; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedIn...
Create a new Console Application Add the NuGet package Microsoft.CodeAnalysis Import the namespaces Microsoft.CodeAnalysis.MSBuild, System.Linq and Microsoft.CodeAnalysis.CSharp.Syntax Write the following example code in the Main method: // Declaring a variable with the current project file ...
#Region directive can now be placed inside methods and can even span over methods, classes and modules. #Region "A Region Spanning A Class and Ending Inside Of A Method In A Module" Public Class FakeClass 'Nothing to see here, just a fake class. End Class Module Extensi...
The presence of a tsconfig.json file indicates that the current directory is the root of a TypeScript enabled project. Initializing a TypeScript project, or better put tsconfig.json file, can be done through the following command: tsc --init As of TypeScript v2.3.0 and higher this will create t...
Get all files in Directory var FileSearchRes = Directory.GetFiles(@Path, "*.*", SearchOption.AllDirectories); Returns an array of FileInfo, representing all the files in the specified directory. Get Files with specific extension var FileSearchRes = Directory.GetFiles(@Path, "*...
The Data.Vector module provided by the vector is a high performance library for working with arrays. Once you've imported Data.Vector, it's easy to start using a Vector: Prelude> import Data.Vector Prelude Data.Vector> let a = fromList [2,3,4] Prelude Data.Vector> a fromList [2,3,4]...
Filter odd elements: Prelude Data.Vector> Data.Vector.filter odd y fromList [1,3,5,7,9,11] :: Data.Vector.Vector
Vectors can be map'd and fold'd,filter'd andzip`'d: Prelude Data.Vector> Data.Vector.map (^2) y fromList [0,1,4,9,16,25,36,49,64,81,100,121] :: Data.Vector.Vector Reduce to a single value: Prelude Data.Vector> Data.Vector.foldl (+) 0 y 66
Zip two arrays into an array of pairs: Prelude Data.Vector> Data.Vector.zip y y fromList [(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11)] :: Data.Vector.Vector
The Window Object contains the following properties. PropertyDescriptionwindow.closedWhether the window has been closedwindow.lengthNumber of <iframe> elements in windowwindow.nameGets or sets the name of the windowwindow.innerHeightHeight of windowwindow.innerWidthWidth of windowwindow.scree...
# Deny access to a directory from the IP 255.0.0.0 <Directory /path/to/directory> order allow,deny deny from 255.0.0.0 allow from all </Directory> # Deny access to a file from the IP 255.0.0.0 <FilesMatch "^\.ht"> order allow,deny deny fro...
If you either have apps generated with pre-android support or just did that on purpose, you can always add android project to your app. $ react-native android This will generate android folder and index.android.js inside your app.
Given 2 lists var list1 = new List<string> { "a", "b", "c" }; var list2 = new List<string> { "1", "2", "3", "4" }; if you want to output all permutations you could use nested loops like var result = new List<s...
The following example shows how to set up Dependency Injection using Ninject as an IoC container. First add a CustomModule class to your WebJob project, and add any dependency bindings there. public class CustomModule : NinjectModule { public override void Load() { Bind<IMyI...
There are two ways to create object mocked by Mockito: via annotation via mock function Via annotation: With a JUnit test runner: @RunWith(MockitoJUnitRunner.class) public class FooTest { @Mock private Bar barMock; // ... } You can also use Mockito's JUnit @Rule, which...
Mockito.when(mock.returnSomething()).thenReturn("my val"); mock.returnSomething(); // returns "my val" mock.returnSomething(); // returns "my val" again mock.returnSomething(); // returns "my val" again and again and again... If you want different valu...
There have been many releases of Java since the original Java 1.0 release in 1995. (Refer to Java version history for a summary.) However most releases have passed their official End Of Life dates. This means that the vendor (typically Oracle now) has ceased new development for the release, and n...
In order to play a sound using the SoundEffect type, create a variable to hold the loaded sound. Typically this would be an instance variable in the Game class: private SoundEffect mySound; Then, in the LoadContent() method of the Game class: protected override void LoadContent() { // l...
<dom-module id="using-listeners-obj"> <template> <style> :host{ width: 220px; height: 100px; border: 1px solid black; display: block; } #inner{ width: calc(100% - 10px); height: 50px; ...

Page 48 of 99