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
| function [angles,projection] = solarPosition(datetime,latitude,longitude,time_zone,rotation,dst) | |
| %SOLARPOSITION Calculate solar position using most basic algorithm | |
| % This is the most basic algorithm. It is documented in Seinfeld & | |
| % Pandis, Duffie & Beckman and Wikipedia. | |
| % | |
| % [ANGLES,PROJECTION] = SOLARPOSITION(DATE,TIME,LATITUDE,LONGITUDE,TIME_ZONE) | |
| % returns ZENITH & AZIMUTH for all DATE & TIME pairs at LATITUDE, LONGITUDE. | |
| % ANGLES = [ZENITH,AZIMUTH] and PROJECTION = [PHI_X, PHI_Y] | |
| % PHI_X is projection on x-z plane & PHI_Y is projection on y-z plane. | |
| % DATETIME can be string, vector [YEAR, MONTH, DAY, HOURS, MINUTES, SECONDS], |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| Starts the help server so that Sphinx search works even in Google Chrome. | |
| """ | |
| import SimpleHTTPServer | |
| import SocketServer | |
| from threading import Thread | |
| from Queue import Queue |
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
| from pygments.lexers import MatlabLexer | |
| from pygments.formatter import Formatter | |
| from pygments.token import STANDARD_TYPES | |
| from pygments import highlight | |
| class JSONFormatter(Formatter): | |
| def format(self, tokensource, outfile): | |
| tokensource = [{STANDARD_TYPES[k]: v} for k, v in tokensource] | |
| json.dump(tokensource, outfile) |
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
| --- C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.txt | |
| +++ C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat | |
| @@ -16,23 +16,23 @@ | |
| goto :eof | |
| :amd64 | |
| -if not exist "%~dp0bin\amd64\vcvarsamd64.bat" goto missing | |
| -call "%~dp0bin\amd64\vcvarsamd64.bat" | |
| +if not exist "%~dp0bin\vcvars64.bat" goto missing | |
| +call "%~dp0bin\vcvars64.bat" |
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 | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Attribution: Hijacked from tracservice.py by Florent Xicluna <[email protected]> | |
| # 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 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 | |
| """ | |
| Solve linear system using LU decomposition and Gaussian elimination | |
| """ | |
| import numpy as np | |
| from scipy.linalg import lu, inv | |
| def gausselim(A,B): |
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 | |
| """ | |
| 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 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
| 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 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 | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Attribution: Hijacked from tracservice.py by Florent Xicluna <[email protected]> | |
| # 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 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
| <html> | |
| <head> | |
| <!-- either head or body --> | |
| <style type="text/css"> | |
| .toc_item { | |
| color: green; | |
| } | |
| </style> | |
| <!-- css class --> | |
| </head> |