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
import re # regular expressions | |
import pyPdf | |
filename = '/home/joon/downloads/T1223.pdf' | |
pdf = pyPdf.PdfFileReader(open(filename, "rb")) | |
pages = [] |
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 mpl_toolkits.mplot3d import Axes3D | |
import matplotlib | |
import matplotlib.pyplot as plt | |
fig = plt.figure() | |
ax = Axes3D(fig) | |
# put 0s on the y-axis, and put the y axis on the z-axis | |
ax.plot(xs=self.grid_s, ys=self.grid_vu, zs=self.p[2][eye(self.grid_s.shape[0], dtype=bool)], zdir='z', label='ys=0, zdir=z') | |
plt.show() |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
Show hidden characters
{ | |
"user": { | |
"debug": false, | |
"delay": 0.25, | |
"error_color": "D02000", | |
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default.gutter-theme", | |
"gutter_theme_excludes": [], | |
"lint_mode": "background", | |
"linters": { | |
"pep8": { |
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
Sub Remove_Missing() | |
'Set the range to evaluate to rng. | |
Set Rng = Range("E2:E20001") 'Rng holds the Range object | |
'initialize i to 1 | |
i = 1 | |
For counter = 1 To Rng.Rows.Count 'number of rows |
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
def summation(arg): | |
return_val = 0 | |
for i in arg: | |
return_val += i | |
return(return_val) | |
test_range = np.arange(10) | |
%timeit summation(test_range) |
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
Import-Module posh-git | |
# customize git prompt display settings | |
$global:GitPromptSettings.BeforeText = '[' | |
$global:GitPromptSettings.AfterText = '] ' | |
$global:GitPromptSettings.BranchAheadForegroundColor = [ConsoleColor]::Green | |
$global:GitPromptSettings.WorkingForegroundColor = [ConsoleColor]::Magenta | |
$global:GitPromptSettings.UntrackedForegroundColor = [ConsoleColor]::DarkGray | |
Enable-GitColors |
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
>>> import datetime | |
>>> d = datetime.datetime(2010, 7, 4, 12, 15, 58) | |
>>> '{:%Y-%m-%d %H:%M:%S}'.format(d) | |
'2010-07-04 12:15:58' |
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
#+BEGIN_SRC emacs-lisp :results none | |
(setq properties-list '("Title" "Composer" "Publisher" "NDisks")) | |
(let ((MATCH t) | |
(SCOPE 'file) | |
(SKIP nil) | |
(spacing nil)) | |
(org-map-entries | |
(lambda () | |
(let ((level (nth 1 (org-heading-components)))) |
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
import pandas as pd | |
# convert to datetime | |
showdates = pd.to_datetime(con_df['showdate'].astype(str)) | |
# if you don't do `to_timedelta`, you will get integer numbers | |
# so convert it back to timedelta | |
pd.to_timedelta(showdates.values[1:] - showdates.values[:-1]) |
OlderNewer