Tutorial by Examples: co

import tensorflow as tf sess = tf.Session(config=tf.ConfigProto(device_count={'GPU': 0})) Bear in mind that this method prevents the TensorFlow Graph from using the GPU but TensorFlow still lock the GPU device as described in this an issue opened on this method. Using the CUDA_VISIBLE_DEVICES se...
By default, TensorFlow pre-allocate the whole memory of the GPU card (which can causes CUDA_OUT_OF_MEMORY warning). To change this, it is possible to change the percentage of memory pre-allocated, using per_process_gpu_memory_fraction config option, A value between 0 and 1 that indicates wh...
Copy the content into a file and save the file as .iex.exs in your ~ home directory and see the magic. You can also download the file HERE # IEx.configure colors: [enabled: true] # IEx.configure colors: [ eval_result: [ :cyan, :bright ] ] IO.puts IO.ANSI.red_background() <> IO.ANSI.white() ...
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...
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...
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
When trying to open a Database Connection with QODBC please ensure You have QODBC driver available Your server has an ODBC interface and is enabled to (this depends on your ODBC driver installations) use shared memory access, TCP/IP connections or named pipe connection. All connections only ...
class *model_name*(models.Model): _name = *model_name* @api.model def _configure_sales(self): # Do the configuration here Every time when module will be installed this function will run. Note: If you remove noupdate from xml, function will run on upgrading as well.
A basic but illustrative heatmap showing correlations between a number of variables. import pandas as pd import seaborn as sns import numpy as np # Sample dataframe with date index and five variables np.random.seed(123) df = pd.DataFrame(np.random.uniform(-0.25,0.25,size=(5, 5)), ...
In this example i will show how to formulate an rest controller to get and post data to the database using JPA with the most ease and least code. In this example we will refer to the data table named buyerRequirement . BuyingRequirement.java @Entity @Table(name = "BUYINGREQUIREMENTS&q...
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...
~~ Could be used on non-numeric values. A numeric expression will be first converted to a number and then performed bitwise NOT operation on it. If expression cannot be converted to numeric value, it will convert to 0. true and false bool values are exceptions, where true is presented as numeric v...
add_action('rest_api_init', 'my_rest_validate_endpoint' ); function my_rest_validate_endpoint() { // Declare our namespace $namespace = 'myrest/v1'; // Register the route // Example URL matching this route: // http://yourdomain/wp-json/myrest/v1/guides/tag=europe/price=...
While using scrollviews in storyboard it's better to calculate content size according to number of views present in scrollview rather than giving content size programatically with static value. Here are the steps to get content size dynamically. Step 1 : Add Scrollview to view in storyboard and ...
The Xamarin Forms Entry control does not have a MaxLength property. To achieve this you can extend Entry as below, by adding a Bindable MaxLength property. Then you just need to subscribe to the TextChanged event on Entry and validate the length of the Text when this is called: class CustomEntry ...
animated_android_dialog_box.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="16dp"> &...
When using cURL for some queries to the Docker API, it might be a bit tricky to pass some complex structures. Let's say, getting a list of images allows using filters as a query parameter, which have to be a JSON representation of map[string][]string (about the maps in Go you can find more here). H...
@Controller @RequestMapping("/appointments") public class AppointmentsController { //your handlers here, for example: @RequestMapping(path = "/new", method = RequestMethod.GET) public AppointmentForm getNewForm() { return new AppointmentForm(); } @RequestMapping...
The sec:authorize attribute renders its content when the attribute expression is evaluated to true <div sec:authorize="hasRole('ROLE_ADMIN')"> Content for administrators </div> <div sec:authorize="hasRole('ROLE_USER')"> Content for users </div&g...

Page 241 of 248