Tutorial by Examples: bas

DirectByteBuffer is special implementation of ByteBuffer that has no byte[] laying underneath. We can allocate such ByteBuffer by calling: ByteBuffer directBuffer = ByteBuffer.allocateDirect(16); This operation will allocate 16 bytes of memory. The contents of direct buffers may reside outside ...
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)
This example shows how to have a view track a pan gesture and depart in a physics-based manner. Swift class ViewController: UIViewController { // Adjust to change speed of view from flick let magnitudeMultiplier: CGFloat = 0.0008 lazy var dynamicAnimator: UIDynamicAnimator ...
First, ensure you log in, and add the access_token to your request header. In this example, we're going to do some basic operations to access records. These use the Accounts module as an example, but other standard and custom modules (i.e. Leads, Contacts, Opportunities) behave in the same way. Cr...
Create a file (e.g. hello_world.py) in a text editor or a python editor if you have one installed (pick one if you don't - SublimeText, Eclipse, NetBeans, SciTe... there's many!) hwld = 'Hello world' print(hwld) Note that python variables do not need to be explicitly declared; the declaration h...
In order to load data from a MongoDB database into an R dataframe, use the library MongoLite: # Use MongoLite library: #install.packages("mongolite") library(jsonlite) library(mongolite) # Connect to the database and the desired collection as root: db <- mongo(collection = &quo...
use \Psr\Http\Message\ServerRequestInterface as Request; use \Psr\Http\Message\ResponseInterface as Response; require 'vendor/autoload.php'; $app = new \Slim\App; $app->get('/employee/view', function ($req, $res) { $con = new mysqli('localhost','USERNAME','PASSWORD','DATABASE'); ...
You can use django rest framework permission classes to check request headers and authenticate user requests Define your secret_key on project settings API_KEY_SECRET = 'secret_value' note: a good practice is to use environment variables to store this secret value. Define a permission ...
private void loadData(){ DatabaseReference dbRef = FirebaseDatabase.getInstance().getReference(); Query dataQuery = dbRef.child("chat").orderByChild("id").equalTo("user1"); dataQuery.addListenerForSingleValueEvent(new ValueEventListener() { ...
If we want to remove some database connection from the list of database connections. we need to use QSqlDatabase::removeDatabase(),however it's a static function and the way it work is a little wired. // WRONG WAY QSqlDatabase db = QSqlDatabase::database("sales"); QSqlQuery query(&...
Explains how the Windows installer works, what MSI packages are, what merge modules are, how and why transforms can be used and finally commandline options for MSIEXEC. Describes the tools being provided by Microsoft (and 3rd party authoring tools such as InstallShield, Advanced Installer, Wise Pac...
<dependencies> <dependency> <groupId>{ejbModuleGroupId}</groupId> <artifactId>{ejbModuleArtifactId}</artifactId> <version>{ejbModuleVersion}</version> <type>ejb</type> </dependency> &...
db2 connect to {databaseName} db2 drop table {schema}.{table} db2 connect reset The schema is not necessary if it matches the current user name. The "db2" prefix is not necessary if you are already in a DB2 command prompt.
Step 1: Open a Document Step 2 Option A: Press Alt + F11 This is the standard shortcut to open the VBE. Step 2 Option B: Developer Tab --> View Code First, the Developer Tab must be added to the ribbon. Go to File -> Options -> Customize Ribbon, then check the box for developer. Th...
First, you need to open your SQLite database, which can be done as follows: SQLiteDatabase myDataBase; String mPath = dbhelper.DATABASE_PATH + dbhelper.DATABASE_NAME; myDataBase = SQLiteDatabase.openDatabase(mPath, null, SQLiteDatabase.OPEN_READWRITE); After opening the database, you can easi...
We’ll first go over gaze-based interactions. Gaze-based interactions rely on rotating our heads and looking at objects to interact with them. This type of interaction is for headsets without a controller. Even with a rotation-only controller (Daydream, GearVR), the interaction is still similar. Sinc...
Also known as gaze-based cursor. If we set the cursor to be fuse-based, the cursor will trigger a click if the user gazes at an entity for a set amount of time. Imagine a laser strapped to the user’s head, and the laser extends out into the scene. If the user stares at an entity long enough (i.e., t...
You will need to install node.js - https://nodejs.org/en/ npm install -g @angular/cli - install the CLI by executing this command in the terminal ng new projectname - after executing this command in the terminal, you will create a new sub folder titled projectname in your current folder. cd pro...
function openDatabase(dbName) { var request = indexedDB.open(dbName); request.onsuccess = function (e) { var database = request.result; if (database) { console.log("Database initialized."); } else { console.error("Database is not initialized!");...
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...

Page 62 of 65