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
memo = {1:1} | |
def fact(n): | |
global memo | |
if not n in memo: | |
if n > max(memo) + 500: | |
fact(min(n, max(memo)+500)) | |
memo[n] = n * fact(n-1) | |
return memo[n] | |
if __name__ == "__main__": |
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
# Python file downloader for Pythonista by OMZ Software | |
# By: EJM Software ---- http://ejm.cloudvent.net | |
# Source: https://gist.github.com/89edf288a15fde45682a | |
# ***************************************** | |
# This simple script uses the requests module to download files | |
# and the ui module to show a progress bar | |
# You can use this bookmarklet to download files from Safari: | |
# javascript:window.location='pythonista://filedownloader?action=run&argv='+encodeURIComponent(document.location.href); | |
import ui, console, clipboard, sys, requests, zipfile |
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
# Pythonista Markdown Editor | |
# By: EJM Software ---- http://ejm.cloudvent.net | |
# Source: http://gist.github.com/02df085647247a815eff | |
# ***************************************** | |
import ui, console, editor, markdown, webbrowser, urllib | |
@ui.in_background | |
def new_md(sender): | |
filename = console.input_alert('', 'File Name') | |
if filename.find('.')>-1: |
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 requests, datetime, pytz | |
class AssetStoreException (Exception): | |
pass | |
class AssetStoreClient(object): | |
LOGIN_URL = 'https://publisher.assetstore.unity3d.com/login' | |
LOGOUT_URL = 'https://publisher.assetstore.unity3d.com/logout' | |
SALES_URL = 'https://publisher.assetstore.unity3d.com/sales.html' | |
USER_OVERVIEW_JSON_URL = 'https://publisher.assetstore.unity3d.com/api/user/overview.json' |
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 <avr/pgmspace.h> // allows use of PROGMEM | |
#define CUBESIZE 4 | |
#define PLANESIZE CUBESIZE*CUBESIZE | |
#define PLANETIME 100 // time each plane is displayed in us -> 100 Hz refresh | |
#define TIMECONST 20 // multiplies DisplayTime to get ms | |
// store LED Pattern Table in PROGMEM | |
// last column is display time in 100ms | |
const char PROGMEM PatternTable[] = { |
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 wave | |
import matplotlib.path as mpath | |
import matplotlib.patches as mpatches | |
import matplotlib.pyplot as plt | |
fig, ax = plt.subplots() | |
Path = mpath.Path | |
path_data = [] |
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
############################################################################### | |
##### INSTALL ROS KINETIC ##################################################### | |
############################################################################### | |
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' | |
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116 | |
sudo apt-get update | |
sudo apt-get install -y ros-kinetic-ros-base | |
sudo rosdep init | |
rosdep update |
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
# | |
# FILE: print_binary.asm | |
# AUTHOR: Elliot Miller, 2017 | |
# | |
############################################################################### | |
.data | |
newline_string: .asciiz "\n" | |
# | |
# Name: print_binary |
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
.text | |
mont: li $v0,4 | |
la $a0,d | |
syscall | |
jr $ra | |
.data | |
a:.byte 71,117,101,115,115,32,97,32,110,117,109,98,101,114,58,32,0 | |
bb:.byte 84,111,111,32,104,105,103,104,58,32,0 | |
.text | |
awsq:li $v0,4 |