Tutorial by Examples: an

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...
This is an Angular 2 wrapper library for Dropzone. npm install angular2-dropzone-wrapper --save-dev Load the module for your app import { DropzoneModule } from 'angular2-dropzone-wrapper'; import { DropzoneConfigInterface } from 'angular2-dropzone-wrapper'; const DROPZONE_CONFIG: Dropzon...
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...
from chempy import balance_stoichiometry # Main reaction in NASA's booster rockets: reac, prod = balance_stoichiometry({'NH4ClO4', 'Al'}, {'Al2O3', 'HCl', 'H2O', 'N2'}) from pprint import pprint pprint(reac) {'Al': 10, 'NH4ClO4': 6} pprint(prod) {'Al2O3': 5, 'H2O': 9, 'HCl': 6, 'N2': 3} ...
from chempy import Equilibrium from sympy import symbols K1, K2, Kw = symbols('K1 K2 Kw') e1 = Equilibrium({'MnO4-': 1, 'H+': 8, 'e-': 5}, {'Mn+2': 1, 'H2O': 4}, K1) e2 = Equilibrium({'O2': 1, 'H2O': 2, 'e-': 4}, {'OH-': 4}, K2) coeff = Equilibrium.eliminate([e1, e2], 'e-') coeff [4, -5...
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...
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...
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...
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: ...
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...
It is possible to switch the language of Crystal Reports user interface. It may be useful to change the language to English before posting screenshots on StackOverflow. You can switch between languages using View | Product Locale: This menu shows all language packs that have been selected during...
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...
Create a New Project on Google Developer Console To integrate Android application with Google Drive, create the credentials of project in the Google Developers Console. So, we need to create a project on Google Developer console. To create a project on Google Developer Console, follow these steps:...
This is an example of a basic GUI with two buttons that change a value stored in the GUI's handles structure. function gui_passing_data() % A basic GUI with two buttons to show a simple use of the 'handles' % structure in GUI building % Create a new figure. f = figure(); ...
A simple OGL 4.0 GLSL shader program that shows that shows how to add details with tessellation shader to the geometry. The program is executed with a python script. To run the script, PyOpenGL and NumPy must be installed. The basic mesh in this example is an icosahedron that consists of 20 triang...

Page 297 of 307