Tutorial by Examples: an

A HandlerThread can be used to start a thread with a Looper. This looper then can be used to create a Handler for communications with it. HandlerThread thread = new HandlerThread("thread-name"); thread.start(); Handler handler = new Handler(thread.getLooper());
In this example, a plot with curves having common y-axis but different x-axis is demonstrated using twiny() method. Also, some additional features such as the title, legend, labels, grids, axis ticks and colours are added to the plot. # Plotting tutorials in Python # Adding Multiple plots by twin ...
Promises handle errors differently to synchronous or callback-driven code. const p = new Promise(function (resolve, reject) { reject(new Error('Oops')); }); // anything that is `reject`ed inside a promise will be available through catch // while a promise is rejected, `.then` will not be ...
There are many ways to use MaterializeCSS framework. Few things to keep in mind before going to installation It is not a CSS only framwork, though it has CSS name in it. We can use its SCSS too It is not built for Angular It is a component framework too built on jquery. Though we are not supp...
It was most frequent question that can a same thread can be run twice. The answer for this is know one thread can run only once . if you try to run the same thread twice it will execute for the first time but will give error for second time and the error will be IllegalThreadStateException . exam...
Django Views are simply the functions that get called when a request is made to a certain URLs. URL patterns are written in urls.py file, each URL regex is given a function(Django view) from a views.py, so when a request is made, that function gets the call, with the HTTP request object, and then y...
Accessing the 3rd element of the first subarray: my_array[1][2]
Option Explicit 'GetSystemMetrics32 info: http://msdn.microsoft.com/en-us/library/ms724385(VS.85).aspx #If Win64 Then Private Declare PtrSafe Function GetSystemMetrics32 Lib "User32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long #ElseIf Win32 Then Private...
This is how you can react to exceptions which have not been catched, similar to the system's standard "Application XYZ has crashed" import android.app.Application; import android.util.Log; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.text....
A simple OGL 4.0 GLSL shader program that shows the use of a model, view, and projection matrix The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. Projection matrix: The projection matrix describes the mapping of a pinhole camera from 3D poi...
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: UTF-8, iso-8859-1 Accept-Language: en-US,en;q=0.5 Accept-Encoding: g...
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: UTF-8, iso-8859-1;q=0.8, *;q=0.5 Accept-Language: en-US,en;q=0.5 Acc...
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html;q=1.0,application/xml;q=0.9 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive ...
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-aliv...
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: compress, gzip Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzi...
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html Accept-Language: * Accept-Encoding: gzip, deflate Connection: keep-alive The client will accept any language.
To specify Contact and Address info for an Employee, you should always invoke Select() method on the Contact and Address data views prior to assigning any field values. It is also recommended to assign the result of Select() method to the Contact and Address data views' Current property to guarantee...
When you need to override Bill-To Contact and Bill-To Address info for a Customer, the very first step is to set correct values for the IsBillContSameAsMain and IsBillSameAsMain properties of the Customer DAC. Don't forget to invoke Update() method on the Customer cache right after you updated IsBil...
To specify Bill-To Contact and Bill-To Address info for a Sales Order, you should always first invoke Select() method on the Billing_Contact and Billing_Address data views prior to assigning any field values. It is also recommended to assign the result of Select() method to the Billing_Contact and B...
In C++ code bases which used to be C, one can find the pattern goto cleanup. As the goto command makes the workflow of a function harder to understand, this is often avoided. Often, it can be replaced by return statements, loops, functions. Though, with the goto cleanup one needs to get rid of clean...

Page 296 of 307