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/python -u | |
# -*- coding: utf-8 -*- | |
""" | |
Curve fitting using least square technique. | |
License: BSD | |
""" | |
__author__ = 'पुष्पक दगड़े (Pushpak Dagade) <[email protected]>' | |
__date__ = 'Sun Sep 16 13:57:48 2012' |
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/python -u | |
# -*- coding: utf-8 -*- | |
""" | |
Creates a plot of ray height vs. spherochromatism for a equiconvex lens. | |
The lens parameters have been hardcoded below. You can tweak them as required. | |
Conventions: | |
Angle made with the positive axis in couter clockwise fashion is positive. | |
All units, unless mentioned are in SI |
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
#!/bin/bash | |
# Author: Pushpak Dagade | |
# This script automatically detects if an external monitor is connected, | |
# and if so, expands my screen with the monitor on the left and my | |
# laptop screen on the right. If my laptop lid is shut & an external | |
# monitor is connected, this script uses only the external monitor as | |
# the display. | |
# |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
""" | |
Retrieve intraday stock data from Google Finance. | |
""" | |
import csv | |
import datetime | |
import re | |
import pandas as pd |
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 yaml | |
import logging.config | |
import logging | |
def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'): | |
""" | |
| **@author:** Prathyush SP | |
| Logging Setup | |
""" |
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
# Put this code in the top most level module. Any assertions or uncaught exceptions firing within this module or any of the submodules would be caught by the logger. | |
def excepthook(*args): | |
logging.getLogger(<give_correct_logname_here>).error('Uncaught exception:', exc_info=args) | |
sys.excepthook = excepthook | |
# Test the above code... | |
assert 1==2, 'Something went wrong' |