Tutorial by Examples: c

Once you are connected to a Gatt Server, you're going to be interacting with it by writing and reading from the server's characteristics. To do this, first you have to discover what services are available on this server and which characteristics are avaiable in each service: @Override public voi...
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...
You can use Bluetooth LE Advertising to broadcast data packages to all nearby devices without having to establish a connection first. Bear in mind that there's a strict limit of 31 bytes of advertisement data. Advertising your device is also the first step towards letting other users connect to you....
As it is with GitHub Desktop most of the work is pretty simple: You select "Clone a repository" (In the stable version the plus on the upper left) and there are some repositories (your own and the repos from each company you are in) recommended. Alternatively you can paste a link to any ot...
You can select a branch at the upper left. When you selected the right branch you need to press the sync button (upper right) which does now the same as git checkout BRANCHNAME. In the older version you are able to view 2 different branches at once and compare the pushes. Furthermore you could vi...
Pull (Sync) Like in the command line you need to pull the current state of the repository once in a while. In GitHub Desktop this process is called by the sync Button at the top right corner. Push When you made local changes and want to push them you make a commit by writing something into the su...
The default icon of the Date-Picker in the Extension Library from OpenNTF is nice but not sexy. You can change it to one of the cool "Font Awesome Icons". First, add a DatePicker component to your page: <xe:djDateTextBox id="datePickerComp" value="#{myDoc.myDateField}&q...
from requests import post payload = {'key1' : 'value1', 'key2' : 'value2' } foo = post('http://httpbin.org/post', data=payload) To pass form encoded data with the post operation, data must be structured as dictionary and supplied as the data parameter. If the data d...
Each section can can contain JavaScript and Stylesheets, these two languages are used within liquid tags: {% javascript %}{% endjavascript %} & {% stylesheet %}{% endstylesheet %}. When placing code inside of these two tags, Shopify compiles each piece into shopify_compiled.js & shopify_com...
Simple HTTP Authentication Simple HTTP Authentication can be achieved with the following: from requests import post foo = post('http://natas0.natas.labs.overthewire.org', auth=('natas0', 'natas0')) This is technically short hand for the following: from requests import post from requests.au...
import nltk from nltk.tokenize import sent_tokenize, word_tokenize text = 'We saw the yellow dog' word = word_tokenize(text) tag1 = nltk.pos_tag(word) print(tag1)
import UIKit struct Person { // Model let firstName: String let lastName: String } class GreetingViewController : UIViewController { // View + Controller var person: Person! let showGreetingButton = UIButton() let greetingLabel = UILabel() override func vie...
Activity is complete screen. UI is XML based and package com.example.android.activity; import android.os.Bundle; import android.app.Activity; public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceSta...
Create a new C# script in Unity and replace it's contents with the following using UnityEngine; using System.Collections; public static class UnityAndroidPlugin { }
Create a new C# script in Unity and paste these contents using UnityEngine; using System.Collections; public class UnityAndroidPluginGUI : MonoBehaviour { void OnGUI () { } }
This section will contain some of the most advanced examples realized using Multithreading. Advanced printer (logger) A thread that prints everything is received and modifies the output according to the terminal width. The nice part is that also the "already written" output is modified w...
Search engine optimization (SEO for short) is simply the process of obtaining website visitors (or traffic) from “free” or “organic” search results in search engines like Google or Bing. All major search engines have primary search results that are ranked based on what the search engine considers m...
Configuration file contains sections, each section contains keys and values. configparser module can be used to read and write config files. Creating the configuration file:- import configparser config = configparser.ConfigParser() config['settings']={'resolution':'320x240', ...
Laradock is a project that provides a ready to go contains tailored for Laravel use. Download or clone Laradock in your project's root folder: git clone https://github.com/Laradock/laradock.git Change directory into Laradock and generate the .env file needed to run your configurations: cd lara...
The raycaster has an origin, where its ray starts, and a direction, where the ray goes. The origin of the raycaster is at the raycaster entity’s position. We can change the origin of the raycaster by setting the position component of the raycaster entity (or parent entities of the raycaster entity)...

Page 778 of 826