A list of 25 Principles of Adult Behavior by John Perry Barlow

1. Be patient. No matter what. 2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him. 3. Never assume the motives of others are, to them, less noble than yours are to you. 4. Expand your sense of the possible. 5. Don’t trouble yourself with matters you truly cannot change. 6. Expect no more of anyone than you can deliver yourself. 7. Tolerate ambiguity. 8. Laugh at yourself frequently. 9. Concern yourself with what is right rather than who is right. 10. Never forget that, no matter how certain, you might be wrong. 11. Give up blood sports. 12. Remember that your life belongs to others as well. Don’t risk it frivolously. 13. Never lie to anyone for any reason. (Lies of omission are sometimes exempt.) 14. Learn the needs of those around you and respect them. 15. Avoid the pursuit of happiness. Seek to define your mission and pursue that. 16. Reduce your use of the first personal pronoun. 17. Praise at least as often as you disparage. 18. Admit your errors freely and soon. 19. Become less suspicious of joy. 20. Understand humility. 21. Remember that love forgives everything. 22. Foster dignity. 23. Live memorably. 24. Love yourself. 25. Endure. ...

February 10, 2018 · 1 min · birdchan

HTTP GET request body

I was developing a RESTful API. When done with the basic select/insert/update, I needed to implement endpoints for batch queries. All of a sudden, I was like, how do I pass in the list of ids? Is there some standards out there? I was thinking of using POST. That was how I did it back then, simple and easy. But with the REST philosophy, or the http way of things, I wanted to stick with GET. ...

February 9, 2018 · 2 min · birdchan

Thousands comma numeric formatting in psql

[code] select trim(both ’ ’ from to_char(12345678.49, ‘999,999,999.99’)) [/code] The trim is to take away the white space from the sides. Ref: https://www.postgresql.org/docs/9.6/static/functions-formatting.html

February 8, 2018 · 1 min · birdchan

Deep-copying in JavaScript

Good stuff. http://dassur.ma/things/deep-copy/

January 30, 2018 · 1 min · birdchan

Meltdown and Spectre

Meltdown Meltdown breaks the most fundamental isolation between user applications and the operating system. This attack allows a program to access the memory, and thus also the secrets, of other programs and the operating system. Spectre Spectre breaks the isolation between different applications. It allows an attacker to trick error-free programs, which follow best practices, into leaking their secrets. In fact, the safety checks of said best practices actually increase the attack surface and may make applications more susceptible to Spectre ...

January 23, 2018 · 1 min · birdchan

pip install pycurl

I ran pip install pycurl and got crazy error [code] Collecting pycurl Downloading pycurl-7.43.0.1.tar.gz (195kB) 100% |████████████████████████████████| 204kB 6.0MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File “/tmp/pip-build-msc3b_98/pycurl/setup.py”, line 104, in configure_unix stdout=subprocess.PIPE, stderr=subprocess.PIPE) File “/usr/lib/python3.5/subprocess.py”, line 947, in __init__ restore_signals, start_new_session) File “/usr/lib/python3.5/subprocess.py”, line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: ‘curl-config’ During handling of the above exception, another exception occurred: ...

January 19, 2018 · 2 min · birdchan

ADT Theft Protection Guarantee

From ADT’s website: https://www.adt.com/specials Theft Protection Guarantee If a burglary occurs while your ADT security system is armed, weʼll pay up to $500* of your insurance deductible. *Subject to terms and conditions of the Residential Services Contract. Um…

January 16, 2018 · 1 min · birdchan

OperationalError: (psycopg2.OperationalError) SSL SYSCALL error: EOF detected

This seems to be an OOM exception, thus leads to db disconnection. OperationalError: (psycopg2.OperationalError) SSL SYSCALL error: EOF detected Retrying with exponential backoff could help. Ref: https://stackoverflow.com/questions/24130305/postgres-ssl-syscall-error-eof-detected-with-python-and-psycopg https://github.com/psycopg/psycopg2/issues/533 https://dba.stackexchange.com/questions/175085/postgresql-ssl-syscall-error-eof-detected

January 16, 2018 · 1 min · birdchan

Blue Laws

I was chatting with co-workers over blue laws. I never heard of blue laws so this sounds very interesting. It turns out there are states that cannot buy/sell alcohol on sundays. I am still not sure where the ‘blue’ came from. Ref: http://www.historylink.org/File/9057 https://www.theguardian.com/commentisfree/2013/mar/03/no-sunday-alcohol-sales-states-prohibition https://en.wikipedia.org/wiki/Blue_laws_in_the_United_States https://www.britannica.com/topic/blue-law http://www.todayifoundout.com/index.php/2014/12/blue-laws-come/

January 11, 2018 · 1 min · birdchan

Get comfortable with being uncomfortable - Luvvie Ajayi

https://embed.ted.com/talks/luvvie_ajayi_get_comfortable_with_being_uncomfortable https://www.ted.com/talks/luvvie_ajayi_get_comfortable_with_being_uncomfortable/

December 3, 2017 · 1 min · birdchan