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
// | |
// MARK: - Step 1. Configuration | |
// | |
/* | |
You need to enable one feature in order to allow our app play sounds in *background* mode. | |
Select the Capabilities tab of project's main target, go to Background Modes section and select: | |
**Audio, AirPlay and Picture in Picture |
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
// | |
// MARK: - CoreML Methods | |
// | |
extension TablaViewController | |
{ | |
/** | |
Predice el doble de un número usando un modelo `CoreML` | |
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
/// Modelo ML | |
private lazy var model: TablaModel = TablaModel() |
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
from sklearn.linear_model import LinearRegression | |
# N veces | |
X_train = [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10]] | |
# Resultado | |
y_train = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20] | |
model = LinearRegression() | |
model.fit(X_train, y_train) |
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
from sklearn.linear_model import LinearRegression | |
# N veces | |
X_train = [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10]] | |
# Resultado | |
y_train = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20] | |
model = LinearRegression() | |
model.fit(X_train, y_train) |
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
import Foundation | |
// | |
// MARK: - Venue struct representation | |
// | |
/** | |
Different venue types. | |
*/ | |
public enum Kind: String, Codable |
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
/* | |
An autoclosure is a closure that is automatically created to wrap an expression that’s being passed as an argument to a function. | |
It doesn’t take any arguments, and when it’s called, it returns the value of the expression that’s wrapped inside of it | |
*/ | |
let greeting: () -> (String) = { | |
print("You can do other things here...") | |
return "Hi everyone!" |
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
import CoreMotion | |
import Foundation | |
let queue: OperationQueue = OperationQueue() | |
queue.qualityOfService = .utility | |
let motionManager: CMMotionManager = CMMotionManager() | |
motionManager.magnetometerUpdateInterval = 0.5 | |
motionManager.startMagnetometerUpdates(to: queue, withHandler: { (data: CMMagnetometerData?, error: Error?) -> Void in |
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
// Creamos el LivePhotos Player. | |
const player = LivePhotosKit.Player(document.getElementById('livephotos-layer')); | |
player.photoSrc = 'images/live/waves.jpg'; | |
player.videoSrc = 'images/live/waves.mov'; | |
// | |
// Eventos | |
// |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Ejemplo LivePhotosKit JS</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<div id="livephotos-layer" style="width: 1024px; height: 720px;"></div> | |
</body> |