Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ |
This file contains 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
/* Build a references section that lists URLs of hyperlinks | |
* with specified class "ref". Put list in div element with | |
* specified id "references". Use CSS class called references | |
* that uses counters and ::before psuedo-element to add | |
* brackets around reference list numbers. | |
* links in body look like this: | |
* blah <a href="URL>reference</a><a class="ref"><a> */ | |
document.body.onload = gen_refs("a", "references", "ref"); | |
function gen_refs(tagname, refsname, classname) { | |
var alltags = document.getElementsByTagName(tagname); |
This file contains 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
function [a1,aa] = rc2a1(row,col) | |
% RC2A1 convert row, column reference to A1 reference for excel | |
% A1 = RC2A1(ROW,COL) returns the equivalent reference as a string | |
% for the given row, ROW, and column, COL, numbers. | |
a1 = char(64+mod(col-1,26)+1); | |
xcol = ceil(col/26)-1; | |
if xcol>0 | |
[~,aa] = rc2a1(row,xcol); | |
a1 = [aa,a1]; |
This file contains 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
<html> | |
<head> | |
<!-- either head or body --> | |
<style type="text/css"> | |
.toc_item { | |
color: green; | |
} | |
</style> | |
<!-- css class --> | |
</head> |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
# | |
# Attribution: Hijacked from tracservice.py by Florent Xicluna <laxyf@yahoo.fr> | |
# http://trac-hacks.org/wiki/WindowsServiceScript | |
# | |
# To use this class, users must do the following: | |
# 1. Download and install the PyWin32all package | |
# (http://starship.python.net/crew/mhammond/win32/) | |
# 2. Edit the constants section with the proper information. |
This file contains 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 functools import wraps | |
from django.contrib.auth.views import login as auth_login | |
from django.contrib.auth.decorators import login_required | |
from django.http import HttpResponse, HttpResponseRedirect, QueryDict | |
from django.core.urlresolvers import reverse, resolve | |
from django.template.response import TemplateResponse | |
def add_GET_to_context(*keys): | |
""" | |
Check view's URL GET query string for keys and add values to context data |
This file contains 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 | |
""" | |
diff of excel files | |
""" | |
from dulwich.repo import Repo # import Repo object from dulwich | |
import sys | |
import os | |
from openpyxl import load_workbook |
This file contains 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 | |
""" | |
Solve linear system using LU decomposition and Gaussian elimination | |
""" | |
import numpy as np | |
from scipy.linalg import lu, inv | |
def gausselim(A,B): |