Tutorial by Examples: ble

Like other value types, GUID also has a nullable type which can take null value. Declaration : Guid? myGuidVar = null; This is particularly useful when retrieving data from the data base when there is a possibility that value from a table is NULL.
The volatile keyword tells the compiler that the value of the variable may change at any time as a result of external conditions, not only as a result of program control flow. The compiler will not optimize anything that has to do with the volatile variable. volatile int foo; /* Different ways to ...
If You have Role: +-----------------------------+ | roleId | name | discription | +-----------------------------+ Rights: +-----------------------------+ | rightId | name | discription| +-----------------------------+ rightrole +------------------+ | roleId | rightId | +----------...
In your JS File add this option to your datatable: buttons: [ 'excel', 'pdf', 'copy' ] It will look like: $('#yourTableID').DataTable({ buttons: [ 'excel', 'pdf', 'copy' ] }); Add the necessary css files for the datatable with the buttons: <link rel="stylesheet" type=&quo...
On the official website of DataTable is an example of how a server-side process with PHP and MySQL can look. This example is deprecated and can no longer be used with PHP 7 (the function "mysql_pconnect" and the associated functions are deprecated, see this post). So this function gives y...
In order to show an alert dialog containing a link which can be opened by clicking it, you can use the following code: AlertDialog.Builder builder1 = new AlertDialog.Builder(youractivity.this); builder1.setMessage(Html.fromHtml("your message,<a href=\"http://www.google.com\"&gt...
To discovery all the available print services, we can use the PrintServiceLookup class. Let's see how: import javax.print.PrintService; import javax.print.PrintServiceLookup; public class DiscoveringAvailablePrintServices { public static void main(String[] args) { discoverPrintS...
In order to trigger a "upgradeneeded" event you need to request the database with version higher than the current version - otherwise the event won't be triggered. function createTable(dbName, dbversion, tableName) { var request = indexedDB.open(dbName, dbversion); request.onupgrade...
This is a more generic solution applicable in system where the user has option to add indexes to the table that he uses: function createTable(dbName, tableName) { var request = indexedDB.open(dbName); request.onsuccess = function (e){ var database = e.target.result; var version = p...
public void setCardColorTran(CardView card) { ColorDrawable[] color = {new ColorDrawable(Color.BLUE), new ColorDrawable(Color.RED)}; TransitionDrawable trans = new TransitionDrawable(color); if(Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { card.setB...
public void setCardColorTran(View view) { ColorDrawable[] color = {new ColorDrawable(Color.BLUE), new ColorDrawable(Color.RED)}; TransitionDrawable trans = new TransitionDrawable(color); if(Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) { view.setBackgrou...
Most Singleton examples use MonoBehaviour as the base class. The main disadvantage is that this Singleton class only lives during run time. This has some drawbacks: There is no way of directly editing the singleton fields other than changing the code. No way to store a reference to other assets...
Suppose you are comparing value with some variable if ( i == 2) //Bad-way { doSomething; } Now suppose you have mistaken == with =. Then it will take your sweet time to figure it out. if( 2 == i) //Good-way { doSomething; } Then, if an equal sign is accidentally left out, the ...
In PHP, variable values have an associated "truthiness" so even non-boolean values will equate to true or false. This allows any variable to be used in a conditional block, e.g. if ($var == true) { /* explicit version */ } if ($var) { /* $var == true is implicit */ } Here are some fun...
This is what I did to install CakePHP on a fresh installed minimal CentOS 7 Installed a CentOS-7-x86_64-Minimal-1611.iso in VirtualBox, two network interfaces: first NAT, second Host-Only set ONBOOT=yes in /etc/sysconfig/network-scripts/ifcfg-enp0s3 reboot yum update yum install net-tools (to...
import threading import time class StoppableThread(threading.Thread): """Thread class with a stop() method. The thread itself has to check regularly for the stopped() condition.""" def __init__(self): super(StoppableThread, self).__init__()...
Array ( [0] => Array ( [id] => 13 [category_id] => 7 [name] => Leaving Of Liverpool [description] => Leaving Of Liverpool [price] => 1.00 [virtual] => 1 [active] =...
The following rules define a simple strategy for creating immutable objects. Don't provide "setter" methods - methods that modify fields or objects referred to by fields. Make all fields final and private. Don't allow subclasses to override methods. The simplest way to do this is to d...
public final class Color { final private int red; final private int green; final private int blue; private void check(int red, int green, int blue) { if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255) { throw ...
In this case class Point is mutable and some user can modify state of object of this class. class Point { private int x, y; public Point(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public void setX(int ...

Page 59 of 62