Tutorial by Examples: and

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 ...
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;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-Encoding: compress, gzip Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzi...
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...
A simple OGL 4.0 GLSL shader program that shows how to map a 2D texture on a mesh. The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. The texture matrix defines how the texture is mapped on the mesh. By manipulating the texture matrix, the textu...
Each x sigil call respective sigil_x definition Defining Custom Sigils defmodule MySigils do #returns the downcasing string if option l is given then returns the list of downcase letters def sigil_l(string,[]), do: String.Casing.downcase(string) def sigil_l(string,[?l]), do: String.Casing...
A simple OGL 4.0 GLSL shader program that shows the use of a interface block and a uniform block on a Cook-Torrance microfacet light model implementation. The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. An Interface Block is a group of GLSL in...
Authorize yourself, you will be navigated to Google Sign In page. $ gcloud auth login Initialize or reinitialize the gcloud, you can set your configurations here. $ gcloud init Display information about the current gcloud environment. $ gcloud info Display the list of active SDK configur...
Simply use PHP’s standard syslog function to write logs syslog(LOG_INFO, "Authorized access"); syslog(LOG_WARNING, "Unauthorized access"); You can see the logs from "Stackdriver Logging" ( https://console.cloud.google.com/logs )
The QSqlDatabase class provides an interface for accessing a database through a connection. An instance of QSqlDatabase represents the connection. The connection provides access to the database via one of the supported database drivers. Make sure to Add QT += SQL in the .pro file. Assume an SQ...
modFTP Option Explicit Option Compare Text Option Private Module 'http://msdn.microsoft.com/en-us/library/aa384180(v=VS.85).aspx 'http://www.dailydoseofexcel.com/archives/2006/01/29/ftp-via-vba/ 'http://www.15seconds.com/issue/981203.htm 'Open the Internet object Private Declare Function...
Let’s Take an Example with Structure of Movie, here we have defined the structure as Codable. So, We can encode and decode it easily. struct Movie: Codable { enum MovieGenere: String, Codable { case horror, skifi, comedy, adventure, animation } var name : String v...
We can use ~ as a shorthand in some everyday scenarios. We know that ~ converts -1 to 0, so we can use it with indexOf on array. indexOf let items = ['foo', 'bar', 'baz']; let el = 'a'; if (items.indexOf('a') !== -1) {} or if (items.indexOf('a') >= 0) {} can be re-written as if (...
A simple OGL 4.0 GLSL shader program that shows the use shader subroutines. The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. The subroutines switch between different geometry generated in the geometry shader and change the surface representatio...

Page 148 of 153