Tutorial by Examples

Returns elements from the given collection until the specified condition is true. If the first element itself doesn't satisfy the condition then returns an empty collection. Signature of TakeWhile(): Public static IEnumerable <TSource> TakeWhile<TSource>(this IEnumerable <TSource&gt...
Skips elements based on a condition until an element does not satisfy the condition. If the first element itself doesn't satisfy the condition, it then skips 0 elements and returns all the elements in the sequence. Signature of SkipWhile(): Public static IEnumerable <TSource> SkipWhile<TS...
Algorithm This algorithm is a two step process.First we create a auxiliary array lps[] and then use this array for searching the pattern. Preprocessing : We pre-process the pattern and create an auxiliary array lps[] which is used to skip characters while matching. Here lps[] indicates longes...
let storyboard = UIStoryboard(name: "StoryboardName", bundle: nil) let vc = storyboard.instantiateViewController(withIdentifier: "ViewControllerID") as YourViewController self.present(vc, animated: true, completion: nil)
HP UFT use VBScript, so you can create a message box to display to the user the output results MsgBox "Hello World!" Or you can simple use the Output tab to see the output results of the script print "Hello World!"
Cold observable implementation, emits true when TTS engine finishes speaking, starts speaking when subscribed. Notice that API level 21 introduces different way to perform speaking: public class RxTextToSpeech { @Nullable RxTTSObservableOnSubscribe audio; WeakReference<Context> contextR...
@Module class AppModule(val app: Application) { @Provides @Named("the_answer") fun providesTheAnswer(): Int { return 42 } }
class MyClass{ @field:[Inject Named("the_answer")] lateinit var answer: Int } In Android Development, this is the way in which you inject dependencies into Activity, Fragment or any other object that is instantiated directly by the OS. To learn more about the @field: annotation i...
class MyClass @Inject constructor(@Named val answer: Int){ /* The nuts and bolts of your class */ }
Check environment variable value e.g. echo %JAVA_HOME% C:\Program Files\Java\jdk1.7.0_51
The vertex shader only accepts the texture coordinates as a vertex attribute and forwards the coordinates to the fragment shader. By default, it will also guarantee that the fragment will receive the properly interpolated coordinate based on its position in a triangle: layout (location = 0) in vec3...
(let [xf (comp (map inc) (filter even?))] (transduce xf + [1 2 3 4 5 6 7 8 9 10])) ;; => 30 This example creates a transducer assigned to the local xf and uses transduce to apply it to some data. The transducer add's one to each of it's inputs and only returns the ...
(def xf (filter keyword?)) Apply to a collection, returning a sequence: (sequence xf [:a 1 2 :b :c]) ;; => (:a :b :c) Apply to a collection, reducing the resulting collection with another function: (transduce xf str [:a 1 2 :b :c]) ;; => ":a:b:c" Apply to a collection, and...
If you call plt.legend() or ax.legend() more than once, the first legend is removed and a new one is drawn. According the official documentation: This has been done so that it is possible to call legend() repeatedly to update the legend to the latest handles on the Axes Fear not, though: It ...
The Rule: The user will input credentials (email and password). If credentials are valid, redirect to home page. Show an error message otherwise. How to apply technique: You can have a huge valid list of emails that could be used: [email protected] [email protected] [email protected] ... As we...
The Rule An e-commerce have a shipping rule based on zipcodes. All shipping to California is eligible to free shipping. All other west cost are US$ 10.00 and The rest of USA is US$ 20.00 How to apply technique We all know there are lots of zipcodes by state, and we are not going to use them all. ...
In order to clear the selection of those values which are selected using a Select2 drop down,we can use the empty() function. <select id="select2_example"> <option>Option1</option> <option>Option2</option> <option>Option3</option> </select&...
In cases where you need a common portion of the route for all routes within a controller, RoutePrefix attribute is used. In the below example, api/students part of the code is common and so we can define RoutePrefix and avoid using it repeatedly. [RoutePrefix("api/students")] public cla...
In this example I will show you how to make a basic lexer which will create the tokens for a integer variable declaration in python. What does the lexical analyser do? The purpose of a lexer (lexical analyser) is to scan the source code and break up each word into a list item. Once done it tak...
This is a simple parser which will parse an integer variable declaration token stream which we created in the previous example Simple Lexical Analyser. This parser will also be coded in python. What is a parser? The parser is the process in which the source text is converted to an abstract syn...

Page 1319 of 1336