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 numpy as np | |
import matplotlib | |
matplotlib.use('TkAgg') | |
import matplotlib.pyplot as plt | |
from ale_python_interface import ale_python_interface as ALE | |
def display_ale(im, screen): | |
im.set_data(screen) | |
plt.draw() |
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
class InverseTransform: | |
def __init__(self, probs, rng=None): | |
if np.sum(probs) < 1.: | |
raise ValueError('Must sum up to 1') | |
self.rng = rng | |
if rng is None: | |
self.rng = np.random.RandomState() | |
self.cdf = np.cumsum(probs) | |
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 json | |
import urllib | |
import urllib2 | |
import xml.etree.ElementTree as ET | |
def query_automobiles(): | |
url = 'https://www.reservauto.net/WCF/LSI/LSIBookingService.asmx/GetVehicleProposals?Callback=?' | |
values = {'CustomerID' : '""', | |
'Longitude' : '0', | |
'Latitude' : '0' } |
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 os | |
import gphoto2 as gp | |
class Camera: | |
def __init__(self): | |
pass | |
def open(self): | |
self.context = gp.gp_context_new() | |
self.camera = gp.check_result(gp.gp_camera_new()) |
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 time | |
import numpy as np | |
from bokeh.plotting import * | |
output_server("line_animate") | |
p = figure() | |
p.line([], [], color="#3333ee", name="My stream") | |
show(p) |
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
def bicgstab(x0, b, atv, eps, kmax): | |
n = b.shape[0] | |
errtol = eps*np.linalg.norm(b) | |
error = [] | |
x = x0 | |
rho = np.zeros(kmax+1) | |
if np.isclose(np.linalg.norm(x), 0.): | |
r = b | |
else: |
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
# Copyright Pierre-Luc Bacon <[email protected]> | |
# | |
# This file is part of StarCluster. | |
# | |
# StarCluster is free software: you can redistribute it and/or modify it under | |
# the terms of the GNU Lesser General Public License as published by the Free | |
# Software Foundation, either version 3 of the License, or (at your option) any | |
# later version. | |
# | |
# StarCluster is distributed in the hope that it will be useful, but WITHOUT |
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
#n################################### | |
## StarCluster Configuration File ## | |
#################################### | |
[global] | |
# Configure the default cluster template to use when starting a cluster | |
# defaults to 'smallcluster' defined below. This template should be usable | |
# out-of-the-box provided you've configured your keypair correctly | |
DEFAULT_TEMPLATE=smallcluster | |
# enable experimental features for this release | |
#ENABLE_EXPERIMENTAL=True |
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
\documentclass{standalone} | |
\usepackage{tikz} | |
\begin{document} | |
\tikzstyle{block} = [rectangle, draw, | |
text width=8em, text centered, rounded corners, minimum height=4em] | |
\tikzstyle{line} = [draw, -latex] | |
\begin{tikzpicture}[node distance = 6em, auto, thick] | |
\node [block] (Agent) {Agent}; |
NewerOlder