Tutorial by Examples: ann

A spannable TextView can be used in Android to highlight a particular portion of text with a different color, style, size, and/or click event in a single TextView widget. Consider that you have defined a TextView as follows: TextView textview=findViewById(R.id.textview); Then you can apply diff...
Check for a Firewall issue blocking port 3306. Some possible diagnostics and/or solutions Is the server actually running? "service firewalld stop" and "systemctl disable firewalld" telnet master 3306 Check the bind-address check skip-name-resolve check the socket.
The familiar curry :: ((a,b) -> c) -> a -> b -> c curry = \f a b -> f (a,b) function can be generalized to tuples of arbitrary arity, for example: curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -&gt...
core.async is about making processes that take values from and put values into channels. (require [clojure.core.async :as a]) Creating channels with chan You create a channel using the chan function: (def chan-0 (a/chan)) ;; unbuffered channel: acts as a rendez-vous point. (def chan-1 (a/chan...
This example shows how to use fast enumeration in order to traverse through an NSArray. When you have an array, such as NSArray *collection = @[@"fast", @"enumeration", @"in objc"]; You can use the for ... in syntax to go through each item of the array, automatical...
This example demonstrates how to do compile time checking of an annotated element. The annotation The @Setter annotation is a marker can be applied to methods. The annotation will be discarded during compilation not be available afterwards. package annotation; import java.lang.annotation.Eleme...
#!/usr/bin/env python """ An annotated simple socket server example in python. WARNING: This example doesn't show a very important aspect of TCP - TCP doesn't preserve message boundaries. Please refer to http://blog.stephencleary.com/2009/04/message-framing.html before adaptin...
#!/usr/bin/env python """ An annotated simple socket client example in python. WARNING: This example doesn't show a very important aspect of TCP - TCP doesn't preserve message boundaries. Please refer to http://blog.stephencleary.com/2009/04/message-framing.html before adaptin...
Objective-C NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(id item, NSDictionary *bindings) { return [item isKindOfClass:[UILabel class]]; }]; Swift let predicate = NSPredicate { (item, bindings) -> Bool...
Objective-C NSPredicate *predicate = [NSPredicate predicateWithFormat: @"self[SIZE] = %d", 5)]; Swift let predicate = NSPredicate(format: "self[SIZE] >= %d", 5) In this example, the predicate will match items that are arrays with length of at least 5.
An NSPredicate can use substitution variables to allow values to be bound on the fly. Objective-C NSPredicate *template = [NSPredicate predicateWithFormat: @"self BEGINSWITH $letter"]; NSDictionary *variables = @{ @"letter": @"r" }; NSPredicate *beginsWithR = [templ...
By default, all the controllers you generate with Symfony's built-in generate:controller command will make use of Symfony annotations for routing: namespace AppBundle\Controller; // You have to add a use statement for the annotation use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; ...
Annotations are means of attaching metadata to code. To declare an annotation, put the annotation modifier in front of a class: annotation class Strippable Annotations can have meta-anotations: @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.VALUE_PARAMETER, A...
Here’re some basic JUnit annotations you should understand: @BeforeClass – Run once before any of the test methods in the class, public static void @AfterClass – Run once after all the tests in the class has been run, public static void @Before – Run before @Test, public void @After – Run after...
In PubNub JavaScript v3, you could implement a unique callback for every channel that you subscribed to as long as you called the subscribe function for each channel and implemented the callback in that subscribe like this: var pubnub = new PubNub({ publishKey: "your-pub-key", s...
Orphan nodes/vertices are those lacking all relationships/edges. MATCH (n) WHERE NOT (n)--() DELETE n
The Canny algorithm is a more recent edge detector designed as a signal processing problem. In OpenCV, it outputs a binary image marking the detected edges. Python: import cv2 import sys # Load the image file image = cv2.imread('image.png') # Check if image was loaded improperly and exit i...
For templated code it is often useful to verify that for function attributes (e.g. @nogc are inferred correctly. To ensure this for a specific test and thus type the entire unittest can be annotated @safe @nogc pure nothrow unittest { import std.math; assert(exp(0) == 1); assert(l...
@Component @Lazy public class Demo { .... .... } @Component public class B { @Autowired @Lazy // If this is not here, Demo will still get eagerly instantiated to satisfy this request. private Demo demo; ....... }
Edmx model internel public partial class ItemRequest { public int RequestId { get; set; } //... } Adding data annotation to this - if we modify this model directly, when a update to the model is made, the changes are lost . so To add a attribute in this case 'Required' Create a new...

Page 4 of 7