Tutorial by Examples

Given Example class extending BaseExample class with some properties: open class BaseExample(val baseField: String) class Example(val field1: String, val field2: Int, baseField: String): BaseExample(baseField) { val field3: String get() = "Property without backing ...
Consider the dataframes left and right left = pd.DataFrame([['a', 1], ['b', 2]], list('XY'), list('AB')) left A B X a 1 Y b 2 right = pd.DataFrame([['a', 3], ['b', 4]], list('XY'), list('AC')) right A C X a 3 Y b 4 join Think of join as wanting to combine to dat...
doOnNext operator called every time when source Observable emits an item. It can be used for debugging purposes, applying some action to the emitted item, logging, etc... Observable.range(1, 3) .doOnNext(value -> System.out.println("before transform: " + value)) .map(value -&...
The onTouchEvents() for nested view groups can be managed by the boolean onInterceptTouchEvent. The default value for the OnInterceptTouchEvent is false. The parent's onTouchEvent is received before the child's. If the OnInterceptTouchEvent returns false, it sends the motion event down the cha...
type Dog = Dog String dogName1 dog = case dog of Dog name -> name dogName2 (Dog name) -> name dogName1 and dogName2 are equivalent. Note that this only works for ADTs that have a single constructor. type alias Pet = { name: String , weight: Float ...
Add the Gtk dependecy to your Cargo.toml: [dependencies] gtk = { git = "https://github.com/gtk-rs/gtk.git" } Create a simple window with the following: extern crate gtk; use gtk::prelude::*; // Import all the basic things use gtk::{Window, WindowType, Label}; fn main() { ...
extern crate gtk; use gtk::prelude::*; use gtk::{Window, WindowType, Label, Entry, Box as GtkBox, Orientation}; fn main() { if gtk::init().is_err() { println!("Failed to initialize GTK."); return; } let window = Window::new(WindowType::Toplevel); ...
repeat operator allow to repeat whole sequence from source Observable. Observable.just(1, 2, 3) .repeat() .subscribe( next -> System.out.println("next: " + next), error -> System.out.println("error: " + error), () -> System.out.print...
seemed the only way to add a comment. One thing that's easy to forget is that if you string some variables like the example above, and the resulting length is SHORTER than what was originally in the receiving variable (o- string above) then"trailing"characters are left in place. For exam...
When some programmers see this advice: "Testing strings using == is incorrect (unless the strings are interned)" their initial reaction is to intern strings so that they can use ==. (After all == is faster than calling String.equals(...), isn't it.) This is the wrong approach, from...
identification division. program-id. subprog. procedure division. display "in subprog" goback. ... call "subprog" goback. The first GOBACK above will return from subprog. Assuming the second is inside the main procedure, GOBACK will return to the operating system. ...
IF A = 1 OR 2 THEN perform miracles END-IF IF A = 1 OR 2 AND B = 1 THEN perform rites-of-passage ELSE perform song-and-dance END-IF IF statements can be terminated with full stop or explicit scope terminator END-IF. Use of periods for scope termination is no longer recommend...
Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. It compresses data very effectively saving from 20% to 90% memory, depending on the characteristics of the data being compressed. We consider the data to be a sequence of characters. Huffman...
Will talk about directory structure of CakePHP, what each folder means. CakePHP has some main folders app - It Contains our application source code, all our code lies under this directory. lib - This is the cakephp core liberary, it contains all the base cakephp library code. Editing code insid...
Errors, when managed properly by the server, will be returned to your client with a specific HTTP status code different from 2xx (see RFC 2616 section 10). It's advised to catch globally your errors from your $.ajaxSetup() as demonstrated in the example below. Therefore all errors coming from your ...
A closure is a procedure that holds internal state: Define a procedure that returns a closure The procedure make-an-adder takes one argument x and returns a function that closes over the value. Or to put it another way, x is within the lexical scope of the returned function. #lang racket (define...
Let me start by saying you should first visit Beej's Guide to Network Programming and give it a quick read, which explains most of this stuff a bit more verbosely. We'll be creating a simple TCP server here which will say "Hello World" to all incoming connections and then close them. Anoth...
This program is complimentary to Hello TCP Server program, you can run either of them to check the validity of each other. The program flow is quite common with Hello TCP server, so make sure to take a look at that too. Here's the code - #include <cstring> #include <iostream> #includ...
Prepared statements See Prepared statements in MySQLi for how to prepare and execute a query. Binding of results Object-oriented style $stmt->bind_result($forename); Procedural style mysqli_stmt_bind_result($stmt, $forename); The problem with using bind_result is that it requires the s...
Have you ever wondered how the search engines work? How does Google line-up millions of results in front of you in just a few milliseconds? How does a huge database situated thousands of miles away from you find out information you're searching for and send them back to you? The reason behind this i...

Page 961 of 1336