新学期来了
惊讶地发现没有什么课……这完全得靠自觉了。加油吧。
惊讶地发现没有什么课……这完全得靠自觉了。加油吧。
不知不觉都在西安度过三年了。我真的有所成长吗……
最近很多涉及到未来的一些决定之类的事情……不过好歹算是确定下来了,这样挺好的。
给电脑换了新散热模组,感觉比原来要好了很多,声音也变小了。不过感觉船还是太重了,琢磨着搞台新的笔记本,轻一点,性能过得去,续航有那么6、7个小时就不错了。Aero15感觉挺好,就是有点贵……
出国的事情应该是要放弃了,国外研究生还是上课,不如在国内找个好导师做做项目……上了这么多年的课我也有点厌倦了,是时候换换口味?
寝室整个大扫除了一次,感觉回到了军训时的水平。好久都没有这么干净过了,看来不是不能做清洁,得有动力233~
就这样吧。认真过好每一天。
在Github上看到有人写了Linux上从休眠唤醒后自动启动神舟hotkey耳机孔的驱动,还给出了具体dll和函数的作用,于是手撸了一个c++程序调用之。加上vbs脚本计划任务,成功无缝切换。果然还是Github能人多啊……具体链接还是留一个在这里吧。
把一年前搞的东西用python重写了一遍,当作简单的练习。
# -*- coding: utf-8 -*-
import os
import time
import logging
import sys
from urllib import request
#from datetime import datetime,timedelta
logging.basicConfig(level = logging.INFO)
logger = logging.getLogger(__name__)
handler = logging.FileHandler('getNsort.log')
handler.setLevel(logging.INFO)
fomatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
handler.setFormatter(fomatter)
logger.addHandler(handler)
if len(sys.argv) > 2:
path = sys.argv[1]
uri = sys.argv[2]
elif len(sys.argv) == 2:
path = sys.argv[1]
uri = 'http://area.sinaapp.com/bingImg/'
else:
print('Usage: %s savepath uri' % sys.argv[0].split('\\')[-1])
logger.error('Arguement error.')
os._exit(0)
try:
r = request.urlopen(uri)
fname = r.geturl().split('/')[-1]
fpath = os.path.join(path,fname)
if not os.path.exists(fpath):
with open(fpath,'wb') as f:
f.write(r.read())
logger.info('New picture saved to '+ fpath)
except BaseException as e:
logger.error('Error: ' + e)
#etime = (datetime.now() - timedelta(days = 30)).timestamp()
etime = time.time() - 30 * 24 * 60 * 60
it = os.scandir(path)
for entry in it:
mtime = os.path.getmtime(entry.path)
if mtime < etime:
year = time.gmtime(mtime)[0]
month = time.gmtime(mtime)[1]
fpath = os.path.join(path, str(year)+ '-' + '{:0>2}'.format(str(month)))
if not os.path.exists(fpath):
os.mkdir(fpath)
os.rename(entry.path,os.path.join(fpath,entry.name))
logger.info('Archived picture: ' + entry.name)
挺有意思的,就是花了好些时间。