Tutorial by Examples: f

Using pattern matching one can intertwine function definition and pattern matching, similar to SML. (trivia:defun-match fib (index) "Return the corresponding term for INDEX." (0 1) (1 1) (index (+ (fib (1- index)) (fib (- index 2))))) (fib 5) ;; => 8
This is a sample adapter code. public class SampleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private static final int FOOTER_VIEW = 1; // Define a view holder for Footer view public class FooterViewHolder extends ViewHolder { public FooterViewHolder(View ite...
If your project doesn't have README.md, GitHub may parse README.rdoc to display details. If it has both, it will use README.md, silently ignoring rdoc. A README file may include- Project Title Describe briefly about your project. You may also provide project's website link, badges, community ...
Fish shell is friendlier yet you might face trouble while using with virtualenv or virtualenvwrapper. Alternatively virtualfish exists for the rescue. Just follow the below sequence to start using Fish shell with virtualenv. Install virtualfish to the global space sudo pip install virtualfish...
Sometimes it is necessary or desirable to place the legend outside the plot. The following code shows how to do it. import matplotlib.pylab as plt fig, ax = plt.subplots(1, 1, figsize=(10,6)) # make the figure with the size 10 x 6 inches fig.suptitle('Example of a Legend Being Placed Outside of...
Fire after the initialization of the content of the component or directive has finished. (Right after OnInit) import { Component, AfterContentInit } from '@angular/core'; @Component({ selector: 'so-aftercontentinit-component', templateUrl: 'aftercontentinit-component.html', styl...
Fire after the view has been fully initialized. (Only available for components) import { Component, AfterContentChecked } from '@angular/core'; @Component({ selector: 'so-aftercontentchecked-component', templateUrl: 'aftercontentchecked-component.html', styleUrls: ['aftercontentc...
Fires after initializing both the component view and any of its child views. This is a useful lifecycle hook for plugins outside of the Angular 2 ecosystem. For example, you could use this method to initialize a jQuery date picker based on the markup that Angular 2 has rendered. import { Component,...
Fire after the check of the view, of the component, has finished. (Only available for components) import { Component, AfterViewChecked } from '@angular/core'; @Component({ selector: 'so-afterviewchecked-component', templateUrl: 'afterviewchecked-component.html', styleUrls: ['afte...
CREATE TRIGGER BooksDeleteTrigger ON MyBooksDB.Books AFTER DELETE AS INSERT INTO BooksRecycleBin SELECT * FROM deleted; GO
You can start some slow process in parallel and then collect the results when they are done: Public Sub Main() Dim results = Task.WhenAll(SlowCalculation, AnotherSlowCalculation).Result For Each result In results Console.WriteLine(result) Next End Sub Async Functio...
Import the CoreLocation module in your classes that use CoreLocation functionality. //Swift import CoreLocation //Objective-C #import <CoreLocation/CoreLocation.h>
(in-package #:asdf-user) (defsystem #:foo :components ((:file "foo")) :in-order-to ((asdf:test-op (asdf:load-op :foo))) :perform (asdf:test-op (o c) (uiop:symbol-call :foo-tests 'run-tests))) (defsystem #:foo-tests :name "foo-test" :compo...
ASDF provides the package ASDF-USER for developers to define their packages in.
Example: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <textarea id="content"></textarea> <input type="button" id="copy...
1. Character Class Character class is denoted by []. Content inside a character class is treated as single character separately. e.g. suppose we use [12345] In the example above, it means match 1 or 2 or 3 or 4 or 5 . In simple words, it can be understood as or condition for single characters (...
Observe the notifications UIKeyboardWillShowNotification and UIKeyboardWillHideNotification, update the scrollView content insets according to keyboard height, then scroll to the focused control. - (void)viewDidLoad { [super viewDidLoad]; // register for keyboard notifications [[...
View file: <?php use yii; use yii\bootstrap\ActiveForm; use yii\helpers\Html; ?> <?php $form = ActiveForm::begin([ 'action' => ['comments/ajax-comment'], 'options' => [ 'class' => 'comment-form' ] ]); ?> <?= $form->field($model, '...
Because of security reasons, by default cookies are accessible only on the same domain from which they were set. For example, if you have set a cookie on domain example.com, you cannot get it on domain www.example.com. So if you're planning to use subdomains (i.e. admin.example.com, profile.exampl...
form1.component.ts: import { Component } from '@angular/core'; // Defines example component and associated template @Component({ selector: 'example', template: ` <div *ngFor="let f of fruit"> {{f}} </div> <select required> <option ...

Page 122 of 457