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
try: | |
import scigma | |
except: | |
import traceback | |
traceback.print_exc() | |
print() | |
print("Could not import scigma.") | |
raw_input("Press enter to exit.") |
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
# %Tag(FULLTEXT)% | |
cmake_minimum_required(VERSION 2.8.3) | |
project(beginner_tutorials) | |
## Find catkin and any catkin packages | |
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs genmsg) | |
## Generate added messages and services | |
#generate_messages(DEPENDENCIES std_msgs) |
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
cmake_minimum_required(VERSION 2.8.3) | |
project(beginner_tutorials) | |
## Find catkin and any catkin packages | |
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs genmsg) | |
## Declare ROS messages and services | |
#add_message_files(DIRECTORY msg FILES Num.msg) | |
#add_service_files(DIRECTORY srv FILES AddTwoInts.srv) |
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 | |
''' | |
A brittle little program that emits media keys on the :0 X11 display | |
when it gets certain input characters at the command line. | |
I use this for transforming my phone into a gestural remote control for my | |
Google Play Music on my desktop, using Server Auditor as an Android SSH client, | |
and this extension to listen for media key presses and send them to Google Play Music: | |
https://chrome.google.com/webstore/detail/key-socket-media-keys/fphfgdknbpakeedbaenojjdcdoajihik | |
. |
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
''' | |
Quick hack to combine two BibTeX files with truly indentical entries | |
into one monolithic file. | |
Someone else could write an argparse interface to make this more reusable. | |
For now, I just need to get back to work. | |
''' | |
from bibtexparser.bparser import BibTexParser | |
with open('math.bib', 'r') as bibfile: |
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
''' | |
Quick hack to combine two BibTeX files with truly indentical entries | |
into one monolithic file. | |
Someone else could write an argparse interface to make this more reusable. | |
For now, I just need to get back to work. | |
''' | |
from bibtexparser.bparser import BibTexParser | |
with open('math.bib', 'r') as bibfile: |
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
''' | |
This example uses a MovieWriter directly to grab individual frames and | |
write them to a file. This avoids any event loop integration, but has | |
the advantage of working with even the Agg backend. This is not recommended | |
for use in an interactive setting. | |
This version avoids the ugly stateful plt.* expressions, and the | |
set_data method. Instead, it uses the more generic axis methods. This is slower, | |
but easier to remember, I hope. | |
''' |
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 scipy.linalg | |
n = 130 | |
r = np.array(np.random.normal(size=(n, n)), dtype=np.float32) | |
e = scipy.linalg.eig(r, left=False, right=False) | |
print e.mean() |
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 scipy.linalg | |
n = 130 | |
r = np.array(np.random.normal(size=(n, n)), dtype=np.float32) | |
e = scipy.linalg.eig(r, left=False, right=False) | |
print e.mean() |
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 random | |
import string | |
import tempfile | |
import subprocess | |
def random_id(length=8): | |
return ''.join(random.sample(string.ascii_letters + string.digits, length)) | |
TEMPLATE_SERIAL = """ |