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
| #!/bin/bash | |
| # Add a string to the filename before extension | |
| # original files : results_001.pkl results_002.pkl ... | |
| # target files: results_001_output.pkl results_001_output.pkl ... | |
| for x in *.pkl | |
| do | |
| mv "$x" "${x%.pkl}_output.pkl" | |
| done |
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 bs4 import BeautifulSoup | |
| import requests | |
| # url to scrape | |
| cat_url = 'https://arxiv.org/' | |
| subcat_url = 'https://arxiv.org/archive/' | |
| def return_soup(url): | |
| url = requests.get(url).content | |
| soup = BeautifulSoup(url,"html.parser") | |
| return soup |
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 bs4 import BeautifulSoup | |
| import requests | |
| url = 'http://export.arxiv.org/oai2?verb=ListSets' | |
| def return_soup(url): | |
| url = requests.get(url).content | |
| soup = BeautifulSoup(url,"html.parser") | |
| return soup | |
| def get_namespace(x): | |
| name = x.find('setspec').text | |
| tag = x.find('setname').text |
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 matplotlib.pyplot as plt | |
| from itertools import product | |
| import numpy as np | |
| a,b = np.array([4,1]),np.array([1,3]) | |
| fig,ax = plt.subplots(1,1,figsize=(5,5)) | |
| ax.set_xlim(-6,8) | |
| ax.set_ylim(-6,8) | |
| ax.set_axis_off() |
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
| /* json.dumps(StatusObject._json) */ | |
| { | |
| "created_at": "Thu Jul 28 00:08:39 +0000 2016", | |
| "in_reply_to_status_id": null, | |
| "id_str": "758454081656467456", | |
| "retweeted": false, | |
| "entities": { | |
| "hashtags": [ | |
| { |
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 | |
| from numpy.linalg import matrix_power | |
| from matplotlib import pyplot as plt | |
| import seaborn as sns | |
| SIZE = 100 | |
| M = np.zeros((SIZE, SIZE)) | |
| # encoding rolls of die | |
| for y in xrange(SIZE): |
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 code generates a picture of a symmetric | |
| one-dimensional double-well pontetial. | |
| Mahdi Sadjadi, 2017. | |
| ''' | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from matplotlib.ticker import FuncFormatter, MaxNLocator | |
| for param in ['axes.labelsize','xtick.labelsize','ytick.labelsize']: |
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 code generates a picture of the specific | |
| heat of a two-level system. It also shows | |
| the limits in low- and high-temperatures | |
| regions, in addition to the location of | |
| the maximum specific heat. | |
| Mahdi Sadjadi, 2017. | |
| ''' | |
| import numpy as np |
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
| # A simple implementation of Queue data structure in python | |
| # FIFO: first (item) in, first (item) out | |
| # Insert at the front, pop at the end of the list | |
| class Queue(): | |
| def __init__(self): | |
| self.items = [] | |
| def isEmpty(self): |