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
mv /path/to/original/directory/*.pdf /path/to/new/directory |
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
find . -type f | wc -l |
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
mv /home/user/oldname /home/user/newname |
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
['yes' if v == 1 else 'no' if v == 2 else 'idle' for v in l] |
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 glob | |
from PIL import Image | |
img_dir_path = 'data_cheek/*.jpg' | |
train_test_filelist = sorted(glob.glob(img_dir_path)) | |
cheek_label_list = [0 if "old" in files else 1 for files in train_test_filelist] | |
thefile = open('data_cheek.txt', 'w') | |
for item in cheek_label_list: |
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
cp program3.cpp homework6.cpp |
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
subl cnn_region_v2_batchnorm.py |
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
#Bash to delete with user confirmation | |
rm /path/to/directory/* | |
#Bash to delete without asking | |
rm -rf /path/to/directory/* |
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
# View more python learning tutorial on my Youtube and Youku channel!!! | |
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg | |
# Youku video tutorial: http://i.youku.com/pythontutorial | |
""" | |
Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly. | |
""" | |
from __future__ import print_function | |
import tensorflow as tf |
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
train_summary = tf.Summary() | |
train_summary.value.add(tag="%sAccuracy" % fold,simple_value=avg_train_acc) | |
train_summary.value.add(tag="%sLoss" % fold,simple_value=avg_train_loss) | |
train_writer.add_summary(train_summary,epoch) | |
test_summary = tf.Summary() | |
test_summary.value.add(tag="%sAccuracy" % fold,simple_value=avg_test_acc) | |
test_summary.value.add(tag="%sLoss" % fold,simple_value=avg_test_loss) | |
test_writer.add_summary(test_summary,epoch) |