Tutorial by Examples: bi

Introduction SRP can be defined as “a class handles only one responsibility”. This is a very short definition for something influential on to the other principles of S.O.L.I.D. I believe that if we get this right, it will have a positive knock-on effect on the upcoming principles, so let’s get star...
var config = {}; var timeout = 120000; config.framework = 'jasmine2'; config.allScriptsTimeout = timeout; config.getPageTimeout = timeout; config.jasmineNodeOpts.isVerbose = true; config.jasmineNodeOpts.defaultTimeoutInterval = timeout; config.specs = ['qa/**/*Spec.js']; config.capabilitie...
var config = {}; var timeout = 120000; config.framework = 'jasmine2'; config.allScriptsTimeout = timeout; config.getPageTimeout = timeout; config.jasmineNodeOpts.isVerbose = true; config.jasmineNodeOpts.defaultTimeoutInterval = timeout; config.specs = ['qa/**/*Spec.js']; config.multiCapabi...
One of several applications of bit manipulation is converting a letter from small to capital or vice versa by choosing a mask and a proper bit operation. For example, the a letter has this binary representation 01(1)00001 while its capital counterpart has 01(0)00001. They differ solely in the bit in...
Service that is used for communication: import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; @Injectable() export class ComponentCommunicationService { private componentChangeSource = new Subject(); private newDateCreationSource = new Subject<Date&...
Instead of this (unfortunately too often seen in the real code) "masterpiece": function isEven(n) { return n % 2 == 0; } function isOdd(n) { if (isEven(n)) { return false; } else { return true; } } You can do the parity check much more effecti...
var a = 11, b = 22; a = a ^ b; b = a ^ b; a = a ^ b; console.log("a = " + a + "; b = " + b);// a is now 22 and b is now 11
math.js 'use strict'; const Promise = require('bluebird'); module.exports = { // example of a callback-only method callbackSum: function(a, b, callback) { if (typeof a !== 'number') return callback(new Error('"a" must be a number')); if (typeof b !== 'number...
#lang scribble/manual @; Make sure that code highlighting recognises identifiers from my-package: ꩜require[@for-label[my-package]] @; Indicate which module is exporting the identifiers documented here. @defmodule[my-package] @defproc[(my-procedure [arg1 number?] [arg2 string?]) symbol?]{ ...
What is the bias A perceptron can be seen as a function that maps an input (real-valued) vector x to an output value f(x) (binary value): where w is a vector of real-valued weights and b is a our bias value. The bias is a value that shifts the decision boundary away from the origin (0,0) and ...
Install msys2 (http://www.msys2.org/) Install the required prerequisites for Vala pacman -S mingw64/mingw-w64-x86_64-gcc pacman -S mingw64/mingw-w64-x86_64-pkg-config pacman -S mingw64/mingw-w64-x86_64-vala and all the additional packages your code requires, i.e. pacman -S mingw64/mi...
Many biological questions can be translated into a DNA sequencing problem. For instance, if you want to know the expression level of a gene you can: copy its mRNAs into complementary DNA molecules, sequence each of the resulting DNA molecules, map those sequences back to the reference genome, and th...
LRU Cache The following example code demonstrates a possible implementation of the LruCache class for caching images. private LruCache<String, Bitmap> mMemoryCache; Here string value is key for bitmap value. // Get max available VM memory, exceeding this amount will throw an // OutOfMem...
In brief: Properties make it easy to pass updates from the python side to the user interface Binding passes the changes that happened on the user interface to the python side. from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.lang import Builder from kivy.properti...
To add a custom image for the thumb of the slider, simply call the setThumbImage method with your custom image: Swift 3.1: let slider = UISlider() let thumbImage = UIImage slider.setThumbImage(thumbImage, for: .normal)
CREATE BITMAP INDEX emp_bitmap_idx ON index_demo (gender); Bitmap index is used when data cardinality is low. Here, Gender has value with low cardinality. Values are may be Male, Female & others. So, if we create a binary tree for this 3 values while searching it will have unnecessary ...
You can request to be notified from the Gatt Server when the value of a characteristic has been changed: gatt.setCharacteristicNotification(characteristic, true); BluetoothGattDescriptor descriptor = characteristic.getDescriptor( UUID.fromString("00002902-0000-1000-8000-00805f9b34fb&quot...
Clarification of Erlang doc on Bit Syntax: 4.4 Defaults [Beginning omitted: <<3.14>> isn't even legal syntax.] The default Size depends on the type. For integer it is 8. For float it is 64. For binary it is the actual size of the specified binary: 1> Bin = << 17/integ...
In case of big data sets, the call of grepl("fox", test_sentences) does not perform well. Big data sets are e.g. crawled websites or million of Tweets, etc. The first acceleration is the usage of the perl = TRUE option. Even faster is the option fixed = TRUE. A complete example would be: ...
Ambient lights globally affect all entities in the scene. The color and intensity properties define ambient lights. Additionally, position, rotation, and scale have no effect on ambient lights. We recommend to have some form of ambient light such that shadowed areas are not fully black and to mimic...

Page 27 of 29