It’s never too late to start a tradition. I haven’t been writing blogs lately. 1. Let’s Encrypt In the ideal world, everyone should be able to do anything without the fear of eavesdropping. 10 years ago, it would be very hard to do this. Personal Computers were not very strong and Internet was slow, therefore HTTPS is reasonably slower than HTTP. Things have been changed. Computers are faster now. Internet speed has been increased exponentially. The only thing that hold HTTPS back is the cost to obtain a server SSL certificate. In my opinion, it should be free because once you have an intermediate certificate that is signed by a root certificate, generating a server certificate is just a piece of cake. Honestly it costs money to obtain an intermediate certificate and maintain supporting infrastructure, and companies usually offset the cost to customers who want to purchase a server certificate. Actually server certificates have been issued for free for over two years by StartSSL, but the process is not simple. You need to sign up an account, verify your email address, verify your domain, generate a certificate signing part on your server, create a request with StartSSL and wait for your certificate to be signed. The whole process could take up to a day, YMMV. And once it’s expired, you need to go over the whole thing again, except maybe verify your email address. With the introduction of Let’s Encrypt, things are getting much better. With a simple git clone command, and another command to run the letsencrypt-auto toolkit, once can easily obtain a server certificate in a blink of an eye (no, actually it takes about a minute). And renewing a certificate could be done using the same procedures. Simple and sweet. Instruction to obtain a certificate. 2. Change
Lookup time for dict() is O(1) and for list() is O(n) no matter what the number of elements is. Given a list of elements in a file, this piece of code: from itertools import izip lists = map(str.strip, open(‘dict.txt’).readlines()) i = iter(lists) j = range(len(lists)) dicts = dict(izip(i, j)) index = dicts[w] is n time faster than this piece of code: dicts = map(str.strip, open(‘dict.txt’).readlines()) index = dicts.index(w) I learned that the hard way. My dict has 5,000,000 elements, which mean my code will run 5 millions time slower than it should be. As such, I ran my code on 20 machines, each with 64 cores and it took ~10 hours without finish. Changing from list to dict, it took about 900 seconds on a single machine (of course 64 cores) Next time, when you want to do lookup in Python, use dict(). Happy coding!