Tutorial by Examples: is

Because a clack request is represented as a plist, we can use pattern matching as the entry point to the clack app as a way to route request to their appropriate controllers (defvar *app* (lambda (env) (match env ((plist :request-method :get :request-uri uri) (...
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...
Check the app's authorization status with: //Swift let status: CLAuthorizationStatus = CLLocationManager.authorizationStatus() //Objective-C CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; Test the status against the follow constants: //Swift switch status { case ...
Given a Person struct struct Person { let name: String let birthYear: Int? } and an Array of Person(s) let persons = [ Person(name: "Walter White", birthYear: 1959), Person(name: "Jesse Pinkman", birthYear: 1984), Person(name: "Skyler White&quo...
This is a normal function call: console.log("Hello World!"); When you call a normal function, it does its job and then returns control back to the caller. However, sometimes a function needs to return control back to the caller in order to do its job: [1,2,3].map(function double(x) {...
This directive is useful to limit input events based on certain existing conditions. The ng-disabled directive accepts and expression that should evaluate to either a truthy or a falsy values. ng-disabled is used to conditionally apply the disabled attribute on an input element. HTML <input t...
Custom Renderers let developers customize the appearance and behavior of Xamarin.Forms controls on each platform. Developers could use features of native controls. For example, we need to disable scroll in ListView. On iOS ListView is scrollable even if all items are placed on the screen and user s...
To perform elementwise multiplication on tensors, you can use either of the following: a*b tf.multiply(a, b) Here is a full example of elementwise multiplication using both methods. import tensorflow as tf import numpy as np # Build a graph graph = tf.Graph() with graph.as_default(): ...
A Bag/ultiset stores each object in the collection together with a count of occurrences. Extra methods on the interface allow multiple copies of an object to be added or removed at once. JDK analog is HashMap<T, Integer>, when values is count of copies this key. TypeGuavaApache Commons Collec...
A linked list is a linear collection of data elements, called nodes, which are linked to other node(s) by means of a "pointer." Below is a singly linked list with a head reference. ┌─────────┬─────────┐ ┌─────────┬─────────┐ HEAD ──▶│ data │"pointer"│──▶...
It's a VBA Best Practice to always specify which workbook your VBA code refers. If this specification is omitted, then VBA assumes the code is directed at the currently active workbook (ActiveWorkbook). '--- the currently active workbook (and worksheet) is implied Range("A1").value = 3.1...
Multiple database cursors can be published from the same publication method by returning an array of cursors. The "children" cursors will be treated as joins and will not be reactive. Meteor.publish('USER_THREAD', function(postId) { let userId = this.userId; let comments = Comm...
If you want to hide a keyboard by tap outside of it, it's possible to use this hacky trick (works only with Objective-C): - (void)viewDidLoad { [super viewDidLoad]; // dismiss keyboard when tap outside a text field UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecogn...
vagrant up By default the box will be provisioned.
vagrant up --no-provision
vagrant provision
F# allows functions to be added as "members" to types when they are defined (for example, Record Types). However F# also allows new instance members to be added to existing types - even ones declared elsewhere and in other .net languages. The following example adds a new instance method D...
F# allow existing types to be extended with new static functions. type System.String with static member EqualsCaseInsensitive (a, b) = String.Equals(a, b, StringComparison.OrdinalIgnoreCase) This new function can be invoked like this: let x = String.EqualsCaseInsensitive("abc", &...
Modules can be used to add new functions to existing Modules and Types. namespace FSharp.Collections module List = let pair item1 item2 = [ item1; item2 ] The new function can then be called as if it was an original member of List. open FSharp.Collections module Testing = le...
from struct import pack print(pack('I3c', 123, b'a', b'b', b'c')) # b'{\x00\x00\x00abc'

Page 32 of 109