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
# Simple Snake Game in Python 3 for Beginners | |
# By @TokyoEdTech | |
import turtle | |
import time | |
import random | |
delay = 0.1 | |
# Score |
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 asyncio | |
import random | |
import time | |
async def worker(name, queue): | |
while True: | |
# Get a "work item" out of the queue. | |
sleep_for = await queue.get() |
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
#!/bin/bash | |
### steps #### | |
# Verify the system has a cuda-capable gpu | |
# Download and install the nvidia cuda toolkit and cudnn | |
# Setup environmental variables | |
# Verify the installation | |
### | |
### to verify your gpu is cuda enable check |
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 cv2 | |
import io | |
import socket | |
import struct | |
import time | |
import pickle | |
import zlib | |
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
client_socket.connect(('192.168.1.124', 8485)) |
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
""" | |
An adaptation of Adafruit's thermal camera example which | |
uses the sense hat to display temperatures. | |
Martin O'Hanlon | |
@martinohanlon | |
stuffaboutco.de | |
""" | |
from sense_hat import SenseHat | |
from Adafruit_AMG88xx import Adafruit_AMG88xx |
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
Panels: | |
- Class: rviz/Displays | |
Help Height: 129 | |
Name: Displays | |
Property Tree Widget: | |
Expanded: | |
- /Global Options1 | |
- /Status1 | |
- /LaserScan1 | |
- /PointCloud21 |
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
# MAC OS Theme that will make the terminal look like Ubuntu | |
# This theme has been created from scratch by fetching all the ANSI colors and fonts from Ubuntu. | |
# With the exception of the following command fetched from | |
# http://osxdaily.com/2012/02/21/add-color-to-the-terminal-in-mac-os-x/ | |
# command: "export LSCOLORS=ExFxBxDxCxegedabagacad" | |
# 1) Copy the following under ~/.bash_profile and restart the terminal. |
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
from keras.models import load_model | |
from keras.preprocessing import image | |
import numpy as np | |
import os | |
# image folder | |
folder_path = '/path/to/folder/' | |
# path to model | |
model_path = '/path/to/saved/model.h5' | |
# dimensions of images |
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
#!/usr/bin/env python | |
'''Crop an image to just the portions containing text. | |
Usage: | |
./crop_morphology.py path/to/image.jpg | |
This will place the cropped image in path/to/image.crop.png. | |
For details on the methodology, see |
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 tensorflow as tf | |
### Linear Regression ### | |
# Input placeholders | |
x = tf.placeholder(tf.float32, name='x') | |
y = tf.placeholder(tf.float32, name='y') | |
# Model parameters | |
W1 = tf.Variable([0.1], tf.float32) | |
W2 = tf.Variable([0.1], tf.float32) | |
W3 = tf.Variable([0.1], tf.float32) | |
b = tf.Variable([0.1], tf.float32) |