This file contains hidden or 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
| #!flask/bin/python | |
| import gym | |
| from flask import Flask, Response, jsonify | |
| import datetime | |
| app = Flask(__name__) | |
| envname = 'CartPole-v0' | |
| env = gym.make(envname) | |
| env.reset() |
This file contains hidden or 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
| // include SPI, MP3 and SD libraries | |
| #include <SPI.h> | |
| #include <Adafruit_VS1053.h> | |
| #include <SD.h> | |
| // These are the pins used for the music maker shield | |
| #define SHIELD_RESET -1 // VS1053 reset pin (unused!) | |
| #define SHIELD_CS 7 // VS1053 chip select pin (output) | |
| #define SHIELD_DCS 6 // VS1053 Data/command select pin (output) |
This file contains hidden or 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 shapeless.HNil | |
| object Example { | |
| trait Fruit | |
| case class Apple() | |
| case class Pear() | |
| // there could be more types of fruit defined elsewhere | |
| class FruitBowl { | |
| private[this] var fruits = HNil |