Tutorial by Examples: ble

bsort :: Ord a => [a] -> [a] bsort s = case bsort' s of t | t == s -> t | otherwise -> bsort t where bsort' (x:x2:xs) | x > x2 = x2:(bsort' (x:xs)) | otherwise = x:(bsort' (x2:xs)) bsort' s = s
private static final int REQUEST_ENABLE_BT = 1; // Unique request code BluetoothAdapter mBluetoothAdapter; // ... if (!mBluetoothAdapter.isEnabled()) { Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(enableBtIntent, REQUEST_ENABLE_B...
private static final int REQUEST_DISCOVERABLE_BT = 2; // Unique request code private static final int DISCOVERABLE_DURATION = 120; // Discoverable duration time in seconds // 0 means always discoverable ...
You can set an environment variable called PYTHONSTARTUP for Python's console. Whenever you enter the Python console, this file will be executed, allowing for you to add extra functionality to the console such as importing commonly-used modules automatically. If the PYTHONSTARTUP variable was set t...
Introduce environment variable VAGRANT_DEFAULT_PROVIDER export VAGRANT_DEFAULT_PROVIDER=vmware_fusion
public class Foo { private const int TASK_ITERATION_DELAY_MS = 1000; private CancellationTokenSource _cts; public Foo() { this._cts = new CancellationTokenSource(); } public void StartExecution() { Task.Factory.StartNew(this.OwnCodeCancelable...
public class Foo { private CancellationTokenSource _cts; public Foo() { this._cts = new CancellationTokenSource(); } public void StartExecution() { Task.Factory.StartNew(this.OwnCodeCancelableTask, this._cts.Token); } public void Cance...
The below code will turn the table with an id of tableid into a DataTable, as well as return a DataTables API instance: $(document).ready(function() { $('#tableid').DataTable(); }); Compare this to the below code, which will turn the table into a DataTable but will not return a DataTables ...
Yes, you need to SETKEY pre 1.9.6 In the past (pre 1.9.6), your data.table was sped up by setting columns as keys to the table, particularly for large tables. [See intro vignette page 5 of September 2015 version, where speed of search was 544 times better.] You may find older code making use of t...
A true relational database must go beyond throwing data into a few tables and writing some SQL statements to pull that data out. At best a badly designed table structure will slow the execution of queries and could make it impossible for the database to function as intended. A database table shoul...
Defining our terms By array here we mean a Lua table used as a sequence. For example: -- Create a table to store the types of pets we like. local pets = {"dogs", "cats", "birds"} We're using this table as a sequence: a group of items keyed by integers. Many langua...
Customer[] customers = Customers.ToArray(); Purchase[] purchases = Purchases.ToArray(); var groupJoinQuery = from c in customers join p in purchases on c.ID equals p.CustomerID into custPurchases select new { CustName = c.Name, custPurchases }; ...
When you bind a service to your application credentials become available through the VCAP_SERVICES environment variable. This environment variable contains JSON containing the credentials for all bound services. Example VCAP_SERVICES environment variable { "push-reappt": [ { ...
Use the UseCors() extension method on the IApplicationBuilder in the Configure method to apply the CORS policy to all requests. public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddCors(); } public void Configure(IApplicationBuilder app) { ...
To enable a certain CORS policy for specific controllers you have to build the policy in the AddCors extension within the ConfigureServices method: services.AddCors(cors => cors.AddPolicy("AllowAll", policy => { policy.AllowAnyOrigin() .AllowAnyMethod() ...
Open the psql command line tool connected to the database where your table is. Then type the following command: \d tablename To get extended information type \d+ tablename If you have forgotten the name of the table, just type \d into psql to obtain a list of tables and views in the current ...
Let's say you have a table called person: CREATE TABLE person ( person_id BIGINT NOT NULL, last_name VARCHAR(255) NOT NULL, first_name VARCHAR(255), age INT NOT NULL, PRIMARY KEY (person_id) ); You can create a new table of people over 30 like this: CREATE TABLE p...
To create a variable: variableType variableName; For example: int a; To create a variable and initialize it: variableType variableName = initialValue; For example: int a = 2;
If you have a variable declared before, you can assign some value to it: For example: int a; // declared previously a = 2; Or change the value: int a = 3; // initalized previously a = 2;
char : signed 1-byte character value byte : unsigned 8-bit integer int : signed 16-bit (on ATMEGA based boards) or 32-bit (on Arduino Due) integer unsigned int : unsigned 16-bit (on ATMEGA based boards) or 32-bit (on Arduino Due) integer long : signed 32-bit integer unsigned long : unsigned 3...

Page 15 of 62