Tutorial by Examples: al

Let's first recap how to initialize a 1D ruby array of integers: my_array = [1, 1, 2, 3, 5, 8, 13] Being a 2D array simply an array of arrays, you can initialize it like this: my_array = [ [1, 1, 2, 3, 5, 8, 13], [1, 4, 9, 16, 25, 36, 49, 64, 81], [2, 3, 5, 7, 11, 13, 17] ]
You can go a level further down and add a third layer of arrays. The rules don't change: my_array = [ [ [1, 1, 2, 3, 5, 8, 13], [1, 4, 9, 16, 25, 36, 49, 64, 81], [2, 3, 5, 7, 11, 13, 17] ], [ ['a', 'b', 'c', 'd', 'e'], ['z', 'y', 'x', 'w', 'v'] ], [ [] ...
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...
Detailed instructions on getting kinect set up or installed.Setting Up a Kinect Sensor Kinect for Windows 1.5, 1.6, 1.7, 1.8 Here are some simple steps to get your Kinect sensor up and running. Step 1: Mount the Sensor on a Stable Surface Place the sensor on a stable surface in a location wh...
/** * Apply a radial mask (vignette, i.e. fading to black at the borders) to a bitmap * @param imageToApplyMaskTo Bitmap to modify */ public static void radialMask(final Bitmap imageToApplyMaskTo) { Canvas canvas = new Canvas(imageToApplyMaskTo); final float centerX = imageToApply...
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/* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Connection: keep-alive The client will accept Content...
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...
from tensorflow.python.client import device_lib print(device_lib.list_local_devices())
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...
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...
from chempy import Equilibrium from chempy.chemistry import Species water_autop = Equilibrium({'H2O'}, {'H+', 'OH-'}, 10**-14) # unit "molar" assumed ammonia_prot = Equilibrium({'NH4+'}, {'NH3', 'H+'}, 10**-9.24) # same here from chempy.equilibria import EqSystem substances = ...
from chempy import ReactionSystem # The rate constants below are arbitrary rsys = ReactionSystem.from_string("""2 Fe+2 + H2O2 -> 2 Fe+3 + 2 OH-; 42 2 Fe+3 + H2O2 -> 2 Fe+2 + O2 + 2 H+; 17 H+ + OH- -> H2O; 1e10 H2O -> H+ + OH-; 1e-4 Fe+3 + 2 H2O -...
This is how you install the gcloud command-line tool, which is a part of the Google Cloud SDK. $ curl https://sdk.cloud.google.com | bash
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...
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...
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...
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 ...
<?xml version="1.0"?> <openerp> <data noupdate="1"> <function model="*model_name*" name="_configure_sales"/> </data> </openerp> This simple xml file is calls _configure_sales function from model_name ...

Page 260 of 269