發表文章

[Netflix] 巨洪 The Great Flood 觀後感

好久沒有提筆寫文章了,沒想到讓我振筆疾書的會是看完“巨洪”這部電影的心得感想。 原本只是看到有人說這部片概念很好,演員很好但最後劇情一言難盡,網路上有一堆人表示這部片子不好看、看不懂,甚至看不完就跳出了;但我觀看後完全不是這麼一回事,我認為這部片子講述的題材也許不是最新,但其背後的設定還有拍攝敘事手法非常好,讓我這個理工科幻迷非常震撼有這種電影的推出。 如果想要看電影但是想要有些提示或是心理準備再看的人,可以參考一下我的描述: 這部電影分成前後兩段,前面是真實的後面是模擬的,然後申子仁是實驗體的存在(非常人,就是個熊孩子),電影使用蒙太奇手法拍攝(可參考諾蘭的天能TENET),所以時間會有點跳來跳去,最後要自行拼湊時間軸。

HHKB Type-S長時間使用及購買心得

圖片
說明一下,買HHKB雖然是我的人生目標,但我一直沒想到我會這麼快就衝了, 畢竟HHKB的鍵位真的需要重新適應,再加上那價格……一個鍵盤就要24840日幣…… 用當時接近0.3的匯率來算,大概是快要7500台幣啊…… 但因為被同事說我用紅軸打字的聲音太吵,我一怒之下就上網研究了HHKB Type-S跟HHKB BT要怎麼訂購,然後在去年(2016)國慶連假去日本玩的時候就順便一起帶回來了。 所以有的時候計畫趕不上變化,變化比不上同事一句G8話。 (HHKB Type-S整體)

[LeetCode] Happy Number 快樂數字 (No.202)

Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers. Example:  19 is a happy number 1 2  + 9 2  = 82 8 2  + 2 2  = 68 6 2  + 8 2  = 100 1 2  + 0 2  + 0 2  = 1 Ref:  https://leetcode.com/problems/happy-number/

[LeetCode] Longest Substring Without Repeating Characters 求出不重覆字母下最長的子字串長度 (No.3)

Given a string, find the length of the  longest substring  without repeating characters. Examples: Given  "abcabcbb" , the answer is  "abc" , which the length is 3. Given  "bbbbb" , the answer is  "b" , with the length of 1. Given  "pwwkew" , the answer is  "wke" , with the length of 3. Note that the answer must be a  substring ,  "pwke"  is a  subsequence  and not a substring. Ref:  https://leetcode.com/problems/longest-substring-without-repeating-characters/

[Java] 使用JavaMail從GMail寄信以及使用EWS API從Exchange寄信

今天在研究如何使用Java Mail的API從GMail寄信出去,以及使用EWS API從Exchange寄信,寫了一些測試用的Code分享給大家。 一、用JavaMail從GMail寄信 因為GMail講求安全性,所以在Java Mail的設定上會比較複雜, SMTP 伺服器的通訊埠設為 465 (適用 SSL/TLS) 和 587 (適用 STARTTLS),而在這個例子,我們使用STARTTLS,這個協定就是為了加密從用戶端到伺服器端的連線,會對EMAIL在寄送時更加安全。另外,GMail也有開啟SMTP AUTH的功能,所以我們要得到使用者的帳號密碼才可以寄送。 而如果你有開兩步驟,需要另外建立一個「應用程式密碼」;沒有開兩步驟,則是需要開起「允許安全性較低的應用程式」才能夠正確執行,要不然會報錯。 部份程式碼: 完整程式碼: https://github.com/jimc1682000/JavaMailLab/blob/master/src/tw/com/jimmy/lab/SendFromGMailUsingJavaMailLab.java Ref: http://pclevin.blogspot.tw/2014/11/java-mail-gmail-smtp-server.html https://support.google.com/mail/answer/78775?hl=zh-Hant

[LeetCode] Add Two Numbers 兩LinkedList相加 (No.2)

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Input:  (2 -> 4 -> 3) + (5 -> 6 -> 4) Output:  7 -> 0 -> 8 /**  * Definition for singly-linked list.  * public class ListNode {  *     int val;  *     ListNode next;  *     ListNode(int x) { val = x; }  * }  */ Ref:  https://leetcode.com/problems/add-two-numbers/