Tutorial by Examples: ble

An AnimatedVectorDrawable requires at least 3 components: A VectorDrawable which will be manipulated An objectAnimator which defines what property to change and how The AnimatedVectorDrawable itself which connects the objectAnimator to the VectorDrawable to create the animation The following...
def multiply(factor: Int)(numberToBeMultiplied: Int): Int = factor * numberToBeMultiplied val multiplyBy3 = multiply(3)_ // resulting function signature Int => Int val multiplyBy10 = multiply(10)_ // resulting function signature Int => Int val sixFromCurriedCall = multiplyBy3(2) //6...
DATA begda TYPE sy-datum.
DATA: begda TYPE sy-datum, endda TYPE sy-datum.
If you want to calculate with BigDecimal you have to use the returned value because BigDecimal objects are immutable: BigDecimal a = new BigDecimal("42.23"); BigDecimal b = new BigDecimal("10.001"); a.add(b); // a will still be 42.23 BigDecimal c = a.add(b); // c will be ...
If MsgBox("Click OK") = vbOK Then can be used in place of If MsgBox("Click OK") = 1 Then in order to improve readability. Use Object Browser to find available VB constants. View → Object Browser or F2 from VB Editor. Enter class to search View members available ...
Descriptive names and structure in your code help make comments unnecessary Dim ductWidth As Double Dim ductHeight As Double Dim ductArea As Double ductArea = ductWidth * ductHeight is better than Dim a, w, h a = w * h This is especially helpful when you are copying data from one ...
The .GetValueOrDefault() method returns a value even if the .HasValue property is false (unlike the Value property, which throws an exception). class Program { static void Main() { int? nullableExample = null; int result = nullableExample.GetValueOrDefault(); C...
If you want to include PHP code in your HTML file and you don't want to rename the file type from .html or .htm to .php, the below allows your HTML file to parse your PHP code correctly. AddHandler application/x-httpd-php .html .htm
To find some number (more than one) of largest or smallest values of an iterable, you can use the nlargest and nsmallest of the heapq module: import heapq # get 5 largest items from the range heapq.nlargest(5, range(10)) # Output: [9, 8, 7, 6, 5] heapq.nsmallest(5, range(10)) # Output: [...
You can create one table from another by adding a SELECT statement at the end of the CREATE TABLE statement: CREATE TABLE stack ( id_user INT, username VARCHAR(30), password VARCHAR(30) ); Create a table in the same database: -- create a table from another table in the same data...
Broadcast variables are read only shared objects which can be created with SparkContext.broadcast method: val broadcastVariable = sc.broadcast(Array(1, 2, 3)) and read using value method: val someRDD = sc.parallelize(Array(1, 2, 3, 4)) someRDD.map( i => broadcastVariable.value.apply(...
INSERT INTO will append to the table or partition, keeping the existing data intact. INSERT INTO table yourTargetTable SELECT * FROM yourSourceTable; If a table is partitioned then we can insert into that particular partition in static fashion as shown below. INSERT INTO TABLE yourTarge...
:root { --red: #b00; --blue: #4679bd; --grey: #ddd; } .Bx1 { color: var(--red); background: var(--grey); border: 1px solid var(--red); }
:root { --W200: 200px; --W10: 10px; } .Bx2 { width: var(--W200); height: var(--W200); margin: var(--W10); }
Python 3.x3.0 Python 3 added a new keyword called nonlocal. The nonlocal keyword adds a scope override to the inner scope. You can read all about it in PEP 3104. This is best illustrated with a couple of code examples. One of the most common examples is to create function that can increment: def c...
Python 2.x2.7 "1deadbeef3".decode('hex') # Out: '\x1d\xea\xdb\xee\xf3' '\x1d\xea\xdb\xee\xf3'.encode('hex') # Out: 1deadbeef3 Python 3.x3.0 "1deadbeef3".decode('hex') # Traceback (most recent call last): # File "<stdin>", line 1, in <module> ...
If you have created a table with some wrong schema, then the easiest way to change the columns and their properties is change_table. Review the following example: change_table :orders do |t| t.remove :ordered_at # removes column ordered_at t.string :skew_number # adds a new column t.index...
Events that work with most form elements (e.g., change, keydown, keyup, keypress) do not work with contenteditable. Instead, you can listen to changes of contenteditable contents with the input event. Assuming contenteditableHtmlElement is a JS DOM object that is contenteditable: contenteditableH...
To add a new unique column email to users, run the following command: rails generate migration AddEmailToUsers email:string:uniq This will create the following migration: class AddEmailToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :email, :string add_index...

Page 10 of 62