Tutorial by Examples

App Engine does not allow writing to files, instead write to and read from Cloud Storage. Write to Cloud Storage $file = 'gs://<your-bucket>/hello.txt'; file_put_contents($file, 'hello world'); Read from Cloud Storage $contents = file_get_contents($file); var_dump($contents);
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 )
Detailed instructions on getting microsoftgraph set up or installed.
"""PyAudio Example: Play a wave file (callback version).""" import pyaudio import wave import time import sys if len(sys.argv) < 2: print("Plays a wave file.\n\nUsage: %s filename.wav" % sys.argv[0]) sys.exit(-1) wf = wave.open(sys.arg...
"""PyAudio Example: Play a wave file.""" import pyaudio import wave import sys CHUNK = 1024 if len(sys.argv) < 2: print("Plays a wave file.\n\nUsage: %s filename.wav" % sys.argv[0]) sys.exit(-1) wf = wave.open(sys.argv[1], 'rb') # i...
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...
It's often convenient to separate the SQL query from the actual values. This can be done using placeholders. Qt supports two placeholder syntaxes: named binding and positional binding. named binding: QSqlQuery query; query.prepare("INSERT INTO employee (id, name, salary) VALUES (:id, :name,...
To shelve an object, first import the module and then assign the object value as follows: import shelve database = shelve.open(filename.suffix) object = Object() database['key'] = object
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 simplest way to use shelve is via the DbfilenameShelf class. It uses anydbm to store the data. You can use the class directly, or simply call shelve.open(): import shelve s = shelve.open('test_shelf.db') try: s['key1'] = { 'int': 10, 'float':9.5, 'string':'Sample data' } finally: ...
Shelves do not track modifications to volatile objects, by default. That means if you change the contents of an item stored in the shelf, you must update the shelf explicitly by storing the item again. import shelve s = shelve.open('test_shelf.db') try: print s['key1'] s['key1']['new_...
The following route has a simple goal : First, it checks if and ImportDocumentProcess object is present in the database and adds it as an exchange header Then, it adds an ImportDocumentTraitement (Which is linked to the previous ImportDocumentProcess) in the database Here is the code of this ...
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...
Don't forget to add the camel test support and spring camel test support to your project dependencies. See the following for maven users : <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-test</artifactId> <version>${camel.version}...
A simple OGL 4.0 GLSL shader program that shows the use of geometry shaders. The program is executed with a phyton script. To run the script, PyOpenGL and NumPy must be installed. In this example, the entire geometry (a cylinder) is generated in the geometry shader. Vertex shader geo.vert #vers...
The other thing about Proxy class, and why it is not so popular, is that it is rather difficult to fathom a problem that exactly needs a dynamic class with a controllable access to its dynamic properties and methods as a most appropriate solution. Every time I tried to use Proxy, I have ended up res...
package { import flash.display.Sprite; /** * Daemonette of Slaanesh. * * It is minor female demon, vaguely human-like, but with crab-like pincers instead of hands. * She wears a rather indecent skimpy leather bikini, moves quickly and casts deadly spells! ...
Cashier Laravel Cashier provides an expressive, fluent interface to Stripe's and Braintree's subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing. In addition to basic subscription management, Cashier can handle coupons, swapping...
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...
Essence of searching lies in its order. Everyone wants search results to be shown in such a way that best suited results are shown on top. Relational database do not have such capability. Elasticsearch on the other hand shows results on the basis of relevancy by default. Setup Same as used in ...

Page 1294 of 1336