Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stsievert
stsievert / Rasterize2.ipynb
Created March 12, 2013 15:22
An IPython notebook.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stsievert
stsievert / Rasterize3.ipynb
Created March 12, 2013 16:00
An IPython notebook.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stsievert
stsievert / Rasterize4.ipnb
Created March 12, 2013 21:35
Another .ipynb...
{
"metadata": {
"name": "Rasterize"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@stsievert
stsievert / Iterative Hard Thresholding
Created March 18, 2013 16:52
Using iterative hard thresholding to recreate a signal. dtw and idwt can easily be replaced with fft and ifft.
clear all
close all
clc
% Load in an image
I = double(imread('~/Desktop/not-used-frequently/pictures_for_project/lenna.jpg'));
I2 = mean(I,3);
I3 = imresize(I2,[512,512]);
% Take Measurements (pixels)
sz = size(I3);
@stsievert
stsievert / iptest results
Created March 21, 2013 20:29
Trying to install ipython's qtconsole.
> iptest
**********************************************************************
IPython test group: IPython.config
..............................................
----------------------------------------------------------------------
Ran 46 tests in 0.054s
OK
**********************************************************************
IPython test group: IPython.core
@stsievert
stsievert / gist:5332606
Created April 7, 2013 21:25
StackOverflow animation
[self.view.layer removeAllAnimations];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:0.1];
[UIView setAnimationCurve: UIViewAnimationCurveLinear];
[UIView commitAnimations];
@stsievert
stsievert / pay.py
Created May 4, 2013 20:54
For reddit!
# from http://www.ece.illinois.edu/students/salaries.html1010
bee = 60.646e3
phd = 90.374e3
# doesn't account for pay raises (which are common)
total_pay_bee = bee * (65 - 23)
total_pay_phd = phd * (65 - 23 - 7) + 20e3*7
@stsievert
stsievert / Error Log
Created May 20, 2013 13:44
An error log, for XCode.
Process: Xcode [1966]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 4.6.2 (2067.2)
Build Info: IDEApplication-2067002000000000~2
App Item ID: 497799835
App External ID: 15055625
Code Type: X86-64 (Native)
Parent Process: launchd [261]
User ID: 501
@stsievert
stsievert / numba.py
Created May 21, 2013 13:53
A bug with @autojit... or perhaps I'm defining my function incorrectly?
# let's define it regularly
def findNewNumber(n):
newNumber = 0
for i in arange(len(str(n))):
newNumber += int(str(n)[i])**2
return newNumber
In [7]: run euler.py