Tutorial by Examples: ai

Many recursive algorithms can be expressed using iteration. For instance, the greatest common denominator function can be written recursively: def gdc (x, y) return x if y == 0 return gdc(y, x%y) end or iteratively: def gdc_iter (x, y) while y != 0 do x, y = y, x%y end re...
For example, say below is the sample data in an Excel 'Test', Purchase_Date Customer_Name Price 05-05-2017 Adam 1075 06-05-2017 Noah 1093 07-05-2017 Peter 1072 08-05-2017 Louis 1101 09-05-2017 Zoe 1248 10-05-2017 Kevin 1045 11-05-2017 Messiah 1...
if (Patterns.EMAIL_ADDRESS.matcher(email).matches()){ Log.i("EmailCheck","It is valid"); }
ChainMap is new in version 3.3 Returns a new ChainMap object given a number of maps. This object groups multiple dicts or other mappings together to create a single, updateable view. ChainMaps are useful managing nested contexts and overlays. An example in the python world is found in the implemen...
This will take about 30 minutes. We will be setting Ruby on Rails Development Environment on Ubuntu 16.10 Yakkety Yak. You'll want to download the latest Desktop version here: http://releases.ubuntu.com/17.04/ Open up your terminal using Ctrl + Alt + T. Installing Ruby The First step is to ins...
def main(): train_X, train_Y = read_data() train_X = feature_normalize(train_X) run_training(train_X, train_Y) Note: remember review functions dependencies. read_data, feature_normalize and run_training
Any @Component or @Configuration could be marked with @Profile annotation @Configuration @Profile("production") public class ProductionConfiguration { // ... } The same in XML config <beans profile="dev"> <bean id="dataSource" class="&l...
It is possible to DELETE data from a table if it matches (or mismatches) certain data in other tables. Let's assume we want to DELETEdata from Source once its loaded into Target. DELETE FROM Source WHERE EXISTS ( SELECT 1 -- specific value in SELECT doesn't matter FROM Target ...
General Imports, using jinja2 to populate templates into htmls. import jinja2 import webapp2 Important import to use Users API: from google.appengine.api import users Setting of Jinja environment: [into the example the tehcnology selected to populate the information into the frontend] JINJ...
If we want our app data to be protected against iTunes backups, we have to skip our app data from being backed up in iTunes. Whenever iOS device backed up using iTunes on macOS, all the data stored by all the apps is copied in that backup and stored on backing computer. But we can exclude our app ...
This command allows you to change or view the TLD (top-level domain) used to bind domains to your local machine. Get The Current TLD $ valet domain > dev Set the TLD $ valet domain local > Your Valet domain has been updated to [local].
Function using promises: function myAsyncFunction() { return aFunctionThatReturnsAPromise() // doSomething is a sync function .then(result => doSomething(result)) .catch(handleError); } So here is when Async/Await enter in action in order to get clean...
A common problem might be trying to iterate over Array which has no values in it. For example: Dim myArray() As Integer For i = 0 To UBound(myArray) 'Will result in a "Subscript Out of Range" error To avoid this issue, and to check if an Array contains elements, use this oneliner: If...
4.4 Defaults ... ... The default Size depends on the type. For integer it is 8. For float it is 64. For binary it is the size of the specified binary: 1> Bin = << 17/integer, 3.2/float, <<97, 98, 99>>/binary >>. <<17,64,9,153,153,153,153,153,154,97,98,99>...
First, determine the source file for this particular driver. Found it at drivers/usb/serial/ftdi_sio.c. ./scripts/get_maintainer.pl drivers/usb/serial/ftdi_sio.c And the results: Johan Hovold <[email protected]> (maintainer:USB SERIAL SUBSYSTEM) Greg Kroah-Hartman <gregkh@linuxfounda...
The API call avio_alloc_context, which sets up a custom IO context, takes in a pointer to a Read function. If you are reading from an IStream, you can use the following: /** * Reads from an IStream into FFmpeg. * * @param ptr A pointer to the user-defined IO data structure. * @param b...
Using the command git tag lists out all available tags: $ git tag <output follows> v0.1 v1.3 Note: the tags are output in an alphabetical order. One may also search for available tags: $ git tag -l "v1.8.5*" <output follows> v1.8.5 v1.8.5-rc0 v1.8.5-rc1 v1.8.5...
Since Git 2.13, multiple usernames and email addresses could be configured by using a folder filter. Example for Windows: .gitconfig Edit: git config --global -e Add: [includeIf "gitdir:D:/work"] path = .gitconfig-work.config [includeIf "gitdir:D:/opensource/"] ...
I am assuming that you have aware about the some syntax of Kotlin and how to use, just add RecyclerView in activity_main.xml file and set with adapter class. class MainActivity : AppCompatActivity(){ lateinit var mRecyclerView : RecyclerView val mAdapter : RecyclerAdapter = ...
The StandardClaim is embedded in the custom type to allow for easy encoding, parsing and validation of standard claims. tokenString := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJleHAiOjE1MDAwLCJpc3MiOiJ0ZXN0In0.HE7fK0xOQwFEr4WDgRWj4teRPZ6i3GLwD5YCm6Pwu_c" type MyCustomCla...

Page 44 of 47