Tutorial by Examples

Downloading the Bundle: The easiest way to download the required GTK Bundle is to search and download it using this link: https://git.gnome.org/browse/gtk+ (GNOME GIT Repository) GNOME GIT Repository provides the bundles for different versions and you can easily find the desired version by scrolli...
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; NSURL *URL = [NSURL URLWithString:@"http://example.com/download.zip"]; NSURLReq...
This example will show how to make and use animation clips for game objects or players. Note, the models used in this example are downloaded from Unity Asset Store. The player was downloaded from the following link: https://www.assetstore.unity3d.com/en/#!/content/21874. To create animations, firs...
Vim has its own built-in Python interpreter. Thus it could use a different version of the default interpreter for the operating system. To check with which version of Python Vim was compiled, type the following command: :python import sys; print(sys.version) This imports the sys module and prin...
To be able to use vim commands in Python, the vim module should be imported. :python import vim After having this module imported, the user has access to the command function: :python vim.command("normal iText to insert") This command would execute i in normal mode then type Text t...
package example; import org.testng.annotations.*; // using TestNG annotations public class Test { @BeforeClass public void setUp() { // code that will be invoked when this test is instantiated } @Test(groups = { "fast" }) public void aFastTest() { System.out...
In order to make a RelativeSizeSpan align to the top, a custom class can be derived from the class SuperscriptSpan. In the following example, the derived class is named TopAlignSuperscriptSpan: activity_main.xml: <TextView android:id="@+id/txtView" android:layout_width=&quot...
To animate the transition between fragments, or to animate the process of showing or hiding a fragment you use the FragmentManager to create a FragmentTransaction. For a single FragmentTransaction, there are two different ways to perform animations: you can use a standard animation or you can suppl...
The class for size button bootstrap is : .btn-lg .btn-md .btn-sm .btn-xs For example : <button type="button" class="btn btn-primary btn-lg">Large</button> <button type="button" class="btn btn-primary btn-md">Medium</button> ...
public class ViewAnimationUtils { public static void expand(final View v) { v.measure(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); final int targtetHeight = v.getMeasuredHeight(); v.getLayoutParams().height = 0; v...
Sometimes it is desirable to nest forms for the purpose of grouping controls and inputs logically on the page. However, HTML5 forms should not be nested. Angular supplies ng-form instead. <form name="myForm" noValidate> <!-- nested form can be referenced via 'myForm.myNestedFo...
Create drawable file named with custom_rectangle.xml in drawable folder: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color=&quo...
Add the following method to check whether an email address is valid or not: private boolean isValidEmailId(String email){ return Pattern.compile("^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]{1}|[\\w-]{2,}))@" + "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?" ...
activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation=...
Docstrings are - unlike regular comments - stored as an attribute of the function they document, meaning that you can access them programmatically. An example function def func(): """This is a function that does nothing at all""" return The docstring can ...
Add code in your Activity. This would work for Fragment also, no need to add this code in Fragment. @Override public boolean dispatchTouchEvent(MotionEvent ev) { View view = getCurrentFocus(); if (view != null && (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == Moti...
DP to Pixel: private int dpToPx(int dp) { return (int) (dp * Resources.getSystem().getDisplayMetrics().density); } Pixel to DP: private int pxToDp(int px) { return (int) (px / Resources.getSystem().getDisplayMetrics().density); }
Tags are typically applied via the editor; however, you can also apply tags via script. Any custom tag must be created via the Tags & Layers window before being applied to a game object. Setting Tags in the Editor With one or more game objects selected, you can select a tag from the inspecto...
Tags make it particularly easy to locate specific game objects. We can look for a single game object, or look for multiple. Finding a Single GameObject We can use the static function GameObject.FindGameObjectWithTag(string tag) to look for individual game objects. It is important to note that, i...
When comparing two GameObjects by Tags, it should be noted that the following would cause Garbage Collector overhead as a string is created everytime: if (go.Tag == "myTag") { //Stuff } When performing those comparisons inside Update() and other regular Unity's callback (or a ...

Page 782 of 1336