Tutorial by Examples: ann

Catalan numbers algorithm is Dynamic Programming algorithm. In combinatorial mathematics, the Catalan numbers form a sequence of natural numbers that occur in various counting problems, often involving recursively-defined objects. The Catalan numbers on nonnegative integers n are a set of numbers t...
Android supports fingerprint api from Android 6.0 (Marshmallow) SDK 23 To use this feature in your app, first add the USE_FINGERPRINT permission in your manifest. <uses-permission android:name="android.permission.USE_FINGERPRINT" /> Here the procedure to follow ...
By default communication over the channcels is sync; when you send some value there must be a receiver. Otherwise you will get fatal error: all goroutines are asleep - deadlock! as follows: package main import "fmt" func main() { msg := make(chan string) msg <- "He...
import AVFoundation class QRScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { func viewDidLoad() { self.initCaptureSession() } private func initCaptureSession() { let captureDevice = AVCaptureDevice .defa...
Class under test: public class GreetingsService { // class to be tested in isolation private UserService userService; public GreetingsService(UserService userService) { this.userService = userService; } public String getGreetings(int userId, LocalTime time) { // the...
Channel adapter is one of message endpoints in Spring Integration. It is used for unidirectional message flow. There are two types of channel adapter: Inbound Adapter: input side of the channel. Listen or actively read message. Outbound Adapter: output side of the channel. Send message to Java cla...
In the Spring Integration Reference Docuement, it says: The outbound Channel Adapter is the inverse of the inbound: its role is to handle a message and use it to execute a SQL query. The message payload and headers are available by default as input parameters to the query... Java code p...
import cv2 def canny_webcam(): "Live capture frames from webcam and show the canny edge image of the captured frames." cap = cv2.VideoCapture(0) while True: ret, frame = cap.read() # ret gets a boolean value. True if reading is successful (I think). frame ...
In T4 code-generation strategy used by Entity Framework 5 and higher, data annotation attributes are not included by default. To include data annotations on top of certain property every model regeneration, open template file included with EDMX (with .tt extension) then add a using statement under U...
@Configuration public class AppSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired DataSource dataSource; @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth.jdbcAuthentication().dataSource(dataSource) .pa...
CloudCannon offers hosting and a CMS for Jekyll applications. Here are the steps in hosting your Jekyll application on CloudCannon (http://cloudcannon.com). Without version control: Create your blog locally using some local files and jekyll serve Create a CloudCannon account and create a new si...
RTL (Right-to-left) support is an essential part in planning for i18n and L10n. Unlike English language which is written from left to right, many languages like Arabic, Japanese, Hebrew, etc. are written from right to left. To appeal to a more global audience, it is a good idea to plan your layouts ...
Starting SDK 17 (Android 4.2), RTL support was added in Android layouts and is an essential part of localization. Going forward, the left/right notation in layouts should be replaced by start/end notation. If, however, your project has a minSdk value less than 17, then both left/right and start/end ...
To test if the layouts that have been created are RTL compatible, do the following : Go to Settings -> Developer options -> Drawing -> Force RTL layout direction Enabling this option would force the device to use RTL locales and you can easily verify all parts of the app for RTL suppo...
Graphically In XCode a simple NSTextView can be created by dragging and dropping one from the Object Library. This NSTextView sits inside an NSScrollView that is automatically set to expand vertically with the text view. Make sure when option(⌥)-dragging you make connections to the text view and...
The preferred and most common way of making an NSFont object is the following: Objective-C // Name is PostScript name of font; size is in points. NSFont *essayFont = [NSFont fontWithName:@"Times New Roman" size:12.0];
You can create you own Scala annotations by creating classes derived from scala.annotation.StaticAnnotation or scala.annotation.ClassfileAnnotation package animals // Create Annotation `Mammal` class Mammal(indigenous:String) extends scala.annotation.StaticAnnotation // Annotate class Platypus...
import javax.inject.Singleton; import dagger.Module; import dagger.Provides; @Module public class VehicleModule { @Provides @Singleton Motor provideMotor(){ return new Motor(); } @Provides @Singleton Vehicle provideVehicle(){ return new Vehicle(...
""" CannyTrackbar function allows for a better understanding of the mechanisms behind Canny Edge detection algorithm and rapid prototyping. The example includes basic use case. 2 of the trackbars allow for tuning of the Canny function and the other 2 help with understanding h...
Redis provides the SCAN command to iterate over the keys in the database matching a particular pattern. Redis supports glob style pattern matching in the SCAN command. The SCAN command provides a cursor-based iterator over the Redis keyspace. The iterative call sequence to SCAN starts with the us...

Page 6 of 7