Tutorial by Examples: ce

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....
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 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate...
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 Accept-Language: en-US,en;q=0.5 Accept-Encod...
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: * Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate C...
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: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive The client will accept Engl...
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: da, en-gb;q=0.8, en;q=0.7 Accept-Encoding: gzip, deflate Connection: keep-alive The client prefe...
Laravel resource routing assigns the typical "CRUD" routes to a controller with a single line of code. For example, you may wish to create a controller that handles all HTTP requests for "photos" stored by your application. Using the make:controller Artisan command, we can quickl...
To ensure that a GPU version TensorFlow process only runs on CPU: import os os.environ["CUDA_VISIBLE_DEVICES"]="-1" import tensorflow as tf For more information on the CUDA_VISIBLE_DEVICES, have a look to this answer or to the CUDA documentation.
To use a particular set of GPU devices, the CUDA_VISIBLE_DEVICES environment variable can be used: import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"]="0" # Will use only the first GPU device os.en...
from tensorflow.python.client import device_lib print(device_lib.list_local_devices())
This widget is used to display items with hierarchy. For instance, windows explorer can be reproduced in this way. Some nice tables can be also done using treeview widget. Create the widget tree=ttk.Treeview(master) Definition of the columns You can define how many columns, their width and min...
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...
Create a Cloud SQL instance $dsn = "/cloudsql/PROJECT:REGION:INSTANCE;dbname=DATABASE"; $user = "USER"; $password = "PASSWORD"; $db = new PDO($dsn, $user, $password); //Whatever is your favorite MySQL connection method The important part here is /cloudsql/PRO...
import shelve d = shelve.open(filename) # open -- file may get suffix added by low-level # library d[key] = data # store data at key (overwrites old data if # using an existing key) data = d[key] # retrieve a C...
The processor just contains just contains the methods needed by the route. It is just a classic Java Bean containing several methods. You can also implement Processor and override the process method. See the code below : @Component("testExampleProcessor") public class TestExampleProcess...
Relational DatabaseElasticsearchDatabaseIndexTableTypeRow/RecordDocumentColumn Namefield Above table roughly draws an analogy between basic elements of relational database and elasticsearch. Setup Considering Following structure in a relational database: create databse test; use test; crea...

Page 129 of 134