Tutorial by Examples

Because Node.js runs on a single process uncaught exceptions are an issue to be aware of when developing applications. Silently Handling Exceptions Most of the people let node.js server(s) silently swallow up the errors. Silently handling the exception process.on('uncaughtException', functio...
There are two methods using which you can consume data from AWS S3 bucket. Using sc.textFile (or sc.wholeTextFiles) API: This api can be used for HDFS and local file system as well. aws_config = {} # set your aws credential here sc._jsc.hadoopConfiguration().set("fs.s3n.awsSecretAccessK...
Detailed instructions on getting indexeddb set up or installed.
Fixed-width files are text files in which columns are not separated by any character delimiter, like , or ;, but rather have a fixed character length (width). Data is usually padded with white spaces. An example: Column1 Column2 Column3 Column4Column5 1647 pi 'important' ...
Many custom views need to accept user interaction in the form of touch events. You can get access to touch events by overriding onTouchEvent. There are a number of actions you can filter out. The main ones are ACTION_DOWN: This is triggered once when your finger first touches the view. ACTION_MO...
HTML (classes used are based on Semantic-UI) <div id="app" class="ui grid"> <div class="row"> <div class="column"> <div class="ui label">Vechicle Make</div> <select class="ui dropdown"...
Seismic is an Android device shake detection library by Square. To use it just start listening to the shake events emitted by it. @Override protected void onCreate(Bundle savedInstanceState) { sm = (SensorManager) getSystemService(SENSOR_SERVICE); sd = new ShakeDetector(() -> { /* rea...
Sonim devices have varying by model a lot of different custom buttons: PTT_KEY com.sonim.intent.action.PTT_KEY_DOWN com.sonim.intent.action.PTT_KEY_UP YELLOW_KEY com.sonim.intent.action.YELLOW_KEY_DOWN com.sonim.intent.action.YELLOW_KEY_UP SOS_KEY com.sonim.intent.action.SOS_KEY_DOWN co...
PTT Button android.intent.action.PTT.down android.intent.action.PTT.up Confirmed on: RG730, RG740A
ImageMagick includes a number of command-line utilities for manipulating images. Here we will use compare command-line tool. compare tool is very useful. Suppose you want to test (e.g. layout, color, icons etc.) the difference between your expected design UI HTML file with actual result of JSP...
Detailed instructions on getting vector set up or installed.
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!");...
pry is a powerful tool that can be used to debug any ruby application. Setting up a ruby-on-rails application with this gem is very easy and straightforward. Setup To start debugging your application with pry Add gem 'pry' to the application's Gemfile and bundle it group :development, :test ...
In xcode developers can pause/break the execution of running app and can examine the state of program. Here's how to pause running programs: Just open any file in which we want to put breakpoint and click on the line on gutter at left side where we want to pause execution. So here we placed bre...
As recently Apple rolled out iOS11 and Xcode-9, we can now debug apps on devices without connecting devices to Xcode through USB. We can take advantage of wireless debugging feature added to this Xcode-9. To enable wireless debugging, we have to configure some steps in Xcode. 1 First connect the ...
Given a rod of length n inches and an array of length m of prices that contains prices of all pieces of size smaller than n. We have to find the maximum value obtainable by cutting up the rod and selling the pieces. For example, if length of the rod is 8 and the values of different pieces are given ...
#include <threads.h> #include <stdio.h> int run(void *arg) { printf("Hello world of C11 threads."); return 0; } int main(int argc, const char *argv[]) { thrd_t thread; int result; thrd_create(&thread, run, NULL); thrd_join(&...
The problem statement is like if we are given two string str1 and str2 then how many minimum number of operations can be performed on the str1 that it gets converted to str2.The Operations can be: Insert Remove Replace For Example Input: str1 = "geek", str2 = "gesek" Ou...
Installing Typescript and running typescript compiler. To install Typescript Comiler npm install -g typescript To check with the typescript version tsc -v Download Visual Studio Code for Linux/Windows Visual Code Download Link Open Visual Studio Code Open Same Folde where you have in...
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 1279 of 1336