2018年11月19日 星期一

Python notes: Calculate delay time by WinDBG log

用WinDBG開Event Timestamps可以產生下面格式的log:
Fri Sep 21 18:43:50.946 2018 (UTC + 8:00): @#$#^$@#$^
以下python code用來找出兩個指定log中的時間差

2018年11月4日 星期日

Python notes: LeetCode第一題: Two Sum

為了挑戰Python程度,開始了LeetCode人森阿

題目:
https://leetcode.com/problems/two-sum/

Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
Example:
Given nums = [2, 7, 11, 15], target = 9,

Because nums[0] + nums[1] = 2 + 7 = 9,
return [0, 1].

Python notes: 字母找字串

隨機抽選個題目來做,結果花了我超久的時間哈哈哈哈
題目: 请输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续判断第二个字母。
http://www.runoob.com/python/python-exercise-example31.html

2018年11月2日 星期五

Linux tips

Linux真的是個不常用就很容易忘掉要怎麼用的東西..


  • Unload module
rmmod nouveau

  • Change file attribute
sudo chmod 777 filename

2018年6月20日 星期三

Windows Event Log

工作需要查了Event Log可否客製化,不但可以還很簡單

參考網址: https://www.raymond.cc/blog/create-an-event-in-event-viewer/
用Command prompt執行: eventcreate /T Information /ID 20 /L Application /SO AppName /D "Event description"

2017年2月5日 星期日

Arduino: 自動WIFI重置器 Automatic WIFI reseter (Auto AP reseter)

因特別需求家中裝了很多無線設備,也不知道為什麼家中的中華電信數據機三不五時就會斷線,斷電再重新通電後又會恢復正常。又因為家裡不是隨時都有人可以幫忙處理,於是冒出了這個想法,要是有個設備可以自動偵測我的無線網路連線,當網路斷線時自動把AP的電源切斷,過個幾秒在通電,這樣就不用怕AP當機了呀! 查了一下,國外還真的有這種產品:ResetPlug  不過並不便宜,那就用Arduino自己做一個吧!

Python notes: Calculate delay time by WinDBG log

用WinDBG開Event Timestamps可以產生下面格式的log: Fri Sep 21 18:43:50.946 2018 (UTC + 8:00): @#$#^$@#$^ 以下python code用來找出兩個指定log中的時間差