Think your business could make use of Google's machine learning expertise when it comes to powering and improving your business applications, but do you get stuck on building and training your own custom model? While a few cloud providers offer pre-trained models, Google Cloud Platform (GCP) offers five APIs: Google Cloud Vision API, Cloud Speech API, Cloud Natural Language API, Cloud Translation API and Cloud Video API. In this session you will see how with a single API call you can enrich your application through code and live demo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mysqlx = require('@mysql/xdevapi'); | |
const options = require('./config') | |
mysqlx.getSession(options) | |
.then((session) => { | |
const db = session.getSchema("worldcup"); | |
let teamsCollection = db.getCollection("teams_2018"); | |
return teamsCollection.find("name = :country1 OR name = :country2") | |
.bind("country1", "Brazil") | |
.bind("country2", "England") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
4, | |
"Brazil ", | |
{ | |
"players": [{ | |
"id": 70, | |
"dob": "05.03.1993", | |
"club": "FC Shakhtar Donetsk (UKR)", | |
"name": "FRED", | |
"height": 169, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mysqlx = require('@mysql/xdevapi'); | |
const options = require('./config') | |
mysqlx.getSession(options) | |
.then((session) => { | |
const db = session.getSchema("worldcup"); | |
const tableTeams = db.getTable("teams"); | |
return tableTeams; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DESCRIBE `users`; | |
-- +-------------+--------------+------+-----+-------------------+-----------------------------+ | |
-- | Field | Type | Null | Key | Default | Extra | | |
-- +-------------+--------------+------+-----+-------------------+-----------------------------+ | |
-- | id | int(11) | NO | PRI | NULL | auto_increment | | |
-- | id_str | varchar(255) | NO | UNI | NULL | | | |
-- | screen_name | varchar(255) | NO | MUL | NULL | | | |
-- | response | json | NO | | NULL | | | |
-- | created_at | datetime | NO | | CURRENT_TIMESTAMP | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Virtual Column | |
ALTER TABLE `laps` | |
ADD COLUMN speed DOUBLE | |
GENERATED ALWAYS | |
AS (`distance` / `time`); | |
-- Stored Column | |
ALTER TABLE `laps` | |
ADD COLUMN speed DOUBLE | |
GENERATED ALWAYS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `laps` ( | |
`id` INT(10) NOT NULL AUTO_INCREMENT, | |
`athlete` VARCHAR(255) NOT NULL, | |
`distance` INT(10) NOT NULL, | |
`time` INT(10) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE = InnoDB; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateUsers < ActiveRecord::Migration[5.1] | |
def change | |
create_table :users do |t| | |
t.string :name | |
t.timestamps | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE addresses ADD CONSTRAINT `fk_user_id` FOREIGN KEY (`user_id`) REFERENCES users (`id`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users = User.all | |
users.each do |user| | |
puts "Name #{user.name}" | |
puts "Addresses: " | |
user.addresses.each do |address| | |
puts address.street | |
puts "#{address.city} - #{address.state}" | |
end |