Tutorial by Examples: ann

The NSDate class provides methods for creating NSDate objects corresponding to a given date and time. An NSDate can be initialized using the designated initializer, which: Returns an NSDate object initialized relative to 00:00:00 UTC on 1 January 2001 by a given number of seconds. NSDate *date...
For annotating some point of interest on map, we use pin annotation. Now, start by creating annotation object first. MKPointAnnotation *pointAnnotation = [[MKPointAnnotation alloc] init]; Now provide coordinate to pointAnnotation,as CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake...
You can fetch the current properties of the Annotation by using Reflection to fetch the Method or Field or Class which has an Annotation applied to it, and then fetching the desired properties. @Retention(RetentionPolicy.RUNTIME) @interface MyAnnotation { String key() default "foo";...
The routing configuration is included in your app/config/config.yml file, by default the app/config/routing.yml file. From there you can link to the controllers that have annotated routing configuration: # app/config/routing.yml app: resource: "@AppBundle/Controller" type: ...
The @ContentView annotation can be used to further alleviate development of activities and replace the setContentView statement : @ContentView(R.layout.myactivity_layout) public class MyActivity extends RoboActivity { @InjectView(R.id.text1) TextView textView; @Override protected ...
You can inject any type of resource, Strings, Animations, Drawables, etc. To inject your first resource into an activity, you'll need to: Inherit from RoboActivity Annotate your resources with @InjectResource Example @InjectResource(R.string.app_name) String name; @InjectResource(R.drawa...
You can inject any view using the @InjectView annotation: You'll need to: Inherit from RoboActivity Set your content view Annotate your views with @InjectView Example @InjectView(R.id.textView1) TextView textView1; @InjectView(R.id.textView2) TextView textView2; @InjectView(R.id.imag...
CSS body { counter-reset: item-counter; } .item { counter-increment: item-counter; } .item:before { content: counter(item-counter, upper-roman) ". "; /* by specifying the upper-roman as style the output would be in roman numbers */ } HTML <div class='item'>Item...
The code listing below attempts to classify handwritten digits from the MNIST dataset. The digits look like this: The code will preprocess these digits, converting each image into a 2D array of 0s and 1s, and then use this data to train a neural network with upto 97% accuracy (50 epochs). "...
A region that contains mostly site-oriented content, rather than page-specific content. <div role="banner"> <h1>My Site</h1> <ul> <li><a href="/">Home</a></li> <li><a href="/about">About</...
You can tell the compiler the type of a value by annotating it with :Type: var value:int = 10; // A property "value" of type "int". Function parameters and return types can also be annotated: // This function accepts two ints and returns an int. function sum(a:int, b:int):i...
Until Java 8, two instances of the same annotation could not be applied to a single element. The standard workaround was to use a container annotation holding an array of some other annotation: // Author.java @Retention(RetentionPolicy.RUNTIME) public @interface Author { String value(); } ...
By default class annotations do not apply to types extending them. This can be changed by adding the @Inherited annotation to the annotation definition Example Consider the following 2 Annotations: @Inherited @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Inher...
Appearance : Happens when your script tries to send a HTTP header to the client but there already was output before, which resulted in headers to be already sent to the client. Possible Causes : Print, echo: Output from print and echo statements will terminate the opportunity to send HTTP hea...
In this example we create a goroutine (a function running in a separate thread) that accepts a chan parameter, and simply loops, sending information into the channel each time. In the main we have a for loop and a select. The select will block processing until one of the case statements becomes tru...
Dim stringOfSpaces As String 'Assign a string with 255 repeated spaces using Space$ stringOfSpaces = Space$(255) 'Assign a string with 255 repeated spaces using String$ stringOfSpaces = String$(255, " ")
Channel uses a Buffer to read/write data. A buffer is a fixed sized container where we can write a block of data at once. Channel is a quite faster than stream-based I/O. To read data from a file using Channel we need to have the following steps- We need an instance of FileInputStream. FileInput...
<svg width="800px" height="600px"> <defs> <filter id="greyscale"> <feColorMatrix type="matrix" values="0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 ...
We can use Channel to copy file content faster. To do so, we can use transferTo() method of FileChannel . import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.channels.FileChannel; public class FileCopier { ...
To write data to a file using Channel we need to have the following steps: First, we need to get an object of FileOutputStream Acquire FileChannel calling the getChannel() method from the FileOutputStream Create a ByteBuffer and then fill it with data Then we have to call the flip() method of ...

Page 2 of 7