From 785bde84dd4888817bb9825ba5ab388ec2b7c4b7 Mon Sep 17 00:00:00 2001 From: neodarz Date: Thu, 4 May 2017 03:27:33 +0200 Subject: Update to date --- source/blog/2014-10-20-hello-octopress.md | 36 ----- source/blog/2014-10-20-help-mou-hit-1-dot-0.md | 12 -- source/blog/2014-10-21-get-rolling.md | 34 ---- ...14-10-23-ripping-copy-protected-dvd-with-mpv.md | 37 ----- ...14-10-24-charles-munger-donated-$65m-to-kitp.md | 22 --- source/blog/2014-10-25-os-x-package-receipts.md | 19 --- ...0-26-audio-cd-slash-dvd-to-iso-image-on-os-x.md | 29 ---- .../blog/2014-10-26-disk-visualizer-daisydisk.md | 17 -- source/blog/2014-10-27-onedrive-goes-unlimited.md | 22 --- ...-28-google-drive-no-selective-subfolder-sync.md | 53 ------ ...14-10-28-mou-1-dot-0-fundraiser-goal-reached.md | 16 -- source/blog/2014-10-29-fun.md | 14 -- source/blog/2014-11-02-vobcopy-dvdbackup-etc.md | 89 ----------- .../2014-11-05-apple-is-pushing-yosemite-hard.md | 31 ---- ...-11-05-list-youtube-playlist-with-youtube-dl.md | 73 --------- ...-nobel-prize-in-physics-led-lights-seriously.md | 18 --- source/blog/2014-11-07-interstellar.md | 15 -- ...osts-ten-time-as-much-as-that-in-the-u-dot-k.md | 11 -- ...-11-re-encoding-everything-for-iphone-6-plus.md | 7 - ...-11-19-convolution-of-irreducible-characters.md | 15 -- source/blog/2014-11-20-dropbot-for-geeks(r).md | 20 --- .../2014-11-24-iphone-photography-frustration.md | 31 ---- ...why-i-abandoned-mathjax-and-fell-back-to-pdf.md | 11 -- source/blog/2014-11-25-i-got-16-gigs-of-ram.md | 19 --- ...014-11-26-original-images-in-day-one-journal.md | 41 ----- source/blog/2014-11-28-given-infinite-time.md | 7 - source/blog/2014-11-28-going-diceware.md | 11 -- ...-style-advanced-keyboard-shortcuts-in-safari.md | 44 ----- source/blog/2014-12-05-distraction-free-writing.md | 33 ---- ...0-omnifocus-change-sync-behavior-mac-and-ios.md | 19 --- source/blog/2014-12-13-the-mac-like-evernote.md | 15 -- ...014-12-14-speeding-up-emacs-with-emacsclient.md | 35 ---- ...2014-12-14-the-google-chrome-comic-a-classic.md | 20 --- .../blog/2014-12-19-app-suggestion-dropzone-3.md | 11 -- source/blog/2014-12-22-10k-images-on-imgur.md | 7 - source/blog/2014-12-23-mpv-launcher.md | 29 ---- ...15-01-01-os-x-system-ruby-encoding-annoyance.md | 42 ----- ...5-01-10-fonts-why-chinese-web-design-is-hard.md | 15 -- .../2015-01-21-web-design-microsoft-vs-apple.md | 19 --- ...-monitor-progress-of-your-unix-pipes-with-pv.md | 59 ------- ...icrosoft-is-getting-cool-but-not-its-website.md | 19 --- .../2015-02-20-my-dock-and-updated-omnifocus.md | 20 --- source/blog/2015-02-21-all-is-not-lost.md | 19 --- source/blog/2015-02-24-the-new-onedrive-api.md | 9 -- source/blog/2015-03-22-back-up-os-x-app-icons.md | 45 ------ .../2015-04-26-using-python-3-with-emacs-jedi.md | 30 ---- ...015-05-03-why-oh-my-zsh-is-completely-broken.md | 177 --------------------- ...nt-when-using-pythons-multiprocessingprocess.md | 74 --------- source/blog/2015-05-05-new-blog-new-start.md | 43 ----- ...one-honking-great-idea-lets-do-more-of-those.md | 54 ------- source/blog/2015-05-09-storyboard-reached-01.md | 84 ---------- ...pecial-slash-character-in-filename-expansion.md | 41 ----- ...015-05-22-using-a-command-table-as-wallpaper.md | 161 ------------------- ...is-still-the-best-plus-an-authy-horror-story.md | 25 --- ...ersonal-helper-package-in-everyday-scripting.md | 28 ---- ...stackoverflow-review-system-is-completely-bs.md | 55 ------- ...pple-turns-its-homepage-into-a-wwdc-liveblog.md | 58 ------- ...-bookmark-system-from-stone-age-strikes-back.md | 55 ------- source/blog/2015-06-12-the-tip-of-the-iceberg.md | 25 --- source/blog/2015-06-23-all-problems-solved.md | 29 ---- .../blog/2015-06-26-ios-9-searchable-settings.md | 13 -- ...ically-clean-up-previous-mobile-applications.md | 123 -------------- source/blog/2015-06-29-dl-cmplnts-in-apple-news.md | 27 ---- ...and-to-different-variables-without-temp-file.md | 34 ---- ...imental-attachment-formats-pdf-docx-and-pptx.md | 87 ---------- .../blog/2015-07-25-dl-cmplntss-web-doesnt-suck.md | 17 -- ...-07-30-the-sad-state-of-finder-on-el-capitan.md | 46 ------ ...02-sync-chrome-bookmarks-with-safari-on-os-x.md | 69 -------- ...5-08-05-should-apple-split-up-itunes-on-os-x.md | 23 --- ...-05-switching-to-capitalized-commit-messages.md | 15 -- source/blog/2015-08-13-other-peoples-___.md | 7 - source/blog/2015-08-14-laymen.md | 11 -- ...ockparty-and-the-only-thing-i-can-say-is-wow.md | 25 --- .../blog/2015-08-20-ios-9-turn-off-wi-fi-assist.md | 39 ----- .../blog/2015-08-25-automated-os-x-provisioning.md | 21 --- ...pt-non-anti-aliased-monaco-is-still-the-best.md | 19 --- .../blog/2015-09-21-zsh-51-and-bracketed-paste.md | 68 -------- ...24-apple-watch-digital-crown-tightness-issue.md | 11 -- ...-25-removing-google-analytics-from-this-blog.md | 15 -- ...maximized-window-is-the-new-full-screen-mode.md | 15 -- source/blog/2015-10-01-upgrading-to-el-capitan.md | 31 ---- ...5-10-03-we-need-an-os-x-security-white-paper.md | 19 --- ...-per-line-plain-text-document-in-two-columns.md | 30 ---- ...e-importance-of-dated-detailed-release-notes.md | 27 ---- ...low-up-the-sad-state-of-finder-on-el-capitan.md | 42 ----- source/blog/2015-10-14-sip-for-the-greater-good.md | 13 -- ...15-10-26-att-to-pure-talkusa-one-month-later.md | 66 -------- ...ge-after-people-use-it-for-unlimited-storage.md | 19 --- ...-11-15-we-need-a-programming-keyboard-on-ios.md | 17 -- .../2015-11-25-bash-function-exporting-fiasco.md | 43 ----- ...safeguarding-git-repos-against-accidental-rm.md | 43 ----- ...5-12-16-spoiled-by-retina-in-less-than-a-day.md | 27 ---- source/blog/2015-12-20-regex-flavor-hell.md | 17 -- .../blog/2015-12-26-autoenv-with-auto-cleanup.md | 33 ---- ...sses-from-my-failed-python3-port-of-tomorrow.md | 103 ------------ ...-i-want-lossless-music-on-itunes-music-store.md | 19 --- ...hes-when-installing-windows-7-with-boot-camp.md | 27 ---- source/blog/2016-01-01-virtualenvs-for-everyone.md | 74 --------- .../2016-01-14-the-dirtiest-mistakes-of-os-x.md | 30 ---- .../blog/2016-01-18-me-too-comments-on-github.md | 21 --- .../2016-01-24-antivirus-app-on-mas-top-chart.md | 53 ------ ...-dropbox-noteworthy-and-damned-skeuomorphism.md | 15 -- ...016-03-06-google-chrome-keeps-getting-uglier.md | 60 ------- .../2016-04-10-emacss-got-a-redesigned-website.md | 24 --- ...chrome-is-screwing-with-our-extensions-again.md | 32 ---- ...2016-06-04-Mode-kiosk-sur-une-Raspberry-Pi-1.md | 140 ++++++++++++++++ ...layer-who-spams-me-without-unsubscribe-links.md | 11 -- ...016-09-01-this-blog-is-now-behind-cloudflare.md | 19 --- ...g-python-with-sqlite-in-nonstandard-location.md | 48 ------ source/blog/2017-04-28-test-ee.md | 7 - source/css/jquery.jscrollpane.css | 115 +++++++++++++ source/css/theme.css | 52 +++--- source/gpg/corentin.breton@neodarz.net.public.asc | 51 ++++++ source/index.md | 4 +- source/js/code_scrollbar.js | 10 ++ source/js/jquery.jscrollpane.min.js | 8 + source/template.html | 25 +-- "source/website/comp\303\251tences.md" | 6 +- source/website/cv-contact.md | 63 ++++++++ source/website/cv.md | 5 - source/website/projets.md | 6 +- 121 files changed, 442 insertions(+), 3807 deletions(-) delete mode 100644 source/blog/2014-10-20-hello-octopress.md delete mode 100644 source/blog/2014-10-20-help-mou-hit-1-dot-0.md delete mode 100644 source/blog/2014-10-21-get-rolling.md delete mode 100644 source/blog/2014-10-23-ripping-copy-protected-dvd-with-mpv.md delete mode 100644 source/blog/2014-10-24-charles-munger-donated-$65m-to-kitp.md delete mode 100644 source/blog/2014-10-25-os-x-package-receipts.md delete mode 100644 source/blog/2014-10-26-audio-cd-slash-dvd-to-iso-image-on-os-x.md delete mode 100644 source/blog/2014-10-26-disk-visualizer-daisydisk.md delete mode 100644 source/blog/2014-10-27-onedrive-goes-unlimited.md delete mode 100644 source/blog/2014-10-28-google-drive-no-selective-subfolder-sync.md delete mode 100644 source/blog/2014-10-28-mou-1-dot-0-fundraiser-goal-reached.md delete mode 100644 source/blog/2014-10-29-fun.md delete mode 100644 source/blog/2014-11-02-vobcopy-dvdbackup-etc.md delete mode 100644 source/blog/2014-11-05-apple-is-pushing-yosemite-hard.md delete mode 100644 source/blog/2014-11-05-list-youtube-playlist-with-youtube-dl.md delete mode 100644 source/blog/2014-11-06-2014-nobel-prize-in-physics-led-lights-seriously.md delete mode 100644 source/blog/2014-11-07-interstellar.md delete mode 100644 source/blog/2014-11-10-average-phone-plan-in-the-u-dot-s-costs-ten-time-as-much-as-that-in-the-u-dot-k.md delete mode 100644 source/blog/2014-11-11-re-encoding-everything-for-iphone-6-plus.md delete mode 100644 source/blog/2014-11-19-convolution-of-irreducible-characters.md delete mode 100644 source/blog/2014-11-20-dropbot-for-geeks(r).md delete mode 100644 source/blog/2014-11-24-iphone-photography-frustration.md delete mode 100644 source/blog/2014-11-24-why-i-abandoned-mathjax-and-fell-back-to-pdf.md delete mode 100644 source/blog/2014-11-25-i-got-16-gigs-of-ram.md delete mode 100644 source/blog/2014-11-26-original-images-in-day-one-journal.md delete mode 100644 source/blog/2014-11-28-given-infinite-time.md delete mode 100644 source/blog/2014-11-28-going-diceware.md delete mode 100644 source/blog/2014-11-30-opera-style-advanced-keyboard-shortcuts-in-safari.md delete mode 100644 source/blog/2014-12-05-distraction-free-writing.md delete mode 100644 source/blog/2014-12-10-omnifocus-change-sync-behavior-mac-and-ios.md delete mode 100644 source/blog/2014-12-13-the-mac-like-evernote.md delete mode 100644 source/blog/2014-12-14-speeding-up-emacs-with-emacsclient.md delete mode 100644 source/blog/2014-12-14-the-google-chrome-comic-a-classic.md delete mode 100644 source/blog/2014-12-19-app-suggestion-dropzone-3.md delete mode 100644 source/blog/2014-12-22-10k-images-on-imgur.md delete mode 100644 source/blog/2014-12-23-mpv-launcher.md delete mode 100644 source/blog/2015-01-01-os-x-system-ruby-encoding-annoyance.md delete mode 100644 source/blog/2015-01-10-fonts-why-chinese-web-design-is-hard.md delete mode 100644 source/blog/2015-01-21-web-design-microsoft-vs-apple.md delete mode 100644 source/blog/2015-02-10-monitor-progress-of-your-unix-pipes-with-pv.md delete mode 100644 source/blog/2015-02-17-microsoft-is-getting-cool-but-not-its-website.md delete mode 100644 source/blog/2015-02-20-my-dock-and-updated-omnifocus.md delete mode 100644 source/blog/2015-02-21-all-is-not-lost.md delete mode 100644 source/blog/2015-02-24-the-new-onedrive-api.md delete mode 100644 source/blog/2015-03-22-back-up-os-x-app-icons.md delete mode 100644 source/blog/2015-04-26-using-python-3-with-emacs-jedi.md delete mode 100644 source/blog/2015-05-03-why-oh-my-zsh-is-completely-broken.md delete mode 100644 source/blog/2015-05-05-graceful-handling-of-sigint-when-using-pythons-multiprocessingprocess.md delete mode 100644 source/blog/2015-05-05-new-blog-new-start.md delete mode 100644 source/blog/2015-05-06-searchable-settings-are-one-honking-great-idea-lets-do-more-of-those.md delete mode 100644 source/blog/2015-05-09-storyboard-reached-01.md delete mode 100644 source/blog/2015-05-19-bash-the-special-slash-character-in-filename-expansion.md delete mode 100644 source/blog/2015-05-22-using-a-command-table-as-wallpaper.md delete mode 100644 source/blog/2015-05-29-apples-customer-service-is-still-the-best-plus-an-authy-horror-story.md delete mode 100644 source/blog/2015-05-30-using-a-personal-helper-package-in-everyday-scripting.md delete mode 100644 source/blog/2015-06-07-stackoverflow-review-system-is-completely-bs.md delete mode 100644 source/blog/2015-06-08-apple-turns-its-homepage-into-a-wwdc-liveblog.md delete mode 100644 source/blog/2015-06-10-chrome-disappointment-the-shabby-and-boring-old-bookmark-system-from-stone-age-strikes-back.md delete mode 100644 source/blog/2015-06-12-the-tip-of-the-iceberg.md delete mode 100644 source/blog/2015-06-23-all-problems-solved.md delete mode 100644 source/blog/2015-06-26-ios-9-searchable-settings.md delete mode 100644 source/blog/2015-06-27-automatically-clean-up-previous-mobile-applications.md delete mode 100644 source/blog/2015-06-29-dl-cmplnts-in-apple-news.md delete mode 100644 source/blog/2015-07-15-zsh-save-stdout-stderr-and-return-value-of-command-to-different-variables-without-temp-file.md delete mode 100644 source/blog/2015-07-19-github-experimental-attachment-formats-pdf-docx-and-pptx.md delete mode 100644 source/blog/2015-07-25-dl-cmplntss-web-doesnt-suck.md delete mode 100644 source/blog/2015-07-30-the-sad-state-of-finder-on-el-capitan.md delete mode 100644 source/blog/2015-08-02-sync-chrome-bookmarks-with-safari-on-os-x.md delete mode 100644 source/blog/2015-08-05-should-apple-split-up-itunes-on-os-x.md delete mode 100644 source/blog/2015-08-05-switching-to-capitalized-commit-messages.md delete mode 100644 source/blog/2015-08-13-other-peoples-___.md delete mode 100644 source/blog/2015-08-14-laymen.md delete mode 100644 source/blog/2015-08-20-i-installed-blockparty-and-the-only-thing-i-can-say-is-wow.md delete mode 100644 source/blog/2015-08-20-ios-9-turn-off-wi-fi-assist.md delete mode 100644 source/blog/2015-08-25-automated-os-x-provisioning.md delete mode 100644 source/blog/2015-08-31-after-all-these-years-10pt-non-anti-aliased-monaco-is-still-the-best.md delete mode 100644 source/blog/2015-09-21-zsh-51-and-bracketed-paste.md delete mode 100644 source/blog/2015-09-24-apple-watch-digital-crown-tightness-issue.md delete mode 100644 source/blog/2015-09-25-removing-google-analytics-from-this-blog.md delete mode 100644 source/blog/2015-10-01-auto-hidden-menu-bar-dock-maximized-window-is-the-new-full-screen-mode.md delete mode 100644 source/blog/2015-10-01-upgrading-to-el-capitan.md delete mode 100644 source/blog/2015-10-03-we-need-an-os-x-security-white-paper.md delete mode 100644 source/blog/2015-10-10-printing-long-80-character-per-line-plain-text-document-in-two-columns.md delete mode 100644 source/blog/2015-10-12-the-importance-of-dated-detailed-release-notes.md delete mode 100644 source/blog/2015-10-14-follow-up-the-sad-state-of-finder-on-el-capitan.md delete mode 100644 source/blog/2015-10-14-sip-for-the-greater-good.md delete mode 100644 source/blog/2015-10-26-att-to-pure-talkusa-one-month-later.md delete mode 100644 source/blog/2015-11-06-microsoft-drops-unlimited-onedrive-storage-after-people-use-it-for-unlimited-storage.md delete mode 100644 source/blog/2015-11-15-we-need-a-programming-keyboard-on-ios.md delete mode 100644 source/blog/2015-11-25-bash-function-exporting-fiasco.md delete mode 100644 source/blog/2015-12-08-safeguarding-git-repos-against-accidental-rm.md delete mode 100644 source/blog/2015-12-16-spoiled-by-retina-in-less-than-a-day.md delete mode 100644 source/blog/2015-12-20-regex-flavor-hell.md delete mode 100644 source/blog/2015-12-26-autoenv-with-auto-cleanup.md delete mode 100644 source/blog/2015-12-27-lesson-on-magic-method-access-of-python-new-style-classes-from-my-failed-python3-port-of-tomorrow.md delete mode 100644 source/blog/2015-12-28-why-i-want-lossless-music-on-itunes-music-store.md delete mode 100644 source/blog/2015-12-29-catches-when-installing-windows-7-with-boot-camp.md delete mode 100644 source/blog/2016-01-01-virtualenvs-for-everyone.md delete mode 100644 source/blog/2016-01-14-the-dirtiest-mistakes-of-os-x.md delete mode 100644 source/blog/2016-01-18-me-too-comments-on-github.md delete mode 100644 source/blog/2016-01-24-antivirus-app-on-mas-top-chart.md delete mode 100644 source/blog/2016-01-26-dropbox-noteworthy-and-damned-skeuomorphism.md delete mode 100644 source/blog/2016-03-06-google-chrome-keeps-getting-uglier.md delete mode 100644 source/blog/2016-04-10-emacss-got-a-redesigned-website.md delete mode 100644 source/blog/2016-05-07-chrome-is-screwing-with-our-extensions-again.md create mode 100644 source/blog/2016-06-04-Mode-kiosk-sur-une-Raspberry-Pi-1.md delete mode 100644 source/blog/2016-06-24-its-2016-and-microsoft-is-the-only-legit-player-who-spams-me-without-unsubscribe-links.md delete mode 100644 source/blog/2016-09-01-this-blog-is-now-behind-cloudflare.md delete mode 100644 source/blog/2016-10-26-pyenv-compiling-python-with-sqlite-in-nonstandard-location.md delete mode 100644 source/blog/2017-04-28-test-ee.md create mode 100644 source/css/jquery.jscrollpane.css create mode 100644 source/gpg/corentin.breton@neodarz.net.public.asc create mode 100644 source/js/code_scrollbar.js create mode 100644 source/js/jquery.jscrollpane.min.js create mode 100644 source/website/cv-contact.md delete mode 100644 source/website/cv.md diff --git a/source/blog/2014-10-20-hello-octopress.md b/source/blog/2014-10-20-hello-octopress.md deleted file mode 100644 index 8b6eb248..00000000 --- a/source/blog/2014-10-20-hello-octopress.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: "Hello, Octopress!" -date: 2014-10-20T16:53:00-0700 -date_display: October 20, 2014 ---- - -This post marks my transition from Tumblr to Octopress & GitHub Pages. - -I've been microblogging for a while at [zshello3.tumblr.com](http://zshello3.tumblr.com) and I liked it. Not because of readers, which I suspect I have none; but there are certainly a huge amount of information I want to dump off my mind. Back in the days I *loved* my handwritten journals, and I really poured a lot into them. Peers were usually amazed when they saw my journals. These days typing seems to be a more robust solution to keeping my thoughts, especially when the thoughts are mostly technical. - -Tumblr is awesome. Compared to WordPress (.com for pedantic people), it is both lightweight and beautiful (you get all the customization for free), so you quickly get to the writing. However, it is not designed for geeks, so - -* Customization is capped at some point; -* I had the impression that the Markdown parser is herrendous; -* Email publishing is a mightmare, by the way; -* Code rendering always falls short — unless I spend a lot of time customizing (I'm pretty bad at HTML, CSS, and JS stuff). - -Speaking of the last point, I've always been envious of the beautiful code blocks found on Octopress blogs. So here I come! - -(Let me give it a try first.) - -``` C -#include - -int main(int argc, char **argv) { - printf("Hello, Octopress!\n") -} -``` - -Gorgeous. I'll get to the theme customization later. I'm actually busy as crazy this week. - -Before I close this post, let me also try to embed a random gist I authored yesterday (for brewing): - -``` -{% gist 828fd00bdecd6611cf40 brew.sh %} -``` diff --git a/source/blog/2014-10-20-help-mou-hit-1-dot-0.md b/source/blog/2014-10-20-help-mou-hit-1-dot-0.md deleted file mode 100644 index 773e1916..00000000 --- a/source/blog/2014-10-20-help-mou-hit-1-dot-0.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Help Mou hit 1.0" -date: 2014-10-20T17:37:45-0700 -date_display: October 20, 2014 ---- - -Quick call for [Mou 1.0 fundraiser](https://www.indiegogo.com/projects/mou-1-0-markdown-editor-on-os-x-for-you) on Indiegogo. At the time of writing, it has raised $6,178/$20,000, and has 39 days to go (with 21 already passed). - - -I'm actually writing this post in Mou right now. It's far less powerful than Emacs, but when I want preview-on-the-fly, Mou is the Markdown editor to go. Right now it's far from perfect; for instance, GFM fenced blocks (now included in [CommonMark](http://commonmark.org)) are not supported, so you get nonsense preview when your code block is fenced rather than indented. (Of course, Mou is even less suitable for editing an Octopress post due to the yaml metadata upfront, but that's not a big deal.) - -Let's hope for Mou hitting the 1.0 mark. diff --git a/source/blog/2014-10-21-get-rolling.md b/source/blog/2014-10-21-get-rolling.md deleted file mode 100644 index 9d64fff7..00000000 --- a/source/blog/2014-10-21-get-rolling.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: "Get rolling" -date: 2014-10-21T11:40:14-0700 -date_display: October 21, 2014 ---- - -Yesterday, on an internet forum, I saw someone’s signature, which translates to - -> Don’t even get started if you know you can't know from the beginning that you won't make it to the very end. - -This seems justified — persistence is the key to success; why even bother if you know you’ll fail? However, I have to profoundly disagree with this, and even dedicate a blog post to discussing this problem. - -The problem here is, the real world is much more complicated than the idealized world found in various quotes about persistence. Most of the time you have absolutely no clue where which road is leading, unless you embark on the journey, clueless. As for me, fortunately I knew I was gonna be a mathematician/physicist ever since elementary school, so the roadmap is sorta clear on the grand scale. Still, all those tiny building blocks for the ultimate goal are confusing, and even more so for things hardly related to the ultimate goal, for instance, coding, which is just a hobby and a way to simplify life — it has simplified my life in some sense, but has itself complicated my life in other ways (your life inevitably becomes more complicated when you know more and want to find out even more). - -And sometimes you are bound to fail — I know my code is shitty, for instance, but if I don’t get rolling, I won’t even have a working (albeit shitty) version that barely meets my needs. As another example, I was looking for a way to share and archive some photos. I started with [WordPress](http://apinkarchive.wordpress.com/), which turned out to be more formal and tiring than I’d thought. Then I ran a [Tumblr microblog](http://chorongmemories.tumblr.com/), which was great, but has certain limitations that in the end prevents it from being damn useful for myself, so in the end I went onto “indefinite hiatus.” In both cases I never declared that the thing was permanent — I was careful to say that the blogs were experimental, and I moved on when I found something better, or when they were no longer helping me. Yesterday I started yet another experiment, a [Tistory blog](http://apinkpcr.tistory.com). It is a random move triggered by something unexpected; the South Korean blogging platform is not that great, but at least it provides acceptable API access, and more importantly, I’ve got complete infrastructure built around the API to scrape photos, so it’s easy to build on top of that to automate things. It is also experimental. Again I’m not sure I long I can keep it up, but at least I’m happy with it for the time being. Being happy at the time being is the most important goal for hobbies. - -Choices are hard. Especially in today’s world, tools in every discipline are constantly improving, be it math, physics, programming, photography, blogging, or whatever. If you research over and over until you find “the perfect tool”, or “the perfect platform” (hint: the rank is constantly changing), you’re stuck on the first step to anywhere. In fact, reading other people’s blogs, for example, are not enough to learn what is the best — you need to at least have some working knowledge to even decide which tool or platform is more suitable for you. Therefore, the most sensible thing to do is to do a little bit of research (combined with your gut feeling), pick up something that makes you feel good at the moment, and immediately get rolling. Well, of course you need some research, otherwise you’re just kidding yourself; doing `>>> import this` in python tells you: - -> Now is better than never.
-> Although never is often better than *right* now. - -Then, when you have more experience and know what’s wrong with your original choice, correct it or trash it. There’s nothing wrong with abandoning dated crap, hopping bandwagons, or whatever; that’s the nature of change and improvement, and the most sensible thing for someone as busy as you are. - -Up till now I've been talking about tools and platforms, so maybe it seems that I'm attacking the straw man — you may argue that the original quote is not about what tools or platforms you use, but rather, what you try to accomplish with the tools or platforms. Okay, what about the grander things in life, like mathematical research, like *the final theory*? Well, similar. I’ll quote Ravi here, - -> …mathematics is so rich and infinite that it is impossible to learn it systematically, and if you wait to master one topic before moving on to the next, you’ll never get anywhere. Instead, you’ll have tendrils of knowledge extending far from your comfort zone. Then you can later backfill from these tendrils, and extend your comfort zone; this is much easier to do than learning “forwards”. - -Ravi is always hinting at “you should get started with actual research rather than ‘prepare’ yourself”! I can’t reckon that since I’ve yet to follow Ravi’s advice, but the thinking here is crystal clear. **You shouldn’t be afraid of failure; you shouldn’t be afraid of being “not prepared enough”; you shouldn’t be afraid of getting started.** Speaking of a final theory, I’m pretty sure I’m bound to fail, I’m pretty sure I won’t see a satisfactory one in my lifetime — the inconvenient truth is that, I have the gut feeling that the ultimate explanation is unfortunately intertwined with consciousness, and we are still far from having the right tools to understand consciousness. According to Feynman, **really knowing something is hard**. It’s hard, so failure is not shameful at all. Those who won’t even get started due to fear of failing or making the wrong choice won’t fail again, since they’ve already failed at the very beginning. So, get rolling. - -Yesterday I read [Fire and Motion](http://www.joelonsoftware.com/articles/fog0000000339.html) on *Joel on Software*. Joel’s metaphor is really nice, but he’s essentially conveying very similar ideas. - -------------------------------------------------------------------------------- - -By the way, I wrote this post in Emacs. I don’t know why but I seem to type much faster in Emacs than in Mou. (For Markdown editing `markdown-mode`, and `typo-mode`, a minor mode I found today which is useful for inserting smart quotes and smart dashes seamlessly into md articles). diff --git a/source/blog/2014-10-23-ripping-copy-protected-dvd-with-mpv.md b/source/blog/2014-10-23-ripping-copy-protected-dvd-with-mpv.md deleted file mode 100644 index 53e3e40e..00000000 --- a/source/blog/2014-10-23-ripping-copy-protected-dvd-with-mpv.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: "Ripping copy-protected DVD with mpv" -date: 2014-10-23T20:03:22-0700 -date_display: October 23, 2014 ---- - -**_11/02/2014 update:_** - -See [this post](/blog/2014-11-02-vobcopy-dvdbackup-etc.html) for issues, explanations, and more. - ---- - -**_10/25/2014 update:_** - -I'm such an idiot. `vobcopy` is the real, hassel-free way to go. - - brew install vobcopy - -Then, with the DVD mounted, - -> **vobcopy** without any options will copy the title with the most chapters into files of 2GB size into the current working directory. - -Of course there are a ton of options, but I generally hate to browse through options unless I have to, so I'm happy with calling without argument. - ---- - -Yesterday I was trying to rip a music video off a newly released DVD from Japan. I knew very little about how DRM (in this case, CSS) actually works and how to break it. I tried to operate directly on the VOB file with `ffmpeg` or `mpv` but both failed with a lot of header errors — I suppose more files than the VOB are required for authentication? Whatever, maybe I’ll learn the details in the future, but I don’t see the need since DVD is an outdated technology anyway. - -So, can we proceed from here? Most certainly. I noticed that although `mpv` won’t let me play a single VOB, I can simply hand it the DVD mount point, and it will play the whole DVD seamlessly. **Caution:** `mpv` needs to be compiled with `libdvdnav` and `libdvdread`! With brew you just do - - brew install mpv --with-libdvdnav --with-libdvdread - -For better performance and backup, I first cloned the DVD into a `.cdr` image (DVD/CD-R Master Image) using Disk Utility (I've never tried creating/cloning image with `diskutil` CLI, so nothing to report on that). Then I mount the image, say the mount point is `/Volumes/UPBX_80165`. As said I can hand that mount point to `mpv` and it simply works, but how about extracting the MPEG-2 video stream? The `--stream-capture=` option is there just for you. In principle `--stream-dump=` should also work, but without monitoring the output and controlling where to end, I’m not sure if it will ever terminate itself when reading from a DVD (when I stream captured the DVD it just kept repeating itself until I explicitly quit with `q`). So that's it: - - mpv --stream-capture=dump.mpg /Volumes/UPBX_80165 - -Then you can torture the `dump.mpg` with `ffmpeg` however you want. The most obvious thing is to cut out the music video part, and put into a new container like MPEG-TS. Or transcode it to H.264 for your iPhone. The nice thing about `dump.mpg` is that, unless I got it wrong, there's no quality loss here — the only thing you got rid of is that goddamn DRM. diff --git a/source/blog/2014-10-24-charles-munger-donated-$65m-to-kitp.md b/source/blog/2014-10-24-charles-munger-donated-$65m-to-kitp.md deleted file mode 100644 index 365ad718..00000000 --- a/source/blog/2014-10-24-charles-munger-donated-$65m-to-kitp.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "Charles Munger donated $65M to KITP" -date: 2014-10-24T16:41:36-0700 -date_display: October 24, 2014 ---- - -Today's news has it that Charles Munger made a $65 million donation to KITP at UCSB. See for instance [this article](http://nyti.ms/1D4zg24) on NYT. Of course I didn't learn it from NYT (I'm generally sick of any news other than math, physics, or IT-related ones). I learned it from [Not Even Wrong](http://www.math.columbia.edu/~woit/wordpress/?p=7247) instead (of course I don't agree with Woit, but some of his links are nice). - -I have no interest whatsoever in the business world, so I have no idea about Warren Buffett's business partners (although I'm still worldly enough to know Warren Buffett). However, the name Charles Munger sounded surprisingly familiar. After reading the sentence - -> Mr. Munger has frequently donated big sums to schools like Stanford and the Harvard-Westlake School. - -from the NYT article linked above, it finally hit me that Mr. Munger is the donor of the Munger Graduate Residence here at Stanford. Munger is really nice, much better than our undergrad residences AFAIK (location-wise Roble is still unbeatable for mathematicians and physicists, although Munger still kicks EV's ass). - -I'm glad to see more and more entrepreneurs funding physics, especially theoretical physics, whether they understand it or not. (**Aside:** Even for laypeople theoretical physics is cool isn't it, like the coolest kid in class. I won't comment on whether math is cooler, but breakthrough mathematical work certainly go largely unnoticed in the public, since theoretical physics is the last thing that laypeople can "vaguely understand". Do some name searches on Google to see how math and physics play out in the limelight — hint: - -* Gauss — 4,130,000 results; -* Euler — 855,000 results; -* Newton — 13,200,000 results; -* Einstein — 6,330,000 results. - -End of aside.) Engaging in physics is plain better than engaging in some questionable philanthropy. (Have you heard that Gates Foundation invested in G4S, the largest private military and security company in the world? I’m not sure about the details — I once read that off a bathroom flyer — but that’s definitely interesting philanthropy.) diff --git a/source/blog/2014-10-25-os-x-package-receipts.md b/source/blog/2014-10-25-os-x-package-receipts.md deleted file mode 100644 index e04f026a..00000000 --- a/source/blog/2014-10-25-os-x-package-receipts.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "OS X package receipts" -date: 2014-10-25T13:26:02-0700 -date_display: October 25, 2014 ---- - -I just learned something new. Whenever you install a `pkg` on OS X, OS X stores a receipt of what was installed in `/var/db/receipts` (I'm running OS X 10.9.5 at the time of writing), called a **bom** — bill of materials (I’d rather call it a manifest, whatever). This feature was introduced in NeXTSTEP. From `man 5 bom`: - -> The Mac OS X Installer uses a file system "bill of materials" to determine which files to install, remove, or upgrade. A bill of materials, **bom**, contains all the files within a directory, along with some information about each file. File information includes: the file's UNIX permissions, its owner and group, its size, its time of last modification, and so on. Also included are a checksum of each file and information about hard links. - -`man 5 bom` is actually badly maintained, as it says "The bill of materials for installed packages are found within the package receipts located in /Library/Receipts," whereas those have been migrated to `/var/db/receipts` a long time ago. - -`.bom` files are binary, but you can access the contents via `lsbom`. For instance, to list the files installed, - - lsbom -f /var/db/receipts/org.macports.MacPorts.bom - -Note that the paths printed are always relative to `/`. See `man 1 lsbom` for detailed option listing. - -(Beware when you try to clean up unwanted packages using the `lsbom` listing. Packages might overwrite files, so make sure you review the listing first and know what you are doing. "Knowing what you are doing" is the prerequisite for using `sudo` anyway.) diff --git a/source/blog/2014-10-26-audio-cd-slash-dvd-to-iso-image-on-os-x.md b/source/blog/2014-10-26-audio-cd-slash-dvd-to-iso-image-on-os-x.md deleted file mode 100644 index 6679537e..00000000 --- a/source/blog/2014-10-26-audio-cd-slash-dvd-to-iso-image-on-os-x.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "Convert Audio CD/DVD to ISO image on OS X" -date: 2014-10-26T23:29:47-0700 -date_display: October 26, 2014 ---- - -**_11/02/2014 update:_** - -See [this post](/blog/2014-11-02-vobcopy-dvdbackup-etc.html) for issues, explanations, and more. - ---- - -Today it occurred to me that I should make clones of my audio CDs (as stand-alone ISO images, I mean, not just rsyncing the AIFFs to subdirectories in `~/aud/lossless`). One can never have too many backups. - -Of course I could simply pack the aforementioned directories with AIFFs into ISOs — that’s not impressive. The end result might actually be the same, but I want to make the clones directly from the original CDs. It turns out that this is not so simple with the Disk Utility GUI — unlike DVDs, the “New Image” option is grayed out for Audio CDs. I’m not sure why, but maybe they want you to just use iTunes to deal with Audio CDs (which works well for all practical purposes — but theoretical curiosity never ends). - -So there comes `hdiutil`. `hdiutil` and `diskutil` are the utilities underlying Disk Utility. Unfortunately, so far I know little about them except for simplest things like `diskutil list`, `diskutil mount`, `hdiutil attach -stdinpass`, etc. (I'm so ignorant about anything filesystem related!) The `hdiutil` verb that makes cross-platform CD or DVD is `makehybrid`, which supports the following filesystem options: `-hfs` (holy crap, no HFS+ please! Apple ought to replace this thirty-year-old filesystem — ZFS or something better please!), `-iso`, `-joliet`, and `-udf`. For Audio CDs you use `-iso` and with `-joliet` extension: - - hdiutil makehybrid -iso -joliet -o AUDIO_CD_NAME.iso SOURCE - -where `SOURCE` can be the mount point, the disk device file, etc. Similarly, although you can create `.cdr` images from DVDs via the Disk Utility GUI, you can also do it with `hdiutil` (which is potentially more portable — I’ve never heard a definitive answer of whether renaming `.cdr` to `.iso` really cross-platform): - - hdiutil makehybrid -udf -o DVD_NAME.iso SOURCE - -This way CSS keys *seem* to be cloned as well, since I was able to authenticate such a CSS-protected DVD with `libdvdread`. - ---- - -P.S. I sincerely hope that one day lossless music tracks are no longer distributed through CD-ROMs. So painful — even my Internet speed is more than ten times faster than the [highest transfer rate](https://en.wikipedia.org/wiki/CD-ROM#Transfer_rates) available from any CD-ROM. (I’ve heard about some websites distributing lossless music digitally, but that won’t happen to the music I care about in the near future.) I still like physical albums though — a real sense of possession. Maybe they should contain the physical goodies and some sort of access codes? diff --git a/source/blog/2014-10-26-disk-visualizer-daisydisk.md b/source/blog/2014-10-26-disk-visualizer-daisydisk.md deleted file mode 100644 index c55eb4ba..00000000 --- a/source/blog/2014-10-26-disk-visualizer-daisydisk.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "Disk visualizer: DaisyDisk" -date: 2014-10-26T00:02:22-0700 -date_display: October 26, 2014 ---- - -DaisyDisk is a pretty famous name. I’ve heard a lot that DaisyDisk is beautiful, but as a “power user” I always feel ashamed about using a disk analyzer or visualizer (although no one really cares). I’m pretty comfortable with doing most filesystem operations right in the shell, and for other tasks too tedious for the shell (like renaming a bunch of files with no obvious pattern), Finder (equipped with TotalFinder) works just fine. - -Today I was trying clean up my drive a bit, as there were only 22GB left. I knew where the main problem lied: a huge number of highres videos lying in `~/vid/staging`, awaiting renaming and migration to my external drive. Anyway, it would be nice to have some visualization of a detailed breakdown of my disk usage, preferably on any level I want without multiple passes of `du`. The name DaisyDisk popped up from the cache in my brain, so I headed over to their website to download it. - -The result is not disappointing at all. Look at this: - -![DaisyDisk screen shot](https://i.imgur.com/vyIwSNQ.png) - -Beautiful. Moreover, functional. It indeed gives me a detailed breakdown on any level, within any directory (given enough priviledge). I can also collect items I don’t want and let DaisyDisk clean up for me at once (not surprising for a disk analyzer); this feature isn’t that useful for me since I know exactly where my queues of unorganized items are — `~/Downloads`, `~/aud/staging`, `~/img/staging`, and `~/vid/staging`. - -By the way, DaisyDisk seems to be WinRAR-free. (Rest assured; I’m a good guy and I *will* purchase a license — these days whether to purchase the website or the MAS version is a headache, though.) diff --git a/source/blog/2014-10-27-onedrive-goes-unlimited.md b/source/blog/2014-10-27-onedrive-goes-unlimited.md deleted file mode 100644 index 7f394254..00000000 --- a/source/blog/2014-10-27-onedrive-goes-unlimited.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "OneDrive goes unlimited" -date: 2014-10-27T09:44:51-0700 -date_display: October 27, 2014 ---- - -**10/28/2014 Update:** - -Yesterday Microsoft pushed an update to OneDrive.app to MAS. After uninstalling, reinstalling, and wiping the 10 GB folder I'd like to sync (that's for photos; I upload videos via the web interface) on both client and server sides, it actually began to work. The speed was around 1 MB/s during my last sync of 10 GB worth of data. Not fast, but I will be fairly satisfied if it can keep up with that speed. Time will tell. - ---- -The OneDrive team just [announced on their blog](https://blog.onedrive.com/office-365-onedrive-unlimited-storage/) that - -> Today, storage limits just became a thing of the past with Office 365. Moving forward, all Office 365 customers will get unlimited OneDrive storage at no additional cost. - -Hell, I hate Microsoft, but **I have to say that this is big**. OneDrive might not be the first to offer unlimited cloud storage (not sure), but it is certainly the first one to roll it out on such a grand scale. Remember, Office 365 is just $99.99 a year. OneDrive might not be the best cloud storage service, especially for OS X customers, but unlimited is unlimited — in comparison, I pay Google $9.99 a month for 1 TB. - -Microsoft products are indeed pure crap on a Mac. Office for Mac 2011 is horrible (speed and bloat aside, some features are simply not implemented — try to import a UTF-8 CSV into Excel, all non-ASCII characters become underscores; Microsoft’s response was that Unicode import was not implemented yet). OneDrive.app is slow like crawl, and it never finishes syncing — always stuck on the last few megabytes, eating up 100% CPU. Thank god I only use it for backups. The web interface is okay, although Google Drive is faster — blazing fast, I can easily upload with 20+MB/s. But again, **unlimited is unlimited.** - -Microsoft is opening a new chapter of cloud storage. In today’s world, we have so many huge video files, so storage limit should indeed be something of the past. This is a smart move for Microsoft — when you have, say, 100 TB up there (which seems very far at this moment, but what if all contents go 4K), and if competitors don’t offer comparable plans, then you are stuck with Microsoft. And Office. Oh my god, Microsoft Office must die. - -Of course I don’t want to be stuck with Microsoft, so I’m looking at how Google and Apple will handle this. Google ought to offer more affordable plans, preferably also unlimited. (My 1Password still has it that I purchased Office for Mac University 2011 on Nov 12, 2012 for $99.99. That turned into a free 4-year Office 365 subscription, which contains 60 world minutes of Skype per month, 1 TB of OneDrive — oh, now it’s about to go unlimited. All for $99.99. In comparison, Google charges me $119.88 per year.) Apple wants you to save everything to iCloud, and it introduced iCloud Drive and Cloud Kit this year — but plans still start at 5 GB and tops out at 1 TB, seriously? Dude, you sell top notch hardware with huge profits; why don’t you pay your customers back by offering better cloud storage — that’s also better for iCloud. diff --git a/source/blog/2014-10-28-google-drive-no-selective-subfolder-sync.md b/source/blog/2014-10-28-google-drive-no-selective-subfolder-sync.md deleted file mode 100644 index 06a72b4b..00000000 --- a/source/blog/2014-10-28-google-drive-no-selective-subfolder-sync.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: "Google Drive — no selective subfolder sync?" -date: 2014-10-28T20:49:24-0700 -date_display: October 28, 2014 ---- - -Up to this point I've been using Google Drive as an online backup service, and uploads files mostly manually, although I do sync `~/img` with the client. - -**Aside.** Google Drive, OneDrive, etc. don't work with symlinks. Wanna keep your stuff free and duplicate-free yet still synced to the servers? Use `rsync` to automatically reproduce your folder structure with hard links: - - rsync -avzP --delete --link-dest=SOURCE/ SOURCE DESTINATION - -e.g., - - rsync -avzP --delete --link-dest=~/img/ ~/img/ ~/sync/GoogleDrive/img/ - -automatically reproduces my `~/img` in the `img` directory under Google Drive's root, yet every file in the `~/img` tree is replaced by hard links to the original file, so the new structure within Google Drive takes little additional space — for the directories only. - -That doesn't solve every problem though, as you will see shortly. *End of aside.* - -So, up to this point I’ve mostly used Google Drive as an online backup service by manually uploading (huge) stuff. But at some point I’m gonna automate parts of the uploading. As it turns out, I can keep some smaller video files on my hard drive; other bigger monsters (like movies, TV shows, etc., especially a lot of 1080i Transport Streams directly from TV broadcasts) are uploaded and then moved to external drives. Some of the smaller files, including things downloaded from YouTube, live in `~/vid/etc`, and I want to sync this folder to Google Drive. What's shocking is that this is not possible with the Google Drive client — it only allows selective syncing of the top level folders. Let me repeat this: - -**The Google Drive client only allows selective syncing of the _top level folders_.** - -This is *insane*. It’s almost 2015. Everyone supports this — Dropbox, Microsoft, Box, even Baidu. Google Drive launched on April 24, 2012, that’s 2.5 years ago. [This thread](https://productforums.google.com/forum/#!topic/drive/Gs2w1BL-B9U) on Google Drive Forum, “Ability to sync only selected sub folders”, was posted on August 27, 2012, and has garnered 139 replies. They are ignored by the developers, and the accepted “answer” is to utilize Google Drive’s assign-one-file/folder-to-multiple-folders feature to create a special “sync” directory. Okay, that’s a stupid hard link solution on the server side. Okay, if that works… *No*. “Hard links on the server side” cannot bear different names; so what if I want to sync, say, both `vid/etc` and `aud/etc`? Whoops. So I also have to do all sorts of ugly renaming. NO, GOOGLE, NO, I won't accept that much trouble. - -This kind of insanity makes me wander: - -**Do the Google Drive developers use Google Drive themselves?** - -For now I'm moving `vid/etc` to `vid_etc`. Sigh. - ---- - -There are other problems that I encountered with Google Drive sync today. For one thing, it rejects what I already have and insists on starting from scratch. I mean, say I have uploaded a folder via the web interface, and later wants to keep it in sync (of course that's only possible if it's top level), so I put what I already have there. Nope, Google Drive reports that as a conflict and insists on downloading all the stuff again. Apart from wasted traffic, that also ruins my hard links, so I have to either wipe everything clean on the server side and reupload, or redownload everything and redo all the hard-linking after the download finishes. Either way, very annoying. I opted for the first one. (I later empirically confirmed that OneDrive could handle this situation.) - -There are other problems that don't pop right off my mind. Anyway, the gist is, - -**Google Drive is not yet sync-ready for power users (maybe even laymen).** - ---- - -Then, is OneDrive perfect? No. I know it recently went unlimited, but there’s one major annoyance: the speed. Stanford’s Ethernet speed is almost 1 Gbps UL/DL, but the OneDrive client tops out at about 2 MBps. The web interface isn’t much better. Google Drive is a lot faster than that, which makes it a good backup service for manual uploading. Anyway, maybe OneDrive will improve over time; yesterday they delivered an update to OneDrive.app, and at least it finally works. - -OneDrive also boasts no file status indicators on OS X, which everyone else in the industry has. That’s not a show-stopper though, if you just use it as a backup service. - ---- - -What about Dropbox? Dropbox is a truly awesome sync-ready service, but it is at the same time pretty expensive compared to others. Also, since I use Dropbox as a sync service, it must be up at all times and constantly indexing, so I’m really cautious with what I put there to avoid unnecessary cycles and startup time. - ---- - -Everything is broken in one way or another. Sigh. Let's hope that OneDrive improves a lot in the coming months; if it's stable enough and the speed gets some boost, I'll cancel my Google Drive subscription. I am a Google supporter and Microsoft hater, but a service that *works* is more important than ideology. diff --git a/source/blog/2014-10-28-mou-1-dot-0-fundraiser-goal-reached.md b/source/blog/2014-10-28-mou-1-dot-0-fundraiser-goal-reached.md deleted file mode 100644 index f6aa8d0c..00000000 --- a/source/blog/2014-10-28-mou-1-dot-0-fundraiser-goal-reached.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "Mou 1.0 fundraiser: goal reached" -date: 2014-10-28T01:57:06-0700 -date_display: October 28, 2014 ---- - -A week ago I wrote a post [*Help Mou hit 1.0*](/blog/2014-10-20-help-mou-hit-1-dot-0.html). Today, I'm delighted to find out that Mou has reached its goal, $20,000, half way into the fundraiser. - -![Mou hit its goal on Indiegogo](https://i.imgur.com/vM298t5.png) - -So what do I expect from 1.0? Most importantly, - -* CommonMark support, especially GFM fenced code block and saner nested structures; -* Custom Markdown engine (I would like to call [`stmd`](https://github.com/jgm/CommonMark)). - -Whatever the case, Emacs is still my best friend. diff --git a/source/blog/2014-10-29-fun.md b/source/blog/2014-10-29-fun.md deleted file mode 100644 index 4e733427..00000000 --- a/source/blog/2014-10-29-fun.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "Fun" -date: 2014-10-29T11:26:29-0700 -date_display: October 29, 2014 ---- - - -This happened in yesterday's Math 210A lecture. - -> Ravi: I won't be here next Thursday.
-> Someone: Will there be a lecture?
-> Ravi: Yeah, Brian Conrad will give a lecture. Don't tell him, he don't know this yet. - -... diff --git a/source/blog/2014-11-02-vobcopy-dvdbackup-etc.md b/source/blog/2014-11-02-vobcopy-dvdbackup-etc.md deleted file mode 100644 index b0b1d8ca..00000000 --- a/source/blog/2014-11-02-vobcopy-dvdbackup-etc.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: "vobcopy, dvdbackup, etc." -date: 2014-11-02T15:06:07-0800 -date_display: November 2, 2014 ---- - -A few days ago, I was cloning my entire Audio CD and DVD collection, and reported some of the findings in [this post](/blog/2014-10-26-audio-cd-slash-dvd-to-iso-image-on-os-x.html). As said, the most important commands are - - hdiutil makehybrid -iso -joliet -o AUDIO_CD_NAME.iso SOURCE - -for Audio CDs and - - hdiutil makehybrid -udf -o DVD_NAME.iso SOURCE - -for DVDs. - -Those alone don't finish the story. I also tried other things and unfortunately encountered problems. I was too busy to report back then, but now I'll summarize some of the findings. - ---- - -For one thing, `hdiutil makehybrid` might fail, issuing an "Operation not permitted" for no obvious reason. This could even happen when you work with the Disk Utility GUI (for which I once got a "Permission denied"). Even `sudo` didn't help in my case. However, I was able to **circumvent the problem with the root shell** (I won't tell you how to enter the root shell — you need to at least have that amount of knowledge about the root shell before you are given the key). Not sure why. Just keep in mind that the root shell might help (that's also a general, albeit dangerous, advice for life). - ---- - -Next onto grabbing the raw VOB. - -`vobcopy` is pretty sweet, but at least for me it had one huge problem. When I tried to copy a single title, say title #2 with - - vobcopy --title-number TITLE_NUMBER -i SOURCE - -other titles got copied, too. I didn't have enough samples to test out, but presumably it's because the problematic DVD has a structure like this: - -![problematic DVD title structure](https://i.imgur.com/HTgmwQL.png) - -Anyway, no matter I `vobcopy` title 01, 02, or 03, the result was the same — the whole thing. That's pretty stupid. I don't know if it counts as a bug or unfinished feature. Definitely not cool. - -(One cool thing about `vobcopy`: as long as you complied with `libdvdread`, you can create a fully decrypted version of the DVD with - - vobcopy --mirror -i SOURCE - -Of course, to get an iso image out of the decrypted mirror, you run the `hdiutil makehybrid -udf` command given above.) - ---- - -So `vobcopy` is dead (for copying specific titles in unfortunate DVDs). What's next? - -There's `dvdbackup`. The man page is good, and [ArchWiki](https://wiki.archlinux.org/index.php/dvdbackup#A_single_title) is even better (*ArchWiki is awesome!*), providing you cookbook solutions of combining the power of `dvdbackup` and `dvdauthor` (cookbooks are nice when dealing with unexciting technologies like DVD). In fact, `dvdbackup` alone is enough for extracting the VOBs of relatively small titles (< 1GiB): - - dvdbackup -i SOURCE -o VOB_TARGET_DIR -t TITLE_NUMBER -n TITLE_NAME - -then grab your title-specific VOB in `VOB_TARGET_DIR/TITLE_NAME/VIDEO_TS`. Unlike `vobcopy`'s `-n/--title-number` option, `dvdbackup`'s `-t/--title` option does it right, trimming everything else. However, there's a problem when the title is larger than 1 GiB — then `dvdbackup` will split the VOB into several 1 GiB max pieces, and there's no way to disable this (since `dvdbackup` is targeting a DVD player — ancient technology — rather than `mpv` or whatever). What's sadder is that I can't seem to combine the split VOBs with FFmpeg stream copy — `pcm_dvd` audio always gets converted to `mp2` and fails when I use `-c copy`. I'm not a codec expert, but I suppose this is due to the fact that `pcm_dvd` isn't a supported encoding codec of FFmpeg (at least not my FFmpeg): - - > ffmpeg -codecs | grep pcm_dvd - D.A..S pcm_dvd PCM signed 20|24-bit big-endian - -`D` is for "Decoding supported", `A` is for "Audio codec", `S` is for "Lossless compression" — no encoding support. By the way, my FFmpeg is `brew`ed with the options `--with-fdk-aac`, `--with-ffplay`, `--with-freetype`, `--with-libass`, `--with-libbluray`, `--with-openjpeg`, `--with-openssl`, `--with-x265`: - - > \ffmpeg -version - ffmpeg version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers - built on Oct 19 2014 14:09:36 with Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) - configuration: --prefix=/usr/local/Cellar/ffmpeg/2.4.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libass --enable-ffplay --enable-libfdk-aac --enable-openssl --enable-libx265 --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 ' - libavutil 54. 7.100 / 54. 7.100 - libavcodec 56. 1.100 / 56. 1.100 - libavformat 56. 4.101 / 56. 4.101 - libavdevice 56. 0.100 / 56. 0.100 - libavfilter 5. 1.100 / 5. 1.100 - libavresample 2. 1. 0 / 2. 1. 0 - libswscale 3. 0.100 / 3. 0.100 - libswresample 1. 1.100 / 1. 1.100 - libpostproc 53. 0.100 / 53. 0.100 - -Maybe I missed some `--enable`. - -Sorry for the digression. So, it's not possible to stream-copy-concat the VOBs with FFmpeg. (In fact, since audio quality is not that important — you won't be able to tell 256k AAC from lossless anyway, especially when you are focusing on the video, so you can always transcode `pcm_dvd` into 256k AAC with `-c:a libfdk_aac -b:a 256k`. `mpeg2video` is an encoding supported codec so stream copy works fine. Or you may also use `flac` or whatever encoding-supported lossless codec.) However, if you insist on getting the original `pcm_dvd`, there is a way, an ugly way. You've gotta be creative here. [ArchWiki](https://wiki.archlinux.org/index.php/dvdbackup#A_single_title) already provides a cookbook solution on how to use `dvdbackup` and `dvdauthor` to create a DVD with a selected title. And `vobcopy` can copy the entire thing just fine, without the 1 GiB limit (make sure to use the `-l/--large-file` option if the size is greater than 2 GiB). Therefore, you can create a DVD with selected title from the original DVD, then `vobcopy` from the new DVD. This is insane, but it works, I've tested that. **Note, however, that timestamps might be wrong with `vobcopy`, so the VOB runs just fine linearly but might run into problems when you seek.** Therefore, FFmpeg is still the way to go. Or maybe you can do it right with one click using some closed source software ☹ — I've heard about success stories with the long ceased DVD Decrypter Windows project. In reality, I guess only people with theoretical interest or OCD will ever do this — FLAC or AAC should serve everyone just fine. It should have worked with `vobcopy` alone, but it doesn't. Hence the workaround. - ---- - -For future reference, I'll translate the ArchWiki cookbook solution here (it's too cookbook itself, specifying paths like `~/movie_name` and using unnecessary `cd`) about creating a title-specific DVD from a multi-title DVD (replace `SOURCE`, `VOB_TARGET_DIR`, `DVD_TARGET_DIR`, `TITLE_NUMBER`, and `TITLE_NAME` with sane values): - - dvdbackup -i SOURCE -o VOB_TARGET_DIR -t TITLE_NUMBER -n TITLE_NAME - dvdauthor -t -o DVD_TARGET_DIR VOB_TARGET_DIR/TITLE_NAME/VIDEO_TS/*.VOB - export VIDEO_FORMAT=NTSC - cd DVD_TARGET_DIR/VIDEO_TS && dvdauthor -T -o DVD_TARGET_DIR - -`export VIDEO_FORMAT=NTSC` is to avoid the `dvdauthor` error of "no default video format, must explicitly specify NTSC or PAL" (I'm not sure about the difference between NTSC and PAL, but I saw NTSC printed on my DVD, so I used it). And there you go, a shiny new DVD filesystem located in `DVD_TARGET_DIR`. (Note that unlike `vobcopy`, `dvdbackup` doesn't feature a nice progress bar even when `-v/--verbose` and `-p/--progress` are specified.) Then you can - - vobcopy -l DVD_TARGET_DIR - -if you'd like to. Recall that timestamps might be wrong, sadly. diff --git a/source/blog/2014-11-05-apple-is-pushing-yosemite-hard.md b/source/blog/2014-11-05-apple-is-pushing-yosemite-hard.md deleted file mode 100644 index 9b9bf3f1..00000000 --- a/source/blog/2014-11-05-apple-is-pushing-yosemite-hard.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "Apple is pushing Yosemite hard" -date: 2014-11-05T22:17:01-0800 -date_display: November 5, 2014 ---- - -Apple is pushing Yosemite hard and secretly Yosemitizing things. iTunes was updated to its shiny new look on Mavericks, day one upon Yosemite launch. I liked it. The only problems I had with the new iTunes are: - -* It's no longer possible to go to the Artists view and Music Videos view with one click. Artists is now a drop-down menu option in My Music view; Music Videos is now a sidebar tab in Playlists view. - -* The red icon doesn't look as good as the previous blue one, and it doesn't harmonize too well alongside the blue Finder and Mail. Maybe they will look better together in Yosemite. - -Just now I found that the Mac App Store in Mavericks is also Yosemitized: - -![Yosemitized Mac App Store](https://i.imgur.com/T7KIo6s.png) - -The chromeless UI certainly looks a bit weird, and the font seems a bit too small. However, I'm sure I'll quickly get over these shortcomings, and might even grow to appreciate them. Even more so when I finally upgrade to Yosemite (I'll wait for Thanksgiving break or 10.10.1 this year, whichever comes first — looks like the former will come first, considering the first 10.10.1 developer beta was out [merely two days ago](http://www.macrumors.com/2014/11/03/first-yosemite-10-10-1-beta-now-available/), [reportedly](https://i.imgur.com/IVFV7E2.png) focusing on WiFi, etc.). - -On the font side, unfortunately the small font size in the new Mac App Store does make text fuzzy on my non-Retina display. I didn't notice the fuzziness in the new iTunes. Anyway, everything is optimized for Retina — Apple is also secretly pushing Retina hard. In the Apple ecosystem, apparently you always want to stay at the top of the line. Due to Apple's nature, the degree of hardware-software integration is simply unparalleled, so only the latest hardware enjoys all the new features and love. Unfortunately, the typical lifespan of a Mac is much longer than the hardware/software release cycle. - -The truth is, we (or at least I) adapt to things much quicker and easier than we'd imagined (or otherwise would be willing to admit). When iOS 7 was demo'ed on WWDC 2013, I was like "no way! What's with those stupid flat crap?" But when the update came, I hopped on and was happy ever since. (I reserve my opinion on the icon design.) Later when I installed an app that was not updated for the new UI, I was like "OMG, what's with this clumsy UI?" I guess legibility issues, WiFi issues (with Yosemite) and responsiveness issue (with iOS 8 on iPhone 4S — *AT&T, where's my preordered 6 Plus?*) are harder to impossible to adapt to, but they will eventually be fixed, or support-dropped, or hardware-upgraded (with $$). So in the end (almost) everyone will be happy. And one day when we face the old thing again by chance, we'll flee as fast as we can: "what's with that..." (I did exaggerate. Also, I know, many people just don't care about design, or have ill tastes, or can't find the buttons after a minimal number of UI tweaks — I'm not including them in the "we" here.) Those who claim that "I won't upgrade until..." are just kidding themselves, and certainly no one will wait for them or make their "until..." come true. Most of those "won't upgrade" folks will eventually upgrade and be happy. Those that really don't upgrade (like those still running Snow Leopard) either can't afford the new hardware, or suffer from senility (seen from the deep hostility towards new things). Or they have some important legacy software that would break with an upgrade; poor dudes. - -Same goes for newer, shinier, seemingly unnecessary deluxe hardware. I'm still stuck on a Mid-2012 MBP 13" Non-Retina. Retina seems highly useless for me since I do most of my work on the 27" external display — the 13" internal LCD hosts a single maximized Activity Monitor window most of the time (and sometimes also a Transmission window). I expect my opinion about Retina to change after I upgrade to a Retina model next year. (It will be a pretty major purchase though — i7, 16 GB memory, and 512 GB SSD are musts, and there are like a million peripherals to buy — Thunderbolt to Ethernet, Super Drive, etc., etc.) This shift of opinion after upgrading to something unnecessarily good (and ending up not being able to tolerate anything inferior) is best described as "**sadly converted**". Some folks are already sadly converted by the Retina iMac. See, for example, [this article](http://arstechnica.com/apple/2014/11/yes-the-5k-retina-imacs-screen-runs-at-60hz-at-5k-resolution/#p11) on Ars Technica: - -> Prior to getting the Retina iMac on my desk, I would have said that "retina" isn’t necessarily something we need on the desktop. Most people don’t notice pixels on the desktop at a normal seating distance. However, after getting to A/B compare the Retina iMac with the standard one over the course of a week, I’m sadly converted. I just don’t know if my wallet can take the abuse. - -And others are bitterly desiring one (me included — sadly two Macs are too much for a university dorm). See, for example, [this comment](http://arstechnica.com/apple/2014/11/yes-the-5k-retina-imacs-screen-runs-at-60hz-at-5k-resolution/?comments=1&post=27896871) on the aforementioned article: - -> I WISH APPLE TECHNICA WOULD STOP WITH ALL THESE ARTICLES ABOUT THE IMAC. -> -> It really makes me want one unjustifiably. diff --git a/source/blog/2014-11-05-list-youtube-playlist-with-youtube-dl.md b/source/blog/2014-11-05-list-youtube-playlist-with-youtube-dl.md deleted file mode 100644 index fa624b69..00000000 --- a/source/blog/2014-11-05-list-youtube-playlist-with-youtube-dl.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: "List YouTube playlist with youtube-dl" -date: 2014-11-05T10:37:58-0800 -date_display: November 5, 2014 ---- - -Of course you are always welcome to use the [Google APIs Client Library for Python](https://developers.google.com/api-client-library/python/) to wrestle with YouTube, which is usually pretty simple. (As an added bonus, YouTube has some [nice runnable sample scripts](https://developers.google.com/youtube/v3/code_samples/) to get you started.) With the client library, listing videos in a YouTube playlist is a breeze. - -However, if you don't feel like writing code yourself (I usually don't feel like writing code myself until I use something often enough and existing solutions are suboptimal), `youtube-dl` recently added the functionality to list videos in a playlist with the `--flat-playlist` option. - -[According to one of the project collaborators](https://github.com/rg3/youtube-dl/issues/4003#issuecomment-60322630), currently `--flat-playlist` is only helpful with the `-j` option for dumping JSON (so I suppose this feature is subject to change). For instance, `--flat-playlist` alone would emit something like this: - -```bash -> youtube-dl --flat-playlist 'https://www.youtube.com/watch?v=gdOwwI0ngqQ&list=PLPpZI8R1zUfrkDbmJMOBhEbJ9Td9vbV-F' -[youtube:playlist] Downloading playlist PLPpZI8R1zUfrkDbmJMOBhEbJ9Td9vbV-F - add --no-playlist to just download video gdOwwI0ngqQ -[youtube:playlist] PLPpZI8R1zUfrkDbmJMOBhEbJ9Td9vbV-F: Downloading webpage -[youtube:playlist] PLPpZI8R1zUfrkDbmJMOBhEbJ9Td9vbV-F: Downloading page #1 -[download] Downloading playlist: Cam By apinknomfan -[youtube:playlist] playlist Cam By apinknomfan: Collected 119 video ids (downloading 119 of them) -[download] Downloading video #1 of 119 -[download] Downloading video #2 of 119 -[download] Downloading video #3 of 119 -[download] Downloading video #4 of 119 -... - -``` - -which doesn't really make sense — it tells you that it collected 119 video ids, and no more. Once you have `-j` on, you get JSON data that you can parse with anything: - -```bash -> youtube-dl -j --flat-playlist 'https://www.youtube.com/watch?v=gdOwwI0ngqQ&list=PLPpZI8R1zUfrkDbmJMOBhEbJ9Td9vbV-F' -{"url": "gdOwwI0ngqQ", "_type": "url", "ie_key": "Youtube", "id": "gdOwwI0ngqQ"} -{"url": "j9l5nchv1Z8", "_type": "url", "ie_key": "Youtube", "id": "j9l5nchv1Z8"} -{"url": "znW5ALwWNQw", "_type": "url", "ie_key": "Youtube", "id": "znW5ALwWNQw"} -{"url": "qyE7-auTIcc", "_type": "url", "ie_key": "Youtube", "id": "qyE7-auTIcc"} -... - -``` - -The most straightforward way to parse this is to use a command line JSON parser, the best one being [jq](https://github.com/stedolan/jq): - -```bash -> youtube-dl -j --flat-playlist 'https://www.youtube.com/watch?v=gdOwwI0ngqQ&list=PLPpZI8R1zUfrkDbmJMOBhEbJ9Td9vbV-F' | jq -r '.id' | sed 's_^_https://youtube.com/v/_' -https://youtube.com/v/gdOwwI0ngqQ -https://youtube.com/v/j9l5nchv1Z8 -https://youtube.com/v/znW5ALwWNQw -https://youtube.com/v/qyE7-auTIcc -... - -``` - -There you go, a list of URIs you can use. Of course you can put this in a script to save some typing: - -```bash -#!/usr/bin/env bash -# Takes a YouTube URI to a playlist (fairly liberal, it's fine as long -# as the playlist id can be extracted), and prints a list of URIs in a -# YouTube playlist. -# -# Requires youtube-dl 2014.10.24, tested on youtube-dl -# 2014.11.02.1. Feature subject to change. -youtube-dl -j --flat-playlist "$1" | jq -r '.id' | sed 's_^_https://youtube.com/v/_' -``` - -**_Aside:_** I first embedded the gist here, but [it looked a bit off](https://i.imgur.com/m3cr0Im.png). See [imathis/octopress#1392](https://github.com/imathis/octopress/issues/1392). - -> In the next version of the Gist tag plugin we are just downloading the gists and embedding them upon generation so we don't have to worry about GitHub going down and breaking all your gists, or changing the HTML and breaking all the styles. -> -> For the time being I suggest embedding your code snippets directly if you want them to look good. - -Okay. End of aside. - -By the way, `youtube-dl` supports playlist bulk download natively. The reason I need a list of video ids or URIs, however, is that among other things, `youtube-dl` doesn't download highest resolution DASH video by default, so I have to rely on something like `youtube-dl-dash` ([link](https://github.com/zmwangx/sh/blob/master/youtube-dl-dash)) to download the best version. diff --git a/source/blog/2014-11-06-2014-nobel-prize-in-physics-led-lights-seriously.md b/source/blog/2014-11-06-2014-nobel-prize-in-physics-led-lights-seriously.md deleted file mode 100644 index 2805a7a8..00000000 --- a/source/blog/2014-11-06-2014-nobel-prize-in-physics-led-lights-seriously.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "2014 Nobel Prize in Physics — LED lights, seriously?" -date: 2014-11-06T11:08:45-0800 -date_display: November 6, 2014 ---- - -For some reason, I only learned about this year’s laureates today, through [the reference frame](http://motls.blogspot.com/2014/11/ex-employer-wont-meet-blue-led-nobel.html). The prize goes to the inventors of the LED. Not exciting at all, so I don’t care if I’m ever informed. (Lubos has a good point on why applied physics — well, let’s even widen the concept of applied physics a bit — should not surprise anyone when they appear in a Nobel Prize announcement: “After all, Alfred Nobel might have very well considered his dynamite to be a discovery in physics, too.”) - -The Nobel Prize Physics Awards has been rather amusing in recent years. Partly due to controversy on the theoretical front and no breakthrough on the experimental front, I guess. (The discovery of Higgs was a breakthrough to some extent, but it was totally expected; little physics beyond SM at LHC before LS1 is sad. Since it was totally expected, the award went to theorists — some experimentalists might not be too thrilled.) Just look at the recent list: 2010, graphene (shouldn’t that be chemistry? if material science can be part of physics, then chemistry must surely encompass it, too); 2009, CCD sensor (whatever that means, maybe that’s important); 2008, fibers (okay, I love fast Internet connections). The list actually goes all the way down to early 20th century, but it’s much denser in recent decades. Now one more: 2014, LED. - -> “for the invention of efficient blue light-emitting diodes which has enabled bright and energy-saving white light sources” - -Wow, energy-saving. I guess next year’s prize will go to the inventors of high efficiency urinals, for being resource-saving. -**I mean, LEDs are great, but not great as physics, much less a physics breakthrough.** - -Let’s compare the applied folks to other laureates: Lorentz, J. J. Thomson, Planck, Einstein, Bohr, Heisenberg, Schrödinger, Dirac, Fermi, Pauli, Born, Lee, Yang, Landau, Feynman, Schwinger, Gell-Mann, Weinberg, ’t Hooft, etc. Not on the same level. - -It’s good to see that a growing body of physicists are (or at least as it seems to me) increasingly reserved about the Nobel Prize, and prizes in general. Same goes for math, with the Nobel Prize replaced by something else. (Employers still love the big titles, I suppose — good to have some star faculty on board.) diff --git a/source/blog/2014-11-07-interstellar.md b/source/blog/2014-11-07-interstellar.md deleted file mode 100644 index 4e7d9f92..00000000 --- a/source/blog/2014-11-07-interstellar.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Interstellar" -date: 2014-11-07T23:56:31-0800 -date_display: November 7, 2014 ---- - -Today (I mean November 7, 2014 — it’s technically November 8 at the time of writing) I saw [*Interstellar*](https://en.wikipedia.org/wiki/Interstellar_%28film%29) (IMAX digital) at AMC Mercado 20. I rarely go to movie theaters, less on the release day (film formats of *Interstellar* were released on November 5, and digital formats followed on November 7). However, reviews of it were positive (from the physics community), and I really need a way to release stress these days — I wasn’t in the right condition for months. So I figured I’d just spend an afternoon in front of the big screen. - -I’ve heard good things about IMAX 70mm film, like no trailers, among other things. But I didn’t bother the extra seven miles’ drive to Hackworth IMAX Dome, so I landed on IMAX digital. Still a pretty stunning experience, although I ended up watching forty minutes worth of trailers before the real thing (arrived fifteen minutes early). In hindsight maybe I’d be better off spending some extra time on the road. - -Speaking of the movie itself, they tried to make it as plausible as possible from a physics viewpoint, by involving [Kip Thorne](https://en.wikipedia.org/wiki/Kip_Thorne) of Caltech. (There’s even a book out, *The Science of Interstellar*.) For instance, the wormhole isn’t portrayed as a hole (I mean, imagine a ring in empty space, as you would picture in your mind when you hear the word “hole” out of nothing; that’s not how it looks like here, and there’s a nice explanation). Some of the physics still doesn’t work out quite well, though, like Cooper’s not crushed at the singularity… Also there are communications from within the horizon and breakdown of causality, explained in the movie as happening in four dimension slices of some five dimensional spacetime where time could be a physical dimension. Obviously these are needed to get the sci-fi story going, so no one should be blamed. - -I was there for the sci-fi and physics, but a nice surprise was that I was also touched by the humanity elements of story, I mean, family and stuff. - -The downside: Cooper’s accent was a bit hard on me ☹ diff --git a/source/blog/2014-11-10-average-phone-plan-in-the-u-dot-s-costs-ten-time-as-much-as-that-in-the-u-dot-k.md b/source/blog/2014-11-10-average-phone-plan-in-the-u-dot-s-costs-ten-time-as-much-as-that-in-the-u-dot-k.md deleted file mode 100644 index d80b421a..00000000 --- a/source/blog/2014-11-10-average-phone-plan-in-the-u-dot-s-costs-ten-time-as-much-as-that-in-the-u-dot-k.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Average phone plan in the U.S. costs ten time as much as that in the U.K." -date: 2014-11-10T11:11:46-0800 -date_display: November 10, 2014 ---- - -To quote [Opera News](http://blogs.opera.com/news/2014/11/mobile-data-anyway/), - -> According to research by the International Telecommunication Union, the average phone plan with 500MB of data costs $85 in the United States, compared to $24.10 in China and $8.80 in the United Kingdom. - -Holy shit! diff --git a/source/blog/2014-11-11-re-encoding-everything-for-iphone-6-plus.md b/source/blog/2014-11-11-re-encoding-everything-for-iphone-6-plus.md deleted file mode 100644 index c80cbe18..00000000 --- a/source/blog/2014-11-11-re-encoding-everything-for-iphone-6-plus.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Re-encoding everything for iPhone 6 Plus" -date: 2014-11-11T13:31:25-0800 -date_display: November 11, 2014 ---- - -AT&T finally delivered my iPhone 6 Plus (silver, 64 GB) after about fifty days since preorder… The 1080p Retina display is simply stunning. However, it turns out that my old videos don’t work so well on 6 Plus’s giant screen. My old mobile video collection was optimized for my 16 GB 4S, targeting the small screen and highly limited storage — you guessed it, they were resized to 960x540, and they looked great. But they’re not up to the task any more. 960x540 videos aren’t at all sharp on the stunning screen of 6 Plus, which is more than capable of handling 4x pixels. Therefore, I have no choice but to feed it more pixels. I’m left in a weird situation, where my 1080p desktop (or even HDTV) quality videos should fit the screen just fine, but H.264 profile stands in the way. iPhone 6 and 6 Plus are only capable of High Profile level 4.2, so anything encoded in level 5.1, for instance, needs to be re-encoded. Also there are still MPEG-2 and MPEG-4 videos out there (MPEG-4 should be obsolete by now, I assume, but some people still use it; and MPEG-2 is de facto in TV broadcasts), which have to be transcoded. Okay, it’s a daunting task to re-encode a fairly big collection, but I have to do it sooner or later. Presumably this weekend. I’ll also report whether 720p videos look sharp on the screen later. diff --git a/source/blog/2014-11-19-convolution-of-irreducible-characters.md b/source/blog/2014-11-19-convolution-of-irreducible-characters.md deleted file mode 100644 index 7466b1cd..00000000 --- a/source/blog/2014-11-19-convolution-of-irreducible-characters.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Convolution of irreducible characters" -date: 2014-11-19T20:40:37-0800 -date_display: November 19, 2014 ---- - -__*TL; DR:* The actual PDF write-up is [here](https://dl.bintray.com/zmwangx/generic/20141119-convolution-of-irreducible-characters.pdf).__ - ---- - -Yesterday I was trying to establish the formula for orthogonal primitive central idempotents of a group ring. It is possible to establish the result through the convolution of irreducible characters. However, I stuck quite a while on trying to work out the convolutions themselves. For a formidable and unenlightening proof using "matrix entry functions" (i.e., fix a basis, induce a matrix representation, and explicitly expand everything in matrix elements), see [this post](http://drexel28.wordpress.com/2011/03/02/representation-theory-using-orthogonality-relations-to-compute-convolutions-of-characters-and-matrix-entry-functions/) (in fact, this is just one in a series of posts that lead up to the result). That's a really sad proof. - -It turns out that I really should have been working the other way round — first establish the orthogonal idempotents (the proof of which is really simple and elegant, I was just trapped in a single thread of thought), then use that to compute the convolution of irreducible characters. - -I feel like this is worth presenting (as the only proof I saw online is the really sad one above), so I TeX'ed it up. I tried to convert to MathJax HTML but eventually gave up (that's the story for another post). So, the write-up is in good ol' PDF, available [here](https://dl.bintray.com/zmwangx/generic/20141119-convolution-of-irreducible-characters.pdf). diff --git a/source/blog/2014-11-20-dropbot-for-geeks(r).md b/source/blog/2014-11-20-dropbot-for-geeks(r).md deleted file mode 100644 index ed3c706e..00000000 --- a/source/blog/2014-11-20-dropbot-for-geeks(r).md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "Dropbot for Geeks®" -date: 2014-11-20T09:48:15-0800 -date_display: November 20, 2014 ---- - -I propose the following cloud storage and syncing service model of the future. I call it **Dropbot for Geeks®**, and it totally rules. It's designed for geeks who are tired of the highly limited, miserably unproductive traditional services (based on clicking around). It has the following features: - -* Standard Unix file system commands exposed as an API, e.g., `cat`, `cd`, `cp`, `du`, `df`, `file`, `find`, `head`, `ln`, `ls`, `mkdir`, `mv`, `pwd`, `rm`, `rmdir`, `tail`, `touch`, etc. -* A rudimentary shell emulator through the web interface exposing the commands above. -* Secure shell access to the file system, also exposing the commands above. Provide two-factor auth for SSH. Clearly, `scp` should also be supported. -* Checksums. Expose, for instance, `md5sum` or `sha1sum`, in the API. Provide checksums on download pages, probably on demand. -* Programmable selective syncing, down to per file level. -* Scriptability. Allow clients to run custom scheduled jobs or daemons with the API above. To prevent the service from becoming full-featured IaaS, though, clients might be limited in CPU time, memory, or command selection. This bullet point is arguable. - ---- - -With the level of command line integration illustrated above, we'll finally get rid of clicking around and not being able to automate chores. Navgating the remote file system will be a breeze — click, click, click, click, click (sometimes click should be replaced by double click, which is even more painful) just to navigate to a directory will be made a thing of the past. `ln`, in particular, saves disk space for duplicates — Dropbot for Geeks does *not* want to charge you extra for multiple copies of the same file in different directories. (To facilitate syncing hardlinks, clients should be able to specify hardlinked files in a config file. Or maybe some better mechanism. This might be hard.) At last, checksums are a must. I’ve had traumatic experiences like having downloaded an eight-part RAR, 1 GiB each, only to find that it wouldn’t unRAR. Without checksums, it was impossible to find which part was corrupted. As a result, I had to re-download everything — a nightmare. I never want to experience similar problems again. Hence the precious checksums. - -Dropbot for Geeks looks like a pretty good (well, not really, but at least pretty cool®) model. Maybe I should patent it before anyone else? Then if some similar service surfaces in the future, I can [sue their ass off and enjoy some hot cash](http://arstechnica.com/tech-policy/2014/11/jury-apple-must-pay-23-6m-for-old-pager-patents/). diff --git a/source/blog/2014-11-24-iphone-photography-frustration.md b/source/blog/2014-11-24-iphone-photography-frustration.md deleted file mode 100644 index beb54f0e..00000000 --- a/source/blog/2014-11-24-iphone-photography-frustration.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "iPhone photography frustration" -date: 2014-11-24T12:42:25-0800 -date_display: November 24, 2014 ---- - -**TL; DR:** Jump to the paragraph “In the end…” - ---- - -I'm not a photo-savvy guy. I've never taken a single selfie in my life, and my iPhone Photos app witnesses about twenty photos a year — fifteen of which are accidental screenshots. Okay, a little bit of exaggeration. The iPhone, aka iCamera, especially the 6 Plus model, is sort of a waste in my possession. However, my grandparents came to visit me on campus yesterday, and my grandma *loves* photos. So I took one with them, using my phone (which is obviously better than my grandma’s digital camera). The lighting was wrong, but I was able to fix that in five seconds — clicked “Edit”, clicked on the little sun icon (whatever it is called), clicked on “Light”, slided the slidebar all the way to the right, and all of a sudden it looked perfect. (This is the first time I ever clicked those, but I got it nicely done in five seconds — very intuitive, deeply impressed.) From a layman’s perspective, the builtin edit feature of the Photos app is really smart. Later I tried to reproduce the same edit with iPhoto, but I had to manually wrestle with exposure, highlights, shadows, brightness, contrast, etc., and I just never got it right. Call me a moron if you feel like it, but I’ve already given you the context at the beginning of this article, so you can’t blame me. (For your reference, I do ’shop some images for fun and profit from time to time, but I never deal with actual unedited photos, so I never have to worry about exposure and stuff.) - -So far so good. The frustation began when I try to import the photo to my Mac. I’m certainly not a mobile guy who keeps everything on his phone or the cloud. I have the photo import feature of Dropbox turned on, so as I plugged in my phone the photo already appearred in the Camera Upload folder. Wait what, two copies? Two copies that looked exactly the same, albeit one is about 0.1 MB larger than the other? Not cool. Pulled up Image Capture; Apple’s own software should do the trick, I guess. Nope, same thing. Googled, found this article on support.apple.com: [*iOS: Edited photos show original photo after import or in other apps*](http://support.apple.com/en-us/HT203612). Okay sure, they know this. Let's listen to what they have to say. - -> Apple uses Extensible Metadata Platform (XMP), a standard created by Adobe, for nondestructive photo editing. XMP allows you to undo edits and to revert back to an original photo without the loss of quality. Displaying the edited photo requires OS X v10.9 or later and software that can read XMP. The following applications support XMP: -> -> * iPhoto 9.5 or later -> * iPhoto for iOS -> * Aperture 3 or later -> * Adobe Lightroom -> * Adobe Photoshop Elements -> -> Other photo-management applications and some iOS apps may also display XMP. - -Adobe Lightroom, oh well. I don’t yet have Adobe CC installed — Photoshop is certainly a powerhouse (plus Illustrator, InDesign, etc. are nice to have at times), but Pixelmator works fine for me most of the time, and I’m happy to go to a library iMac or Mac Pro when I do need the power; $29.99/$19.99 is just too much if I use it twice a month. I theorize that I can indefinitely extend the free trial by running CC in a VM, reverting to a clean snapshot and regenerating the MAC address from time to time, but that’s only a theory — I haven’t got the incentive to test it out. As for iPhoto, I know it’s pretty lame from past experience, and I was very much baffled by the ugly and unintuitive UI, so normally I don’t even want to waste disk space on it; but since it’s only official solution other than expensive Adobe products and Aperture, I decided to install it. 1.7 GB gone. *So does the wasted 1.7 GB do the trick? Sadly, no.* Still the same thing in iPhoto 9.6, which is clearly “iPhoto 9.5 or later”. Totally baffled. - -In the end, I came up with an ugly solution. Just email or iMessage the photo to yourself from the phone. If you use email though, be sure to use the builtin Mail, or you would likely lose Exif data (I sent from Mailbox and lost Exif; I then sent from Mail and didn’t). This is really annoying since setting up accounts in the builtin Mail app is not fun — Google 2FA is not supported, and I have to generate an app-specific password. Compare to Mailbox, where *I signed into Dropbox on the new phone and within five seconds all of my ten email accounts are ready to use*. The loss of Exif data is probably related to [this thread on SO](http://stackoverflow.com/questions/20763814), but I didn’t delve into it since I’m not a Cocoa Touch dev. What’s more confusing, sending the photo via different applications result in different filesizes. The one sent from Mail (I chose original size when I sent it) was a 2 MB JPEG; the one sent from Mailbox was a 4.5 MB JPEG (without the right Exif); and the one sent via iMessage and later opened from the Messages app on Yosemite could be saved as a 10 MB lossless PNG (Exif was there). I went with the 2 MB one in the end. - -I don’t know if iCloud Photo Library will solve the problem in the end. From my perspective, *Apple should train Preview and QuickLook to recognize their XMP technology.* Seriously, they talk about continuity, and I expect to enjoy my enhanced photos on my Mac without going through all the hessle and confusion. Photo enhancing is already such a breeze, thank you; now make sharing and archiving easy, at least within the Apple ecosystem. (Although I’m not familiar with photography and image editing in general, considering how tech-savvy I am, I bet most users can’t even figure out one annoying solution.) - -By the way, Continuity and Handoff only work intermittently for me, and AirDrop between my iPhone (6 Plus) and MacBook Pro (mid-2012, model 9,2) doesn’t work at all. Continuity and Handoff sometimes turn up when they are unexpected (and serve as kinda nice surprises), but when I try to nail them, they remain elusive. Not a big deal for me, but certainly not the most pleasant thing ever. I bet these have to do with the fact that my Mac is connected to Ethernet and sharing the Ethernet connection to my iPhone; these days they expect everyone to be on Wi-Fi (and ironically they messed up big in Yosemite), but Wi-Fi simply can’t beat the speed and stability of Ethernet. I didn’t bother to test whether the features work when my devices are connected to the same Wi-Fi network; even if they do, that’s not my production setup, so they’re still useless to me. diff --git a/source/blog/2014-11-24-why-i-abandoned-mathjax-and-fell-back-to-pdf.md b/source/blog/2014-11-24-why-i-abandoned-mathjax-and-fell-back-to-pdf.md deleted file mode 100644 index 43ce2b76..00000000 --- a/source/blog/2014-11-24-why-i-abandoned-mathjax-and-fell-back-to-pdf.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Why I abandoned MathJax and fell back to PDF" -date: 2014-11-24T20:54:36-0800 -date_display: November 24, 2014 ---- - -Recently I wrote an expository article, [*Convolution of irreducible characters*](https://dl.bintray.com/zmwangx/generic/20141119-convolution-of-irreducible-characters.pdf), and posted it [here](/blog/2014-11-19-convolution-of-irreducible-characters.html). At first I intended to use MathJax, but in the end I fell back to good ol' PDF. Here's why. - -In short, I'm a mathematician. I write math *articles*, not just standalone expressions or formulas. I use AMSLaTeX to its fullest (not really, but at least I use numbering and the `amsthm` package to its fullest). HTML simply wasn't designed for this. Here are two influential markup languages designed for totally different use cases, and bridging them is painful. I tried to use `pandoc`, but it doesn't support `\input`, doesn't support `\def`, and swallows `\begin{theorem} \end{theorem}`, among other things. I tried to use `htlatex`; even the MathML output is suboptimal, with many math symbols translated to non-math (apart from totally human-unreadable), and it uses its custom CSS files that don't play well with everything else. I tried other things. In the end I gave up. Maybe I don't know enough about MathJax, but I certainly don't want to write a translator myself. Leave LaTeX alone. Distribute as PDF. MathJax may be great for Wikis (like Wikipedia) and for math lite blogs, but it's no replacement for real, beefy LaTeX. It's not for mathematicians who want to distribute real articles. - -By the way, Terry Tao and others use [Luca's LaTeX to WordPress, aka LaTeX2WP](http://lucatrevisan.wordpress.com/latex-to-wordpress/) for math blogging. From Terry's experience it works fairly well. I don't know if `amsthm` and `\def` are in the feature set, though. Anyway, since WordPress handles LaTeX as pre-compiled images (which is also the default on Wikipedia, and which looks poor in general and plays horribly with scaling), LaTeX2WP won't help MathJax users the slightest. diff --git a/source/blog/2014-11-25-i-got-16-gigs-of-ram.md b/source/blog/2014-11-25-i-got-16-gigs-of-ram.md deleted file mode 100644 index 75aecc29..00000000 --- a/source/blog/2014-11-25-i-got-16-gigs-of-ram.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "I got 16 gigs of RAM" -date: 2014-11-25T16:28:30-0800 -date_display: November 25, 2014 ---- - -Today I upgraded the RAM of my MacBook Pro mid-2012 to 2x8GB. I purchased the [Crucial 16GB Kit (8GBx2) DDR3/DDR3L 1600 MHz (PC3-12800) CL11 SODIMM 204-Pin 1.35V/1.5V Memory for Mac CT2K8G3S160BM](http://smile.amazon.com/dp/B008LTBJFW) from Amazon, which cost me $146.64 after tax. I followed the [official guide](http://support.apple.com/en-us/HT201165) as well as the [iFixit guide](https://www.ifixit.com/Guide/MacBook+Pro+13-Inch+Unibody+Mid+2012+RAM+Replacement/10374). To finish the job I needed a Phillips #00 screwdriver and a spudger, so I purchased the [spudger](https://www.ifixit.com/Store/Tools/Spudger/IF145-002) and the [54 bit driver kit](https://www.ifixit.com/Store/Tools/54-Bit-Driver-Kit/IF145-022-1) from iFixit. - -The actual process was pretty simple. I had a little bit of hard time pulling out the bottom module and pushing in the top module, but overall it was smooth. The only stupid thing I did was that I forgot to push the battery connector back in before I closed the case; I only realized this when I was screwing in the eighth screw (that was a close one!), and had to unscrew everything again. - -After I replaced the RAM modules, booting was just normal. And now I've got 16 gigs of RAM! - -![About This Mac->Memory](https://i.imgur.com/PGhdEGr.png) - -Want to run multiple memory hoggers *along with a Windows VM* (with 4GB of RAM)? No problem. - -![Activity Monitor->Memory](https://i.imgur.com/czDcVaK.png) - -By the way, Yosemite is indeed really aggressive at RAM usage. I reserve my opinion on whether there's a memory leak. But so far the performance has been fine, even with 8GB of RAM. diff --git a/source/blog/2014-11-26-original-images-in-day-one-journal.md b/source/blog/2014-11-26-original-images-in-day-one-journal.md deleted file mode 100644 index d68d365e..00000000 --- a/source/blog/2014-11-26-original-images-in-day-one-journal.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: "Original images in Day One journal" -date: 2014-11-26T00:22:16-0800 -date_display: November 26, 2014 ---- - -**TL; DR:** Jump to the paragraph beginning with “workaround”. - ---- - -I started a Day One journal two days ago. I've heard good things about Day One, but after using it for a dozen entries, I'm not that satisfied. For one thing, the editor is pretty horrible — keybindings aside, I can’t even find and replace?! And the overview doesn’t look very pretty if you are a heavy Markdown user (i.e., you have a lot of markups, e.g., italics and inline links) — the markups are displayed as is. Moreover, I can’t even `#` my title: it kills the bold font rendering in the bird’s-eye view. What a let down. Anyway, it’s better than nothing, and I hope it will help me keep on track. (I used to manage a Markdown journal in an encrypted sparse bundle, and it was a pain in the ass — mentally. Maybe some GUI sugar is necessary, although Day One is certainly not as pretty as advertised.) Also a private journal means more privacy — I certainly don’t want to publish everything I write on this public blog. - -Too much irrelevant talking. Onto one of the most annoying “features”, and the subject of this post. Images are automatically JPEG-compressed when imported into Day One. See [this support article](https://dayone.zendesk.com/hc/en-us/articles/200145875-Are-photos-resized-when-imported-into-Day-One-), which says: - -> Every photo imported into Day One is converted to JPEG format and resized to a maximum resolution of 2100 x 2100 pixels. The aspect ratio is maintained. We resize photos for more efficient sync and storage. At this size the average photo is about 700KB which means you can store: -> * Dropbox: 2,500+ photos using the free 2GB account -> * iCloud: 6,000+ photos using the free 5GB account - -What the heck. Dude, who cares about storage these days? And transfer rate? I have a gigabit Ethernet. I certainly have much more than 2GB in my Dropbox. Even for those underpriviledged folks with only 2GB, remember, Day One allows *only one photo per entry*. That’s 2,500+ entries. At any rate, this should be an opt-in rather than an uncustomizable “feature”. I’m about to submit a ticket, but I doubt the outcome (I’m sure many people have submitted tickets about the plain text format even when password-protected, but so far, no response). - -With photos, most of the time JPEG compression works pretty well (but people surely want to keep photos in highest quality). However, I’m a techie guy, and my images are often screenshots or precision images, where JPEG compression totally ruins the sharpness. - -Workaround? Simple (yet a bit annoying). Day One lets you show the photo in Finder. So just go ahead and replace that compressed image with the original using `cp` or `mv`. I shouldn’t have needed to do this, but every piece of software comes with some annoyances. Overall Day One’s pretty good — at least it does what it was designed for, albeit not perfectly. - ---- - -By the way, here is my support ticket: - -> I understand that Day One does JPEG compression to every imported photo, as written in the support article “Are photos resized when imported into Day One?” http://goo.gl/Rzi017 . Yet I beg an option. The reason is that the benefits outlined in the support article are virtually non-existent: -> -> * “More efficient sync and storage”: these days transfer rates are really high with SSDs and gigabit Ethernet, so reducing a few hundred KBs won’t help me the slightest; -> -> * “Dropbox: 2,500+ photos using the free 2GB account”: I have much more than 2GB in my Dropbox; even if I only have 2GB, Day One allows only one photo per entry, and that means 2,500+ entries with photos, which is more than enough for most users, I suppose. By the way, Dropbox storage shouldn’t be your concern; people will buy more when they need more. -> -> And some of the bad things about JPEG compression: -> -> * JPEG compression usually works pretty well with photos, but when I import high precision images, the sharpness is totally ruined; -> -> * People want to keep their photos in highest quality, which is defeated by forced compression. -> -> I know an ugly workaround, which is simply replace the compressed image with the original in the filesystem. But I would love to see an option to import images as originals (in fact, compression should be an opt-in). Really, transfer rates and storage grow so rapidly that they are not people’s primary concerns anymore. (For your information, OneDrive recently rolled out truly unlimited storage to Office 365 subscribers. Online storage is that cheap.) Thanks. diff --git a/source/blog/2014-11-28-given-infinite-time.md b/source/blog/2014-11-28-given-infinite-time.md deleted file mode 100644 index a0d3648f..00000000 --- a/source/blog/2014-11-28-given-infinite-time.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Given infinite time" -date: 2014-11-28T00:18:19-0800 -date_display: November 28, 2014 ---- - -Given infinite time. There's so much I can do *given infinite time*. I don't think I'll ever be bored. But sadly the time assigned to each human being is finite. Actually it's epsilon, epsilon approaching zero. Sadly. diff --git a/source/blog/2014-11-28-going-diceware.md b/source/blog/2014-11-28-going-diceware.md deleted file mode 100644 index 0e66daac..00000000 --- a/source/blog/2014-11-28-going-diceware.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Going Diceware" -date: 2014-11-28T19:05:59-0800 -date_display: November 28, 2014 ---- - -Today I'm officially going [Diceware](http://world.std.com/~reinhold/diceware.html). I published my simple C implementation of diceware on [GitHub](https://github.com/zmwangx/diceware). - -I've been using 1Password for a couple years now, and I've always been a bit worried about my master password. It's a ~30 byte monster with uppercase, lowercase letters, numbers, and special symbols. By any measure it is very safe. The problem is there are (extremely) personal things in there. I assembled several unrelated things that I (secretly) hold dearest to my heart, obfuscated them with rules not found in best64, and mixed with semi-gibberish. My daily login password is a combo similar in nature, with less obfuscation to facilitate typing. People who dig really deep into my identity might be able to compromise it (or not); I'm afraid that I'm more predictable than I thought I was. I know, the worry is pretty much unwarranted, as I’m not likely the target of a focused attack — I’m neither rich nor equipped with sensitive information or power, and for wide-range exploits, 99.9% of people are lower-hanging fruits. Even for a targeted attack, [xkcd 538: Security](http://xkcd.com/538/) broke a crypto nerd’s imagination with a $5 wrench. However, a geek is a geek, you can’t block a geek’s imagination. - -Therefore, after worrying for so long, today I’m going Diceware. Eight diceware words give you at least 100 bits of true entropy. Unfortunately I don’t have a die, and don’t bother to get one. (Amazon Prime: get it Monday? No. Target, six miles away? No.) So I read my random bits from `/dev/urandom`. The C implementation is [here](https://github.com/zmwangx/diceware). By publishing this I’m announcing to the world that I’m using diceware. But I’m not afraid, since I’m now protected by true entropy that’s not compromised by publishing the scheme. diff --git a/source/blog/2014-11-30-opera-style-advanced-keyboard-shortcuts-in-safari.md b/source/blog/2014-11-30-opera-style-advanced-keyboard-shortcuts-in-safari.md deleted file mode 100644 index 3e0d005e..00000000 --- a/source/blog/2014-11-30-opera-style-advanced-keyboard-shortcuts-in-safari.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: "Opera-style advanced keyboard shortcuts in Safari" -date: 2014-11-30T17:20:20-0800 -date_display: November 30, 2014 ---- - -I've been using the Chromuim Opera for a long time, after Chrome's design went unbearably ugly around v32 (IIRC Opera stable channel was on v19 when I switched, which was released on January 28, 2014). From then on, Opera's [advanced keyboard shortcuts](http://help.opera.com/opera/Mac/1583/en/fasterBrowsing.html#advanced) has become an integral part of my browsing habit. In particular, the following are especially handy for me: - -* `1`: Cycle left through tabs; -* `2`: Cycle right through tabs; -* `/`: Find on page; -* `Z`: Go back one page; -* `X`: Go forward one page; -* `0`: Zoom in; -* `9`: Zoom out; -* `6`: Reset zoom to 100%. - -Lately, with the Yosemite release, Safari has become a much more competitive browser. I won't say why, and I admit that it has major missing features that still prevents it from becoming my default — but I have to say I’m gradually moving more of more of my browsing, especially reading, to Safari. It would be nice if I could carry my power user shortcuts with me. Fortunately, this is possible. Just modify the plist in the following way: - -```bash -#!/usr/bin/env bash -defaults write com.apple.Safari NSUserKeyEquivalents '{ -"Actual Size"="6"; -"Back"="z"; -"Find..."="/"; -"Forward"="x"; -"Show Previous Tab"="1"; -"Show Next Tab"="2"; -"Zoom In"="0"; -"Zoom Out"="9"; -}' -``` - -Relaunch Safari. You are all set! Enjoy the ultrafast single key navigating experience. To reset, - -```bash -defaults delete com.apple.Safari NSUserKeyEquivalents -``` - ---- - -**_2014/12/22 Update:_** - -There's one caveat to this approach — unlike in Opera, where the default layman shortcuts (e.g., ⌘F) are still available when advanced keyboard shorts are enabled, in Safari they are simply overwritten. This is annoying when the web page or web app binds certain keys, especially `/` to its own search bar (a notable example being google.com). In that case I have to admit defeat and click on the menu bar item, which takes a hundred times as long as a single `/` keystroke. diff --git a/source/blog/2014-12-05-distraction-free-writing.md b/source/blog/2014-12-05-distraction-free-writing.md deleted file mode 100644 index a65ab166..00000000 --- a/source/blog/2014-12-05-distraction-free-writing.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "Distraction free writing" -date: 2014-12-05T21:09:10-0800 -date_display: December 5, 2014 ---- - -This is not the first time that a distraction free writing app is featured on the Mac App Store. This time the candidate is [Desk](https://itunes.apple.com/us/app/desk/id915839505?mt=12). The official website is [here](http://desk.pm), but licensing is MAS-exclusive. The icon looks like this: - -![The icon of Desk](https://i.imgur.com/OprXSEU.png) - -Skeuomorphism, oh man. And this is the only screenshot I can find on the official website: - -![Screenshot of editing in Desk](https://i.imgur.com/WBaYzho.png) - -I can find a few other screenshots on MAS, but you know how shitty MAS screenshots are, plus the screenshots of this app only focus on specific UI elements. The official website also features an intro video (which provides no information at all) and a brief feature list with no further details, all on one page. The MAS description is somewhat more comprehensive, but again, "WordPress integration" and the like are not so informative. So, after a certain amount of research, I have to say I know little about this app. To do the app justice, there's an [accompanying blog](http://blog.desk.pm), with all kinds of noise though — like what a good blog should be, no complaint about that. So I guess anyone who wants to know more about this app should go digging there. Not me, so I didn't read. - -Strangely enough, reception is great, although the price tag is currently set at $30 — definitely a premium price. John Gruber [has a piece](http://daringfireball.net/linked/2014/11/22/desk), but I think "My thanks to Johb Saddington for sponsoring this weeks' DF RSS feed to promote Desk, his blogging app for the Mac" kind of defeats credability. MAS featuring is also a good sign (although not always). Out of the 55 MAS ratings at the time of writing (9:42 PM, Friday, December 5, 2014), 45 are five stars. - -That brings home my curiosity about "distraction free writing apps" in general. _Why would anyone pay $30 for a "distraction free writing app" (which basically justifies any lack of feature — "we deliberately give you no choice for anything so you can focus on writing!"), **without even a trial**?_ MAS is such a bad model for utility and productivity software since you can't just look at five screenshots (seriously?) and decide "this is for me!" Yet I have the impression that more developers prefer this model nowadays, especially in this focused-writing business, another example being IA Writer. Sure it makes licensing and combating piracy simple, but again, I need to feel it to decide if it's the right tool for me, especially for a feature-deprived focused-writing app. (This is a general thought — in this case I don't need to feel it to tell that it's not for me.) - -More specifically, let's think about distraction free writing. What does IA Writer, or Desk, or other apps offer that's not already available to you with your OS? They support Markdown syntax highlighting, or even WYSYWYG (but only the very simple kind of WYSYWYG limited by the Markdown feature set), sure. They support some select-and-click type of formatting (by the way, Desk's formatting tools look a lot like those found on medium.com), which is good for some who are not competent enough to type simple markups, I guess. Desk supports drag-and-drop of media (although I'm sure it's limited to certain platforms and not portable at all — I always upload images to Imgur and embed the Imgur links, which is super simple for me since I have several homemade scripts to take care of that). So are these features essential? Not at all. For the general public, plain Markdown without rendering should be more than enough, since Markdown was designed to be human-readable as plain text in the first place. Markdown only gets ugly when you have a lot of inline hyperlinks, or worse still, plain HTML tags, but that's not what I would expect from the general public. The technical population who do probably need the rendering, on the other hand, aren't the target audience of these apps; certain needs of the technical folks are hardly ever addressed by these feature-deprived focused-writing apps — e.g., where are my keybindings (full-featured, not just C-k, C-y, C-p, C-n, C-b, C-f, M-del, etc.; in particular, what about M-d, M-b, etc.)? What about custom Markdown engine? What about Jekyll integration (no need for that, actually — I'm happy with tty)? So, to sum up, for the target audience, realtime rendering isn't necessary, although I guess people with technophobia hate to see markups like `**` so no rendering will kill them. Second point, select-and-click type of formatting, is already dismissed. Third point, drag-and-drop of media might be useful for some people, but not all. After all, Desk uses a typewriter as its icon, and there's no way you could throw photos into your typewriter. It's about writing, and most of the time writing is enough. - -I have dismissed the "additional features" of focused-writing apps as non-essential. And I can argue that they are actually sources of distraction — as soon as you have WYSYWYG and formatting and mouse, you could, in principle, begin to fiddle. But when I say "additional features", you might ask, "additional" compared to what? Okay here's the magic. The magic is designed by Apple in California®, and it's present on every single Mac running OS X. It's called TextEdit.app. Distraction free? How can you be more distraction free than this: - -![TextEdit: The most distraction free writing experience on the Mac. Designed by Apple in California.](https://i.imgur.com/z3LEu0U.png) - -It's either text or blank. Nothing else. It's more than capable of handling plain text, our best friend (and computer's best friend — the universal interface). You can customize the font once and for all, or you can even live with the factory setting. That's better than having a font you don't like forced upon you, as many of those focused-writing apps do. You can even auto save to iCloud if you'd like to. Of course there's no one click publishing or timeline management or whatever, but you could leave that to a publishing app (like Desk, when used as a publishing app). Better yet, you can use Jekyll or Octopress or whatever command line solution, where everything is at your fingertip, a few keystrokes away. No limitation whatsoever. But that's out of question for most people. (The easy-to-use command line interface, and not needing to worry about hosting myself, are two of the primary reasons that brought me to Octopress on GitHub Pages, rather than wordpress.com or self-hosted wordpress.org). - -Of course I'm not saying TextEdit is good enough as a text editor (it is good enough for most people, though), or it is my text editor of choice. My text editor has always been Emacs, which can be distraction free when I need it to be (I've hidden everything I feel like to hide), and which can be an almost feature-complete operating system when I need it to be. Apart from a slightly frustrating loading time, there's no such bullshit as "we deliberately left no feature and no choice to you so you won't fiddle." Mostly importantly, it is extensible — I can start writing Elisp right away, and every single line of code I write can potentially save me thousands of keystrokes in the future; I don't need to submit a feature request to the developer and wait forever (usually power users' feature requests are ignored, unless the software was built for power users to begin with or mainly popular within power users). Plus Emacs is free (both as in beer and in speech), rather than being proprietary and costing $30. At any rate, when I'm writing in Emacs, most of the time I'm just furiously typing away — no distraction whatsoever. That's the ideal state of writing, and I feel really good at those moments. That's the main charm of writing, at least to me. - -![Editing in iTerm2 + Emacs + Solarized Dark. Paradise.](https://i.imgur.com/2Jx9Mpv.png) - -The whole command line experience is awesome (most of what I do with the computer are either done in the browser or in iTerm2 — well, plus some time spent with PDF in Preview.app and some with emails in Mail.app). And most of my tools either ship with the operating system (OS X is a great operating system), or are FOSS. Things that hardly ever die. Of course the command line experience is infeasible for laymen, but my argument is, **most of the time the things you need are already there, e.g., TextEdit.** I feel bad about those folks who are constantly on the lookout for distraction-free writing apps, and pay a ridiculous amount for them — only to distract themselves. Just open TextEdit and type away (or if you're capable of it, Emacs or Vim or SublimeText or TextMate or BBEdit or whatever). That's the most productive thing to do. **Publishing is not the top priority; writing is, and it's really simple.** diff --git a/source/blog/2014-12-10-omnifocus-change-sync-behavior-mac-and-ios.md b/source/blog/2014-12-10-omnifocus-change-sync-behavior-mac-and-ios.md deleted file mode 100644 index 3f68969b..00000000 --- a/source/blog/2014-12-10-omnifocus-change-sync-behavior-mac-and-ios.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "OmniFocus: change sync behavior, Mac and iOS" -date: 2014-12-10T22:45:34-0800 -date_display: December 10, 2014 ---- - -On OS X, the following URIs are relevant: - -* omnifocus:///change-preference?MaximumTimeBetweenSync=30 -* omnifocus:///change-preference?TimeFromFirstEditToSync=2 - -What they do are self-evident. - -On iOS, use the following URIs instead: - -* x-omnifocus-debug:set-default:MaximumTimeBetweenSync:60 -* x-omnifocus-debug:set-default:TimeFromFirstEditToSync:2 - -Source: [Change Default Sync Times of OmniFocus For Mac and iOS](http://www.macstories.net/links/change-default-sync-times-of-omnifocus-for-mac-and-ios/). diff --git a/source/blog/2014-12-13-the-mac-like-evernote.md b/source/blog/2014-12-13-the-mac-like-evernote.md deleted file mode 100644 index 8f8d5f6b..00000000 --- a/source/blog/2014-12-13-the-mac-like-evernote.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "The Mac-like Evernote" -date: 2014-12-13T21:47:31-0800 -date_display: December 13, 2014 ---- - -Once in a while (maybe a year, maybe several months — not set in stone), I give big name free services not in use a chance to convince me. Evernote is one such service. The interface used to look very cheap and cluttered. I hated it. However, this time I'm sold. Now everything Evernote, from its Mac app to its iOS app to its web design to its physical products, looks distinctively Mac-like. (I use Mac-like to refer to Apple's design philosophy, including iOS. Well, I guess the Android and Windows apps aren't Mac-like.) I mean, just look at the screenshots: - -![Web UI, beta](https://i.imgur.com/AZelofm.png) -![Evernote Market, Pfeiffer Collection](https://i.imgur.com/tZuWBlY.png) -![Mac app](https://i.imgur.com/R4QF8OM.png) - -Bright, simplistic, elegant, clutter-free. Mac-like. The Mac app takes advantage of the translucent material of Yosemite, and it looks gorgeous. The iOS app also feels great on a full HD Retina screen; I didn't bother to take a screenshot. Now it's much likely that I'll put it into good use — cluttered and cheap-looking interfaces give me nightmares and actually hinders my productivity, and now they are gone. - -No one can argue that Apple products make great screenshots. They are also much more intuitive, functional, and productive than most Windows folks are willing to believe. I hope our world is more Mac-like. diff --git a/source/blog/2014-12-14-speeding-up-emacs-with-emacsclient.md b/source/blog/2014-12-14-speeding-up-emacs-with-emacsclient.md deleted file mode 100644 index 54cded76..00000000 --- a/source/blog/2014-12-14-speeding-up-emacs-with-emacsclient.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: "Speeding up Emacs with emacsclient" -date: 2014-12-14T10:06:02-0800 -date_display: December 14, 2014 ---- - -Emacs is notorious for its loading time. For me, this is especially annoying when I'm editing LaTeX files — AUCTeX takes about five seconds to load, and once I exit Emacs (especially after a quick edit), all that work is wasted, and next time I want to do some quick editing with that same LaTeX file — sorry, another five seconds. - -This problem can be solved by "using that same Emacs", i.e., running Emacs in server mode, then connecting to the server via `emacsclient`. Below is my script, which I call `emc`, to make `emacsclient` more user-friendly. `emc` opens a file (given as `$1`) on the server, launching one on its way if none is detected. Note that I used `-cqta=` for `emacsclient`. The `-c` option is `--create-frame`, i.e., create a new frame (in the current tty, for instance) instead of using the existing frame (in another tty, for instance); this allows for multiple frames accross different ttys. The `-q` option is for `--quiet`, suppressing messages like "Waiting for Emacs..." The `-t` option is for `--tty`, or equivalently, the familiar `-nw` option of `emacs`. The `-a=` options is `--alternate-editor=`; according to the manpage, `-a, --alternate-editor=EDITOR` has the following effect: - -> if the Emacs server is not running, run the specified editor instead. This can also be specified via the \`ALTERNATE_EDITOR' environment variable. If the value of EDITOR is the empty string, run \`emacs --daemon' to start Emacs in daemon mode, and try to connect to it. - -Note that `emacsclient` requires a filename, so my script prompts for one if `$1` is empty. - -``` bash -#!/usr/bin/env bash -if [[ -n $1 ]]; then - file=$1 -else - while [[ -z ${file} ]]; do - read -p 'filename: ' file - done -fi -emacsclient -cqta= "${file}" -``` - -Note that using `emacsclient` has the additional benefit that the same buffer is simultaneously updated accross different ttys (See screenshot, where I opened the current post in two different ttys). This way, you won't face the nasty "file changed on disk" problem when you accidentally edited the same file in another tty session. - -![screen shot of multiple copies of the same buffer](https://i.imgur.com/9KxEWKq.png) - -By the way, remember to re-configure your other programs that uses an external editor. For instance, change `$EDITOR` to `emacsclient -cqta=` in your `env`, and `core.editor` to `emacsclient -cqta=` in your `~/.gitconfig`. - -*Note*: if you use `emacsclient` to edit git commit messages in Git Commit Mode, remember to use `C-c C-c` (`git-commit-commit`) to save the commit message rather than using `server-edit` or `C-x C-c` to exit Emacs. Otherwise, the `COMMIT_EDITMSG` buffer will persist in the Emacs server, and you'll be prompted to revert buffer the next time you edit another commit message, which is pretty annoying. - -I just started using `emacsclient`, so the above script might be buggy in certain edge cases. I'll report when I run into issues. diff --git a/source/blog/2014-12-14-the-google-chrome-comic-a-classic.md b/source/blog/2014-12-14-the-google-chrome-comic-a-classic.md deleted file mode 100644 index f3d7f791..00000000 --- a/source/blog/2014-12-14-the-google-chrome-comic-a-classic.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "The Google Chrome Comic — A classic" -date: 2014-12-14T17:42:55-0800 -date_display: December 14, 2014 ---- - -I was cleaning up my Opera bookmarks just now — I'm semi-officially leaving Opera for Safari. Of course, Safari still can't handle everything (e.g., Adblock Plus is still not so good on Safari, YouTubeCenter lags behind and I don't bother to compile myself — yes, I have a certificate, and some power user features simply don't exist), so I'm still going to Opera/Opera beta/Chrome/Firefox for certain tasks. But Safari is very nice. For the first time. - -I started out as a Chrome user (well, don't want to recall the IE days), branched out to the Chromium Opera, and now ended up in Safari. Not sure about the future. When I look back, something nostalgic pops up in mind — [the Google Chrome Comic](http://www.google.com/googlebooks/chrome/). I enjoyed it more than once, but I never seemed to have archived it. So here it is, combined into [one PDF](https://dl.bintray.com/zmwangx/generic/2008-chrome-comic.pdf). In fact, you can create the PDF yourself: - -``` -seq 0 39 | parallel wget -q http://www.google.com/googlebooks/chrome/images/big/{}.jpg -convert $(ls -v *.jpg) 2008-chrome-comic.pdf -``` - -Here I was a bit lazy and used a GNU `ls` feature: `-v` for natural sorting of numbers (doesn't work for BSD `ls`). - -And here's page 1 of the comic as a teaser: - -![Google Chrome — Behind the Open Source Browser Project](https://i.imgur.com/W5pJTjl.jpg) diff --git a/source/blog/2014-12-19-app-suggestion-dropzone-3.md b/source/blog/2014-12-19-app-suggestion-dropzone-3.md deleted file mode 100644 index d2695d9a..00000000 --- a/source/blog/2014-12-19-app-suggestion-dropzone-3.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "App suggestion: Dropzone 3" -date: 2014-12-19T14:08:57-0800 -date_display: December 19, 2014 ---- - -I recently tried and purchased [Dropzone 3](https://aptonic.com/dropzone3/). See a list of features on the linked official website. In short, Dropzone 3 provides an intermediate zone for drag-n-drop. You can use it as a stash (called "Drop Bar" — stacking is available), use it as a shortcut by putting frequently used folders and applications there, or trigger actions by dropping. There are a dozen builtin actions and [an additional list of readily available actions](https://aptonic.com/dropzone3/actions/), covering common web drives, SNS and file sharing sites. **Better yet, you can develop your custom actions with the easy-to-use [Ruby API](https://github.com/aptonic/dropzone3-actions/blob/master/README.md#dzalerttitle-message).** For instance, I wrote a simple Google Translate action, `Google Translate.dzbundle` ([link](https://gist.github.com/zmwangx/b27f106a8ba47468a43d)), based on [translate-shell](https://github.com/soimort/translate-shell). (You know, it's Ruby, so calling external commands and concatenating strings feel at home, as if you are coding in Perl or directly in shell; unlike Python, where you at least need to `import subprocess` then `subprocess.check_output` to get the output of an external command, and have to use a bunch of stupid `+`'s to get your goddamn message to print.) - -Although I use the terminal for most tasks, drag-n-drop is still useful and convenient at times, not to mention the custom actions. (And the stock drag-n-drop is kinda hit-and-miss, especially for people like me who are mostly working with windows maximized — except terminal windows.) After using Dropzone 3 for a while, I found it well worth $4.99. - -Wait, I didn't mention the pricing? Dropzone 3 is only [$4.99 on MAS](https://itunes.apple.com/us/app/dropzone-3/id695406827?ls=1&mt=12), so get it while supplies last. (Somehow the license is $10 on the developer's online store, so definitely buy from MAS and change to the [unsandboxed version](https://aptonic.com/dropzone3/sandboxing.php) later — de-sandboxing is free.) There's also a 15-day free trial. diff --git a/source/blog/2014-12-22-10k-images-on-imgur.md b/source/blog/2014-12-22-10k-images-on-imgur.md deleted file mode 100644 index 19760764..00000000 --- a/source/blog/2014-12-22-10k-images-on-imgur.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "10k images on imgur" -date: 2014-12-22T12:42:16-0800 -date_display: December 22, 2014 ---- - -I happened to check my imgur account just now (haven't been to the web interface for ages), and you know what, I have uploaded 10,744 images since I created the account in February this year! (I've been using imgur for longer than that; previously I uploaded images anonymously.) Most of the 10k images were uploaded via scripts using the API. This again demonstrates the importance of a good API — without the imgur API I wouldn't have been able to upload hundreds of images with a few keystrokes all in a snap, and getting links would be a huge pain in the ass. There are myriad image hosting services out there, but imgur rules 'em all, thanks to its decent API (and also its good CDN and direct image links, of course). diff --git a/source/blog/2014-12-23-mpv-launcher.md b/source/blog/2014-12-23-mpv-launcher.md deleted file mode 100644 index 24741a5a..00000000 --- a/source/blog/2014-12-23-mpv-launcher.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "mpv launcher" -date: 2014-12-23T00:51:05-0800 -date_display: December 23, 2014 ---- - -**_04/06/2015 update:_** - -I just noticed that `daemonize` doesn't play too well with the OS; in particular, when you use dark menu bar on OS X Yosemite, apps launched with `daemonize` won't conform to that. So a native shell solution would be using `/bin/zsh` and run - -```zsh -mpv $@ &>/dev/null /usr/bin/ruby --version -ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14] -> /usr/local/bin/ruby --version -ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14] -> /usr/bin/ruby utf8-mac.rb -e1 84 8b e1 85 a6 e1 84 8b e1 85 b5 e1 84 91 e1 85 b5 e1 86 bc e1 84 8f e1 85 b3 -e1 84 8b e1 85 a6 e1 84 8b e1 85 b5 e1 84 91 e1 85 b5 e1 86 bc e1 84 8f e1 85 b3 -> /usr/local/bin/ruby utf8-mac.rb -e1 84 8b e1 85 a6 e1 84 8b e1 85 b5 e1 84 91 e1 85 b5 e1 86 bc e1 84 8f e1 85 b3 -ec 97 90 ec 9d b4 ed 95 91 ed 81 ac -``` - -As you can see, in the case of the system Ruby, NFD is left untouched. This leads to problems with, for instance, Google Translate. One obvious solution is to outsource the task to `iconv`, but I have the impression that outsourcing language features to shell commands is a generally despised practice. - -There's one more surprise. While `pry` with latest Rubies tend to handle Unicode very well (unlike `irb`), I tried `pry` with the current system Ruby, and it doesn't work; due to this annoying limitation, I couldn't even test the above problem interactively, and had to resort to a script. Maybe the problem can be resolved by compiling Ruby with `readline` or whatever; I didn't bother. The bottom line is, the system Ruby is not very pleasant for men in the 21st century — good Unicode support ought to be a must. (By the way, NFD in HFS+ is maddening. It breaks Terminal, iTerm, Google Translate, scp with Linux hosts, and the list goes on.) - -P.S. In Dropzone 3 custom actions you can select a custom Ruby with the `RubyPath` meta field, e.g., - -```ruby -# RubyPath: /usr/local/bin/ruby -``` diff --git a/source/blog/2015-01-10-fonts-why-chinese-web-design-is-hard.md b/source/blog/2015-01-10-fonts-why-chinese-web-design-is-hard.md deleted file mode 100644 index 41d84c57..00000000 --- a/source/blog/2015-01-10-fonts-why-chinese-web-design-is-hard.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Fonts: why Chinese web design is hard" -date: 2015-01-10T09:30:02-0800 -date_display: January 10, 2015 ---- - -For years I've been complaining about Chinese websites' horrendous designs. Yesterday I tried to translate one of my simple project websites to Chinese, and finally realized that web design for the Chinese language is no simple task — much harder than for English. The problem is fonts. This might not be the only problem (and cannot take blame for all the horrendous designs), but it certainly seems to be a roadblock. - -The problem with fonts boils down to the fact that the Chinese writing system has too many glyphs. I still remember learning things about the GB 2312 charset when I was twelve — there are 3755 Level 1 characters (more commonly seen), 3008 Level 2 characters, and other symbols and foreign glyphs. Designing more than six thousand Chinese characters is so much harder than designing 26 letters. I'm not sure if many glyphs are auto-generated from parts, but that would certainly degrade the quality. The result? Availability of digital fonts suffers. There are simply not so many choices of Chinese fonts. Chinese writing is beautiful, but I've yet to see a font for screens (let alone the web) that conveys that beauty. This might be subjective, but I have the impression that fonts generally look worse on screen than in print, and more so for Chinese fonts (Retina doesn't help much). For the record, I checked Apple's font usage at the moment, and they are using a tailored font named "PingHei" ("平黑", I guess; see screenshot at the end); I'm not at all impressed. Compare that to the English counterpart (also at the end) — not on the same level. (I won't talk about Microsoft since it doesn't feature a design department, or that department is brain dead. Well, I'm a little opinionated.) - -Another problem triggered by the vast number of glyphs is that font files are large. I looked at a dozen OTF fonts with SC or TC glyphs, and none seems to be below 10 MB. That's clearly a no go on the web — not until everyone has a gigabit connection, I suppose. I tried to Google for Chinese webfonts and had little success, so I'm not sure if woff helps. I've heard that Apple is able to pack a reduced set of PingHei glyphs into woffs less than 1 MB (keep in mind that PingHei being sans serif is simpler than serif fonts like Songti); that's pretty remarkable. I don't know much about font technologies so I can't comment more on this matter, but from my observation all Chinese websites (with the exception of apple.com/cn, I guess) rely on locally installed fonts, and most don't even have a list of fallbacks, i.e., typefaces simply aren't part of their designs. Even if they do have a list of fallbacks, they won't be able to guarantee uniform experience across the board (as far as I know, the lowest common denominator of Chinese fonts across all platforms seem to be zero). Apple has taught us that design must be integrated and perfected (well, Apple wasn't the first to do design, but they did bring it to the digital world and to the masses). Any fragmented design is doomed to fail. - -![A section of [apple.com/cn/iphone-6](https://www.apple.com/cn/iphone-6/).](https://i.imgur.com/MPmtSJI.png) - -![The English equivalent.](https://i.imgur.com/hBpdv0B.png) diff --git a/source/blog/2015-01-21-web-design-microsoft-vs-apple.md b/source/blog/2015-01-21-web-design-microsoft-vs-apple.md deleted file mode 100644 index de0ada46..00000000 --- a/source/blog/2015-01-21-web-design-microsoft-vs-apple.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Web design: Microsoft vs Apple" -date: 2015-01-21T16:30:51-0800 -date_display: January 21, 2015 ---- - -I just had a look at Ars's live blog on today's Windows 10 Event to acquire a sense of where Windows is heading. There's not much to report. Safari rip-off (Microsoft's new Spartan — wait, is this name also inspired by Safari? — features reading mode and offline reading list, Safari's killer features) aside, the focus seems to be virtual assistant, PC-tablet-phone integration, and gaming, none of which I'm interested in. The hologram thing does look cool, but putting the hype aside, I doubt if it will be really useful for the masses (except probably in gaming, one of my most despised applications of computing). I'm not a visionary so maybe I'm underestimating this. - -(Another interesting development is "Windows as a Service" — WaaS? Microsoft isn't communiating it effectively. If it means paid subscription, am I ever going to subscribe to an OS? No. If it instead means free system updates for the lifetime of a device, then this WaaS thing is just a vacuous buzz phrase — Apple has already been doing it for two years. Longer if you count the cheap upgrades. However, if free system updates is indeed the case, then what about VMs? Not sure.) - -The only thing I would like to see Apple copy from Microsoft is the unlimited OneDrive — come on, we already paid enough for our hardware, why can't we have unlimited cloud storage? I would even pay $10 per month for that — Microsoft is offering Office 365 along with unlimited cloud storage, all for just $10, so it certainly won't hurt Apple. The current iCloud pricing is ridiculous. - -All the discussions above are not the main point of this post though. The point is, I went to the Windows website to learn more about Windows 10, and just can't believe my eyes in how awful it is designed. Just look at the font and the layout of [windows.microsoft.com/en-us/windows-10/about](http://windows.microsoft.com/en-us/windows-10/about) (full web page screenshot courtesy of [web-capture.net](http://web-capture.net)). And compare that to [www.apple.com/osx/](http://www.apple.com/osx/) (scroll past the Windows screenshot). Holy crap, I even booted my Windows 8.1 VM just to make sure I'm not lacking the necessary fonts available on Windows. - -Why Microsoft's web design is so shitty is always beyond my grasp. For OS X, a potential customer would be eager to set his hands on it just by looking at its beautifully-crafted homepage and a few screenshots there. For Windows it's exactly the opposite. I mean, apart from metro apps (worst and ugliest desktop experience ever), modern Windows actually looks pretty good. But their shitty advertising totally ruins it. I guess it doesn't matter much for Microsoft, for all design-savvy folks who are not stuck on Windows are already using OS X, and most of their customers just need a commodity OS. - -![Full height screenshot of [windows.microsoft.com/en-us/windows-10/about](http://windows.microsoft.com/en-us/windows-10/about).](https://i.imgur.com/0eIt4SR.png) - -![Full height screenshot of [www.apple.com/osx/](http://www.apple.com/osx/).](https://i.imgur.com/piUO0xY.png) diff --git a/source/blog/2015-02-10-monitor-progress-of-your-unix-pipes-with-pv.md b/source/blog/2015-02-10-monitor-progress-of-your-unix-pipes-with-pv.md deleted file mode 100644 index 59c77a25..00000000 --- a/source/blog/2015-02-10-monitor-progress-of-your-unix-pipes-with-pv.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: "Monitor progress of your Unix pipes with pv" -date: 2015-02-10T02:18:30-0800 -date_display: February 10, 2015 ---- - -Recently I found a very useful utility called `pv` (for "pipe viewer"). [Here](http://www.ivarch.com/programs/pv.shtml) is its home page, and it can be easily installed with `brew`. According to its man page, - -> `pv` shows the progress of data through a pipeline by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA. - -For more info, see its home page (linked above) and [man page](http://linux.die.net/man/1/pv). - -Why is it useful? Well, pretty obvious if you are in the right audience. For me, one particularly important use case is with `openssl sha1`. I deal with videos on a daily basis, and back up all of them to OneDrive (ever since OneDrive went unlimited). To ensure integrity of transfer (in future downloads), I append the first seven digits of each video to its filename. This should be more than enough to reveal any error in transfer except for active attacks. One additional advantage is that I can now have multiple versions of a same show, event, or whatever and don't have to worry about naming conflicts (and don't have to artificially say `-ver1`, `-ver2`, etc.). This little merit turns out to be huge and saves me a lot of trouble, since naming things is intrinsically hard: - -> There are only three hard things concurrency, in computer science: cache invalidation, naming things, and off-by-one errors. - -(I learned this beefed up version of two hard things only recently.) Well, too much digression. So SHA-1 sum is useful. (By the way, I learned in my crypto class that SHA-1 is broken as a collision-resistant hash function — not HMAC, which doesn't assume collision-resistance — and SHA-256 should be used instead. However, I'm not protecting against active attacks — I won't be able to without a shared secret key anyway — so the faster SHA-1 is good for my purpose.) But at the same time, SHA-1 is slow. Maybe what's actually slow is my HDD. Whatever the bottleneck, generating a SHA-1 digest for a 10 GB video file isn't fun at all; it's even more of a torture when there's no progress bar and ETA. But hopelessly waiting has become a thing of the past with the advent (well, discovery in my case) of `pv`. Now I have nice and informative progress bars, which reduces the anxiety of waiting by an order of magnitude. - -For the record, here's the current version of my ruby script that attaches the first seven digits of the SHA-1 digests of the given files to their filenames: - -```ruby -#!/usr/bin/env ruby - -require 'fileutils' - -def rename(items) - num_items = items.length - num_done = 0 - items.each {|path| - printf($stderr, "%d/%d: %s\n", num_done + 1, num_items, File.basename(path)) - - if ! File.directory?(path) - extname = File.extname(path) - basename = File.basename(path, extname) - dirname = File.dirname(path) - sha1sum = `pv '#{path}' | openssl sha1` - new_basename = basename + "__" + sha1sum[0,7] - new_path = File.join(dirname, new_basename + extname) - FileUtils.mv(path, new_path) - else - STDERR.puts("#{path}: directory ignored") - end - - num_done += 1 - } -end - -rename(ARGV) -``` - -You might ask why I used ruby (littered with bash) when it's obviously a job for bash or perl. Well, the reason is that I first wrote this thing in ruby as a [Dropzone 3 action](https://gist.github.com/zmwangx/d6406fb8bf51ac768770). I'm lazy, so I just borrowed that script and modified its printout for shell use. - ---- - -By the way, I also found a project called `cv` (Coreutils Viewer), which is [officially described as](https://github.com/Xfennec/cv) - -> ... a Tiny, Dirty, Linux-Only C command that looks for coreutils basic commands (cp, mv, dd, tar, gzip/gunzip, cat, etc.) currently running on your system and displays the percentage of copied data. - -I'll look into it when I have time, but it from its description, it seems to be limited to coreutils, and OS X support might not be too awesome (at this point). diff --git a/source/blog/2015-02-17-microsoft-is-getting-cool-but-not-its-website.md b/source/blog/2015-02-17-microsoft-is-getting-cool-but-not-its-website.md deleted file mode 100644 index 3928e2df..00000000 --- a/source/blog/2015-02-17-microsoft-is-getting-cool-but-not-its-website.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Microsoft is getting cool (but not its website)" -date: 2015-02-17T18:57:19-0800 -date_display: February 17, 2015 ---- - -Microsoft is getting kind of cool. For instance, open sourcing .NET last year caused quite a buzz. Ars has a good piece about this: [Microsoft’s continuing efforts to be cool](http://arstechnica.com/information-technology/2015/02/microsofts-continuing-efforts-to-be-cool/). - -Three weeks ago Microsoft made another minor but totally unexpected move: they integrated AgileBits' `onepassword-app-extension` ([GitHub](https://github.com/AgileBits/onepassword-app-extension)) into the 5.0 release of the OneDrive iOS app. I didn't realize this until I read [yesterday's blog post on the OneDrive Blog](https://blog.onedrive.com/onedrive_secure_password/). This is really amazing when you put it in context: I mean, take a look at [Apps that love 1Password](https://blog.agilebits.com/1password-apps/), i.e., apps that have integrated that extension. Out of the ninety apps listed to date, there are only a dozen apps that I've heard of, and the only brands bigger than 1Password are Microsoft, Tumblr, Uber (infamous), and Walmart (what?). Microsoft embracing third party is surely an interesting phenomenon. - -Meanwhile, - -* Microsoft still won't let us use our password managers to its fullest (of course we can't blame it on the OneDrive folks): 16 characters max in this day and age (screenshot taken today)? Hmm. And I remember Microsoft recently said password length isn't the main source of vulnerability of its customers. WTF. Who cares about *your* stupid customers. I just want to protect *my own* data, and make sure that in case of a breach on *your* side, I won't face the same loss as your technologically illiterate customers. But that's not currently possible with Microsoft. - -![It's 2015, yet "your password can't be longer than 16 characters".](https://i.imgur.com/CNv76zw.png) - -* Microsoft's UI design is still shit, [as well as their website](/blog/2015-01-21-web-design-microsoft-vs-apple.html); I mean, seriously: - -![What the heck are those blue blocks?](https://i.imgur.com/wu66zZc.png) diff --git a/source/blog/2015-02-20-my-dock-and-updated-omnifocus.md b/source/blog/2015-02-20-my-dock-and-updated-omnifocus.md deleted file mode 100644 index ce022ab3..00000000 --- a/source/blog/2015-02-20-my-dock-and-updated-omnifocus.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "My dock and updated OmniFocus" -date: 2015-02-20T16:16:10-0800 -date_display: February 20, 2015 ---- - - -> Simplicity is the ultimate sophistication. - -Here's a screenshot of my dock at the moment. - -![My dock](https://i.imgur.com/EhaJw57.png "My current dock. Left to right: Finder (TotalFinder), Mail, Safari, Chrome, iTunes, OmniFocus, iTerm2, Activity Monitor, and mpv. Everything except mpv is persistent.") - -Left to right: Finder (TotalFinder), Mail, Safari, Chrome, iTunes, OmniFocus, iTerm2, Activity Monitor, and mpv. Everything except mpv is persistent; mpv is there because I happen to be looping a piece of music with mpv that I don't plan to add to the iTunes library. The point is that it never looked this good, mainly due to the updated OmniFocus icon. Finally they put some serious thought into graphics design! Just compare [the v2.1 icon](https://dl.bintray.com/zmwangx/generic/omnifocus-v2.1.icns) to [the v2.0 version](https://dl.bintray.com/zmwangx/generic/omnifocus-v2.0.icns). - -![OmniFocus Mac app icon, v2.0 vs v2.1](https://i.imgur.com/KeTz5wK.png) - -Obviously the overpolished (and honestly, badly polished) 2.0 one belongs to the past. It "stood out" even among Mavericks dock icons (in terms of color), not to mention among the flattened-down Yosemite ones. Today, it finally becomes a native member of the dock. (Well, actually not today — I've been using the beta for a while, so the new icon didn't come as a surprise.) In fact, this time the Omni Group seems to be on a graphics design streak these days, and today they have a really impressive App Store feature banner: - -![OmniFocus's MAS feature banner](https://i.imgur.com/tILmveQ.png) diff --git a/source/blog/2015-02-21-all-is-not-lost.md b/source/blog/2015-02-21-all-is-not-lost.md deleted file mode 100644 index 942965bc..00000000 --- a/source/blog/2015-02-21-all-is-not-lost.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "All is not lost" -date: 2015-02-21T17:12:32-0800 -date_display: February 21, 2015 ---- - -Lubos Motl always attacks the Many-Worlds Interpretation as if it is on the same level as anti-scientific claims. He even went on to attack Hugh Everett (the guy who first formulated this interpretation) personally; *ad hominem* is of course typical Motl shit, and I don't bother to find those posts. Anyway, here's yet another one: [Many worlds: a Rozali-Carroll exchange](http://motls.blogspot.com/2015/02/many-worlds-rozali-carroll-exchange.html). - -Disclaimer: I'm not really a proponent of Many-Worlds, at least not of the part of it that says history really *branches* into *many* worlds. Well, Lubos is at least right about one thing: "many worlds", taken literally, can't even be well-defined. However, I do believe that the world is can be described by a "universal wavefunction" (I prefer to call it the "universal state vector") in some gargantuan Hilbert space. And the universal state vector has to evolve deterministically. The reason is simple: **_all information is not lost_**. This principle is fundamental to physics and it's simply not on the same level as falsifiability, which is little more than a philosopher's toy and a nice thing to have. In quantum mechanics' terms, *unitarity must be respected*; this is why the Copenhagen Interpretation, or at least the wavefunction-collapsing part of it, cannot hold up to serious scrutiny — no operator can ever collapse the wavefunction and break unitarity. Those who hold the Copenhagen Interpretation are confusing *their* lack of knowledge (albeit a fundamental one, as they were entangled into the system when they make an observation) with the fundamental loss of information (which is not possible). - -One may question that if the universal state vector is *real*, then where's all the unavailable information stored (why is there a *fundamental* lack of knowledge)? Well, who told you that all information in this universe can be observed or written down? Everything outside our event horizon is also unavailable to us, yet modern physics knows for sure that some of those *do* exist. Of course we have a hierarchy of belief in the existence of different things, with the universal state vector being hard to believe (and very hard to not believe) or make sense of. But there's no hard cut, and we might some day be able to reason about it. - -I don't know how exactly the observed universe is the way it is (i.e., how exactly it fell — or "collapsed", which is a convenient word for communication — into the eigenstate that we observed). I'm not even sure if the observed universe is the way it is in the objective (ontological) sense — if there were no observers, would it just be an "uncollapsed" state vector? I suspect that this problem has something to do with consciousness, and I suspect that we are at least hundreds of years from understanding consciousness. (Of course this kind of predictions are all nonsense — no one can look thirty years into the future). At the very least, we may eliminate some possibilities when we know more about consciousness. At any rate, this is an interesting problem that might be outside the capability of human reason, or might not. One may hate it and refuse to talk about it, but one cannot dismiss it as unphysical. - -When Lubos dismisses *ontology* as "exactly the same thing" as classical physics, he's dismissing the problem above, and making a hard compromise. He's basically saying that we cannot and should not reason about anything outside of what we can observe (this is also a crude classification because obviously he reasons beyond black hole horizons every day). This compromise is very dangerous for physics — sometimes one has to reason beyond one's horizon to formulate a complete and consistent answer. Black holes are one good example of getting of the limit. If we can extend spacetime beyond our event horizon, then why can't we accept **_the possibility of existence_** outside our "existence horizon", i.e., outside our perceived existence of the universal (and the first hand experience of our own existence inside it)? It's a wild and not well-defined idea, but all new physics starts out not well-defined. - -I still remember the last lecture of my first quantum mechanics course in my freshman year, taught by Prof. Michael Peskin. He discussed the interpretations of quantum mechanics. I forgot the exact arguments, but after rejecting other interpretations (including Copenhagen and hidden variable), he resorted to Many-Worlds, citing "Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth." I was not particularly satisfied. To me, once you eliminate the impossible, if whatever remains is still improbable, then maybe your imagination is not wild enough. I also remember the second time I took QM I, this time the graduate version, taught by Prof. Lenny Susskind. He stressed unitarity so much and showed us how wavefunction-collapsing is unnecessary (it was never well-defined anyway, unless you impose it). Unitarity is so important that triggered his "black hole war". - -The point of mentioning my two professors is that the interpretation problem of quantum mechanics has never been settled, and people who hold opinions contrary to Copenhagen should be respected. Lubos, on the other hand, tries to convince people that this problem has been settled, and actually settled for ninety years. He is either lying or delusional himself. diff --git a/source/blog/2015-02-24-the-new-onedrive-api.md b/source/blog/2015-02-24-the-new-onedrive-api.md deleted file mode 100644 index ba185ff0..00000000 --- a/source/blog/2015-02-24-the-new-onedrive-api.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "The new OneDrive API" -date: 2015-02-24T18:31:19-0800 -date_display: February 24, 2015 ---- - -Microsoft released the new OneDrive API today. See the blog post announcement [here](https://blog.onedrive.com/the-new-onedrive-api/). One highlight is that [large file upload](http://onedrive.github.io/items/upload_large_files.htm) is now officially supported. Previously, large file upload was handled with a semi-official API using the BITS protocol; the only documentation was a [gist](https://gist.github.com/rgregg/37ba8929768a62131e85). Now it is handled through standard HTTP `POST`. With this major release, there's likely a lot of work to be done with [python-onedrive](https://github.com/mk-fg/python-onedrive). I have opened an issue: [mk-fg/python-onedrive#52 — New OneDrive API support](https://github.com/mk-fg/python-onedrive/issues/52). - -Interestingly, the new OneDrive API doc is hosted on GitHub Pages — [onedrive.github.io](http://onedrive.github.io), rather than MSDN. Exactly a week ago I wrote a piece, "[Microsoft is getting cool (but not its website)](/blog/2015-02-17-microsoft-is-getting-cool-but-not-its-website.html)". Looks like they are doing something about their website (or better put, their online identity), too. diff --git a/source/blog/2015-03-22-back-up-os-x-app-icons.md b/source/blog/2015-03-22-back-up-os-x-app-icons.md deleted file mode 100644 index 0ec91559..00000000 --- a/source/blog/2015-03-22-back-up-os-x-app-icons.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: "Back up OS X app icons" -date: 2015-03-22T16:58:50-0700 -date_display: March 22, 2015 ---- - -OS X application icons are valuable assets, and it's interesting to see how they evolve over time. This is especially the case when we upgraded to OS X 10.10 Yosemite, when Apple and many design-aware third party developers overhauled (mainly flattened) their icons. - -However, we lose all the old icons when we do a major OS upgrade. Technically they still live in Time Machine backups, but those are a pain to pull out. Therefore, I wrote a script just now to back up app icons of all applications living in `/Applications` (including those symlinked to `/Applications`, e.g., apps installed through `brew cask`) and its level-one subdirectories, and `/System/Library/CoreServices` (for `Finder.app` and such). Here's the script: - -```bash -#!/usr/bin/env bash -function app_version -{ - # $1 is the path to the app - /usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" "$1"/Contents/Info.plist 2>/dev/null || date +%Y%m%d -} - -function app_icon_path -{ - # $1 is the path to the app - filename=$(/usr/libexec/PlistBuddy -c "print CFBundleIconFile" "$1"/Contents/Info.plist 2>/dev/null) - [[ -n ${filename} ]] || return - filename=$(basename "${filename}" .icns) - echo "$1/Contents/Resources/${filename}.icns" -} - -function process_app -{ - # $1 is the path to the app - name=$(basename "$1" .app | tr -d ' ') - path=$(realpath -e "$1") || { echo "${RED}error: broken link '${path}'${RESET}" >&2; return 1; } - version=$(app_version "${path}") - icon_path=$(app_icon_path "${path}") - [[ -n ${icon_path} ]] || { echo "${YELLOW}warning: '$1' has no app icon${RESET}"; return 1; } - [[ -f ${icon_path} ]] || { echo "${RED}error: '${icon_path}' does not exist${RESET}" >&2; return 1; } - cp "${icon_path}" "${name}-${version}.icns" - echo "${name}-${version}.icns" -} - -find /Applications -maxdepth 2 -name '*.app' | while read app; do process_app "${app}"; done -find /System/Library/CoreServices -maxdepth 1 -name '*.app' | while read app; do process_app "${app}"; done -``` - -The script is also available as a [gist](https://gist.github.com/zmwangx/fad97e085045a21ebc1d). diff --git a/source/blog/2015-04-26-using-python-3-with-emacs-jedi.md b/source/blog/2015-04-26-using-python-3-with-emacs-jedi.md deleted file mode 100644 index c84cf0d5..00000000 --- a/source/blog/2015-04-26-using-python-3-with-emacs-jedi.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "Using Python 3 with Emacs Jedi" -date: 2015-04-26T21:19:14-0700 -date_display: April 26, 2015 ---- - -Recently I'm working on [a hobby project in Python](https://github.com/zmwangx/storyboard), which means editing Python source files a lot. I've been using [Emacs Jedi](https://github.com/tkf/emacs-jedi) for almost as long as I've been writing Python, and it has been pretty helpful at completing away long names. - -However, Jedi uses `python` by default, which means `python2` on most of our systems at this point. Occasionally I'm writing Python 3 specific code but Jedi completes to Python 2 or refuses to complete; for the record, I enjoy writing and debugging Python 3.3+ much better than 2.7 (I realized this after trying to create a code base that is backward compatible with 2.7, which means reinventing the wheel or introducing annoying branches from time to time). So naturally I'm looking into using Python 3 in Jedi. - -The [official docs](https://tkf.github.io/emacs-jedi/latest/#how-to-use-python-3-or-any-other-specific-version-of-python) has been confusing and unhelpful at least for me, since it insists on setting up the virtualenv from within Emacs, and it failed for me. Why can't I set up the virtualenv myself? Turns out I can, and it's incredibly simple. The commands below assume that you have installed Jedi and friends (well, dependencies) using `package.el`. - -```bash -mkdir -p ~/.emacs.d/.python-environments -virtualenv -p /usr/local/bin/python3 ~/.emacs.d/.python-environments/jedi # or whatever your python3 path is -# If you feel like installing the server with 'M-x jedi:install-server', also do the following -~/.emacs.d/.python-environments/jedi/bin/pip install --upgrade ~/.emacs.d/elpa/jedi-20150109.2230/ # you might need to change the version number -``` - -And that's it. Put the following in your `~/.emacs`: - -```commonlisp -(add-hook 'python-mode-hook 'jedi:setup) -(setq jedi:complete-on-dot t) -(setq jedi:environment-root "jedi") -``` - -where the first two lines should be there whether you want to use Python 3 or not — so only the third line is new, and its meaning is obvious. - -At last, start Emacs and do `M-x jedi:install-server` if you haven't run the `pip` command above yet. Restart Emacs (if necessary). That's it. Enjoy your Jedi with Python 3. (Type `import conf`, for instance, to be convinced that you're really autocompleting Python 3). diff --git a/source/blog/2015-05-03-why-oh-my-zsh-is-completely-broken.md b/source/blog/2015-05-03-why-oh-my-zsh-is-completely-broken.md deleted file mode 100644 index cb76693e..00000000 --- a/source/blog/2015-05-03-why-oh-my-zsh-is-completely-broken.md +++ /dev/null @@ -1,177 +0,0 @@ ---- -title: "Why Oh My Zsh is completely broken" -date: 2015-05-03T17:15:49-0700 -date_display: May 3, 2015 ---- - -Today I moved from [Oh My Zsh](https://github.com/robbyrussell/oh-my-zsh) to [Prezto](https://github.com/sorin-ionescu/prezto), after using Oh My Zsh for about three years since 2012. I'll try to shed some light on the reasons in this post. - -Zsh is a rather complicated shell (compared to Bash), with a hell lot of builtins and a complex completion system. The complexity makes it powerful, but also makes it intimidating to mortals; moreover, it doesn't look as sweet as it could be out of box. Most mortals, me included, want an interactive shell that's sweet and "just works", so we need wizards to guide us in configuring this beast. Oh My Zsh and Prezto are just two of such configuration frameworks. Oh My Zsh is somewhat older: the first commit of Oh My Zsh dates back to [August 2009](https://github.com/robbyrussell/oh-my-zsh/commit/e20401e04e057a39c228dbb99dda68ec7fa4235a), while Prezto was forked from Oh My Zsh in [February 2011](https://github.com/sorin-ionescu/prezto/commit/8d487d4f6c2d38cb108d7c8c0c2de9f0385da402), and has since been completely rewritten. `robbyrussell/oh-my-zsh` as of today has 23,610 stars on GitHub, while `sorin-ionescu/prezto` has 4,069. This doesn't imply Oh My Zsh is any better — I guess the fancy name of Oh My Zsh earned it a lot more undeserved stars; you'll see why soon. - -I was hardly involved in Oh My Zsh development, and I haven't even carefully inspected Oh My Zsh's source code until yesterday, so my soon-to-come complaints about Oh My Zsh might not be completely true. But here it is: **Oh My Zsh brings the worst of community-driven development, where the "community" knows not of what it is doing, and just wants to get things done in the sloppiest way possible.** Let's look at some examples. All discussions are based on [`1400346`](https://github.com/robbyrussell/oh-my-zsh/commit/140034605edd0f72c548685d39e49687a44c1b23), the latest commit at the time of writing. - -## The core lib hodgepodge - -First, look at Oh My Zsh's core [lib](https://github.com/robbyrussell/oh-my-zsh/tree/140034605edd0f72c548685d39e49687a44c1b23/lib): - -```zsh -> ls lib -bzr.zsh directories.zsh grep.zsh misc.zsh spectrum.zsh -completion.zsh functions.zsh history.zsh nvm.zsh termsupport.zsh -correction.zsh git.zsh key-bindings.zsh prompt_info_functions.zsh theme-and-appearance.zsh -``` - -Wait, why do I see `bzr.zsh`, `git.zsh`, and even `nvm.zsh` in the core lib? Why are all of these mandatory (all files in `lib` are sourced from `oh-my-zsh.sh`)? Why should I load `bzr.sh` and `nvm.zsh` when I don't use Bazaar or NVM at all?[^bazaar] Moreover, since we already have `bzr.sh`, `git.zsh` and `nvm.zsh` in the core library, why don't we also have `hg.zsh`, `rvm.zsh`, `svn.zsh` and `virtualenv.zsh`, just to name a few? - -[^bazaar]: This is not entirely true. I use [git-remote-bzr](https://github.com/felipec/git-remote-bzr) when I have to clone a Bazaar repo for some reason. - -I suppose these marginal scripts are in the core because they define functions (`bzr_prompt_info`, `git_prompt_info`, `nvm_prompt_info`, etc.) that are called from many themes; well, at least this is the case for `git.zsh`. But that doesn't answer any of the questions above. **The underlying question is: why aren't they simply plugins?**[^plugins] Loading a plugin in Oh My Zsh isn't sophiscated at all (compared to Prezto; see discussion below), just annoying to type in full, which [boils down to](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/oh-my-zsh.sh#L68-L72): - -```zsh -if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then - source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh -elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then - source $ZSH/plugins/$plugin/$plugin.plugin.zsh -fi -``` - -where `$plugin` is the name of the plugin. They can easily wrap this in a function and let theme authors painlessly load plugins,[^pollution] but they just don't. Also, the consistency issue (think of my question about `hg`, `rvm`, `svn` and `virtualenv`) is beyond my grasp. The only way I could make sense of this situation is that all the mess was created by clueless community contributions that didn't think about the code base as a whole (the code base is small!), and maintainers didn't care either. - -[^plugins]: Note that outside the core, there are additional plugins for `git` and `nvm`. Oh well. -[^pollution]: Whether aliases defined in a plugin (e.g. for `git`) should be loaded can be easily controlled via a switch. - -Meanwhile, Prezto does it right. Prezto is highly modular, with the `pmodload` function defined in [`init.zsh`](https://github.com/sorin-ionescu/prezto/blob/08676a273eba1781ddcb63c4f89cfff9bd62eac4/init.zsh) to load modules (doing things like sourcing module init scripts and marking module functions for autoloading). That's about the entirety of Prezto's core; everything else are in optional [modules](https://github.com/sorin-ionescu/prezto/blob/08676a273eba1781ddcb63c4f89cfff9bd62eac4/modules), including essential configs like `editor` (ZLE configs), `completion`, and `prompt`. Note that module loading order matters in some cases, but still, working with Prezto's modular structure is a joy. Apart from `init.zsh` and the `modules` directory, the Prezto repo does contain one other [`runcoms`](https://github.com/sorin-ionescu/prezto/tree/08676a273eba1781ddcb63c4f89cfff9bd62eac4/runcoms) directory with rc files, but those are just recommendations that one may safely ignore. In fact, there are a total of eight lines related to Prezto in my `.zshrc`, and nowhere else (note that I only switched to Prezto today, so this freshly baked `.zshrc` is subject to change): - -```zsh -# prezto -zstyle ':prezto:*:*' color 'yes' -zstyle ':prezto:environment:termcap' color 'no' # disable coloring of less, which looks horrible -zstyle ':prezto:load' pmodule environment editor history directory utility colors spectrum git completion prompt ruby -zstyle ':prezto:module:editor' key-bindings 'emacs' -zstyle ':prezto:module:prompt' theme 'zmwangx' -[[ "$OSTYPE" == darwin* ]] && export BROWSER='open' -source ~/.zprezto/init.zsh -``` - -Here `zmwangx` is my [personal theme](https://github.com/zmwangx/prezto/blob/master/modules/prompt/functions/prompt_zmwangx_setup) that looks like [this](https://i.imgur.com/nCBK8ZB.png). - -## Incredibly poor code quality - -Oh My Zsh's code quality is incredibly poor. Even within the core library. Pick any file from `lib/`, and you'll be amazed by the hot mess in front of your eyes. There's no coding standard whatsoever: - -* You can find four-space indents and two-space indents mixed [in the same file](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/lib/functions.zsh); -* You can find function definitions with the `function` keyword and without [in the same file](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/lib/git.zsh); -* You can find [167-character-long lines](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/lib/functions.zsh#L2) mixed with early-broken lines (yes, sometimes [in the same file](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/lib/git.zsh#L69)); -* You can find completely commented out blocks of code [in the core lib](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/lib/key-bindings.zsh#L70-L87), where the average user is not supposed to touch; - -I guess the list could go on; I didn't spend more time inspecting this crap. - -We were discussing styles, but obviously style isn't the only problem with this code base. Next onto a case study of how Oh My Zsh does something in the most inefficient way possible. Let's have a look at [`git.zsh`](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/lib/git.zsh). It suffers from almost all problems we have talked about so far, but let's focus specifically on [the `git_prompt_status` function](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/lib/git.zsh#L78-L122): - -```zsh -git_prompt_status() { - INDEX=$(command git status --porcelain -b 2> /dev/null) - STATUS="" - if $(echo "$INDEX" | command grep -E '^\?\? ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS" - fi - if $(echo "$INDEX" | grep '^A ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS" - elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS" - fi - if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS" - fi - if $(echo "$INDEX" | grep '^R ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS" - fi - if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" - elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" - elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS" - fi - if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then - STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS" - fi - if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS" - fi - if $(echo "$INDEX" | grep '^## .*ahead' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS" - fi - if $(echo "$INDEX" | grep '^## .*behind' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS" - fi - if $(echo "$INDEX" | grep '^## .*diverged' &> /dev/null); then - STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS" - fi - echo $STATUS -} -``` - -**This one single function intended to be invoked from a precmd hook (basically executed every time the prompt is printed), calls `grep` a staggering 14 times inside command substitutions, forking the process 28 times — while all the greps can be replaced with pattern/regex matching right within the shell.** (Keep in mind that forking is the most expensive operation of the shell.) For instance, - -```zsh -$(echo "$INDEX" | grep '^A ' &> /dev/null) -``` - -may well be replaced with - -```zsh -[[ $INDEX == *$'\nA '* ]] -``` - -or - -```zsh -[[ $INDEX =~ $'\nA ' ]] -``` - -(Note that the `git status --porcelain -b` call always prints the branch info such as `## master...origin/master` in the first line, so "A ", if present at the beginning of any line, must be preceded by a newline; that's why the above works.) All other grep calls can be similarly replaced with pattern/regex matching. No forking. - -By the way, whoever wrote this function seems to be unaware of the `-q,--quite,--silent` switch of `grep` (which should be available in all implementations), and every call is littered with `&> /dev/null`. In fact, using the `-q` switch is even (slightly) faster: a reasonable implementation of `-q` exits immediately when a match is found, while what is written here waits until all input is processed. - -I haven't exhausted the problems with this function just yet. As a bonus: despite being awfully inefficient, **this function *can't even be used* in many cases for which it is designed.** You might have noticed that the order of different status bits is completely fixed by whoever wrote this function (by the way, all those `$ZSH_THEME_GIT_PROMPT_*` variables are documented nowhere, so one who wants to write a theme has to dig into the source — only to find the function useless except for polluting the namespace). If one wants to use a different order, or put some of the bits in `RPROMPT`, one has to roll his own (or good luck parsing the output of `git_prompt_status`). In fact, even a [dumbed down function `git_prompt_info`](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/lib/git.zsh#L2-L8), which only prints the branch name and whether it's dirty, is similarly uncustomizable; [the `gallois` theme](https://github.com/robbyrussell/oh-my-zsh/blob/140034605edd0f72c548685d39e49687a44c1b23/themes/gallois.zsh-theme), my first theme and on which I later based my own theme, needs to define a `git_custom_status` function to achieve what it needs — otherwise something as simple as adding a pair of brackets around the branch name is super painful. - -One might wonder how Prezto solves the same problem. The answer is in [`modules/git/functions/git-info`](https://github.com/sorin-ionescu/prezto/blob/08676a273eba1781ddcb63c4f89cfff9bd62eac4/modules/git/functions/git-info). The `git-info` function does more, and again in a highly modular way (without grep calls, for God's sake): status bits or their combinations are [formatted on demand with `zformat` and stored in an associative array `git_info`](https://github.com/sorin-ionescu/prezto/blob/08676a273eba1781ddcb63c4f89cfff9bd62eac4/modules/git/functions/git-info#L393-L416), where users specify format strings via `zstyle` with [thoroughly documented escape sequences](https://github.com/sorin-ionescu/prezto/tree/08676a273eba1781ddcb63c4f89cfff9bd62eac4/modules/git#theming). Very beautiful solution. - -## The completely broken community contribution process - -I'm not sure if the project maintainers are Zsh wizards (I'm afraid not). I'll just assume that most of the code with incredibly poor quality came from community contribution. Okay, community. But even the community contribution process is completely broken. - -At the time of writing there are 159 open issues and 446 open pull requests in `robbyrussell/oh-my-zsh` (the stats are 13/35 in `sorin-ionescu/prezto` — not proportional to the number of stars or forks). There's even [a PR called "Easy-to-Merge"](https://github.com/robbyrussell/oh-my-zsh/pull/3809) that is said to collect PRs that are either extremely simple fixes or have been discussed–tested–and–signed-off (wait, then why aren't they already merged?). This makes it almost impossible to open new, substantial PRs (such as a complete rewrite of the `git_prompt_status` criticized above) — God knows whether other people have already proposed the same fix, or a different fix for the same problem, whether it's been discussed–tested–and–signed-off, and how much discussion will be needed for a new PR. - -You might infer from the above that the actually merged PRs are discussed–tested–and–signed-off. Well, of course not (think about the code quality), and here's one more case study. - -The only time I [submitted a PR](https://github.com/robbyrussell/oh-my-zsh/pull/3591) is when [a previous PR](https://github.com/robbyrussell/oh-my-zsh/pull/3564) broke aliases of the `ls` family, which most of us run tens to hundreds of times every day. The `-h` option was stripped from all aliases but one (which was ridiculous since the option seemed to be lost during copy/paste), and anyone who used the affected aliases regularly and lived with the PR for ten minutes should notice. Apparently nobody looked at the diffs before merging, or nobody cared (before I and one other guy jumped in). My PR was merged three days later; the delay was okay. - -[In another instance](https://github.com/robbyrussell/oh-my-zsh/pull/3341), the delay was totally unbearable. [grep 2.21](https://savannah.gnu.org/forum/forum.php?forum_id=8152) was released on November 23, 2014, and it deprecated `GREP_OPTIONS`. Oh My Zsh was using `GREP_OPTIONS` back then, so anyone who upgraded to grep 2.21 and used grep regularly was getting a lot of deprecation warnings (oh, before you ask, `grep.zsh` is in the core lib). Core lib stuff spitting deprecation warnings on all platforms all the time is a pretty big thing, right? There were multiple ways to fix this problem, all of them trivial to the reasonably trained eyes; and they won't break user scripts, unless someone was doing something insane in the first place (like relying on exported `GREP_OPTIONS` for certain behaviors in a script). However, there were quite a bit of discussion spanning multiple issues and PRs (most notably [this one](https://github.com/robbyrussell/oh-my-zsh/pull/3341)), and despite all the discussions, not a single maintainer or collaborator joined or showed any interest. [A fix was merged not until December 14, 2014](https://github.com/robbyrussell/oh-my-zsh/pull/3403). Of course there were temporary fixes (remember, the issue was trivial to begin with), but the problem must have been confusing to the less-proficient Zsh users during the twenty day window. - -## Easter egg - -One more thing, among countless other problems: the recommended way to install Oh My Zsh is either - -```zsh -curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh -``` - -or - -```zsh -wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh -``` - -Cool, huh? How many of you have the `--no-check-certificate` option of `wget` automatically turned on? Thankfully there's no `sudo` in front. - -## Summary - -Oh My Zsh was a great idea when it took off. Over the years however, through low-quality community contributions from people who barely understand Zsh (and shell scripting idioms and best practices in general), it evolved into a beast that no one except the maintainers could fix or seriously contribute to; yet the maintainers seem to be pretty satisfied with it. - -Therefore, I'm moving to Prezto, the project with far better modularity and code quality. In fact, this rant all began from yesterday, when I was about to embark on a stripped down Zsh configuration system for myself. I was thinking about borrowing code from both Oh My Zsh and Prezto; but after reading some code from both projects, I soon realized that Oh My Zsh is totally crap and Prezto can be taken almost unmodified. I hope that more people will take a look at Prezto, realize how awesome it is (especially in comparison to the famed Oh My Zsh), fork it, and possibly submit patches. diff --git a/source/blog/2015-05-05-graceful-handling-of-sigint-when-using-pythons-multiprocessingprocess.md b/source/blog/2015-05-05-graceful-handling-of-sigint-when-using-pythons-multiprocessingprocess.md deleted file mode 100644 index 6e6037a4..00000000 --- a/source/blog/2015-05-05-graceful-handling-of-sigint-when-using-pythons-multiprocessingprocess.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: "Graceful handling of SIGINT when using Python's multiprocessing.Process" -date: 2015-05-05T22:03:39-07:00 -date_display: May 5, 2015 ---- - -Today I learned something about Python's (at least CPython's) multiprocessing and signal handling, and I would like to share it here. Basically my situation was such (when developing [`pydoc`](https://github.com/zmwangx/zmwangx.github.io/blob/source/pyblog) that powers this blog): - -* I would like to serve the blog with an HTTP server while auto-regenerating for changes; -* The auto-regeneration is handled in the main process with a while loop, whereas the HTTP server (requiring little human intervention) is put in a `multiprocessing.Process` and launched with `http.server.HTTPServer.serve_forever()`; -* Upon sending `SIGINT`, both processes need to clean up and quit; in particular, the server needs to exit its `serve_forever()` loop (which can be done via `shutdown()`, but how to invoke the method is a problem, since `serve_forever()` blocks); -* Handling of `SIGINT` must be graceful in the main process — there might be an ongoing build that must not be interrupted until finishing. - -Given this context, I learned the following two critical concepts (at least true in the current version of CPython) through trial and error: - -1. **A user-triggered `SIGINT` is sent to both processes** — the main process and the `multiprocessing.Process` instance; -2. **Except for the defined interfaces, a `multiprocessing.Process` instance is almost completely separated from the main process, sharing as little resources as possible**; by "defined interfaces" I mean the defined attributes and methods of a `Process` instance, as well as defined communication channels like `multiprocessing.Pipe` or `multiprocessing.Queue`. And to expand on resource sharing: yes, the two processes have their own copies of global variables, so using global variables as state registers is a no-go. - -Both concepts can be used to one's benefit or detriment. Below is how I solved my problem, using the two concepts. Observe that without a custom handler, Python translates a `SIGINT` to a `KeyboardInterrupt` exception; therefore, I use the default `KeyboardInterrupt` to interrupt the HTTP server in its own process (through handling the exception and calling `shutdown()`), but instead install a custom `SIGINT` handler in the main process that translates `SIGINT` to setting a `sigint_raised` flag that can be picked up by the while loop once the current build (if any) is finished. The proof of concept script is as follows (the production code is [here](https://github.com/zmwangx/zmwangx.github.io/blob/a7a0b2073f30b1d0214c3152998d95e40a39b438/pyblog#L567-L635)): - -```python -#!/usr/bin/env python3 - -import http.server -import multiprocessing -import signal -import sys -import time - -class HTTPServerProcess(multiprocessing.Process): - def run(self): - httpd = http.server.HTTPServer( - ("", 8000), http.server.SimpleHTTPRequestHandler) - try: - httpd.serve_forever() - except KeyboardInterrupt: - httpd.shutdown() - -def do_things(): - for i in range(10): - sys.stderr.write(".") - sys.stderr.flush() - time.sleep(1) - sys.stderr.write("\n") - -def main(): - server_process = HTTPServerProcess() - server_process.start() - - # define and install custom SIGINT handler - sigint_raised = False - - def sigint_mitigator(signum, frame): - nonlocal sigint_raised - sigint_raised = True - - signal.signal(signal.SIGINT, sigint_mitigator) - - while not sigint_raised: - do_things() - - server_process.join() - -if __name__ == "__main__": - main() -``` - -Beware that with this solution, if there are external programs or OS level operations happening in the main process, then the operation at the time of `SIGINT` will still be interrupted[^OS-specific] (for example, in the script above, the `time.sleep(1)` at the exact point of `SIGINT` is still interrupted, but otherwise `do_things` is carried on to its completion). I'm not sure how to explain this — maybe the handler isn't capturing the signal fast enough?[^naive] Anyway, one single early interruption is at least more acceptable than a completely corrupted build[^interruption], and certainly more graceful. - -[^naive]: That's awfully naive and layman-sounding, I know, but I *am* almost a layman when it comes to system-level programming. - -[^OS-specific]: [CPython's `multiprocessing` is written in C](https://hg.python.org/cpython/file/1320ec1b24af/Modules/_multiprocessing), so the behavior might depend on the OS. I'm talking about OS X here. I haven't inspected and won't inspect the C source code. - -[^interruption]: That's assuming your build isn't interdependent in which any single failure corrupts everything. In that case, what can we do? I honestly see no way of injecting signal handling in `subprocess.Popen`. diff --git a/source/blog/2015-05-05-new-blog-new-start.md b/source/blog/2015-05-05-new-blog-new-start.md deleted file mode 100644 index 580d33c0..00000000 --- a/source/blog/2015-05-05-new-blog-new-start.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: "New blog, new start" -date: 2015-05-05T02:42:44-07:00 -date_display: May 5, 2015 ---- - -Octopress has been serving me for the past six months, during which even Octopress itself underwent major changes — in fact, [Octopress 3.0.0](https://github.com/octopress/octopress/releases/tag/v3.0.0) was only released 3 days ago, which I never got to try. Anyway, Octopress's heavily colored interface grew old on me fairly quickly. I'm especially unhappy with the inline `` tag, which is always wrapped in a white box and stands out too much (worse still, there's no visual difference when such a `` tag is placed inside an `` tag). Since I use inline code/verbatim a lot, many of my articles were littered with arbitrary boxes everywhere. - -![Farewell, Octopress.](https://i.imgur.com/hxfSnOk.png) - -Apparently I need something simpler. Because - -> Simplicity is the ultimate sophistication. - -But how? Simiplicity 101: get rid of the "platform". There's no reason why I need a blogging platform like Jekyll (let alone the WordPress monster). When I initially switched to Octopress, I thought code highlighting was something fancy that I need heavy machinery to achieve, but it turned out that Pandoc is battery-included when it comes to syntax highting,[^pandoc] so all I need is to specify a highlight style, e.g., Pygments: - -[^pandoc]: Well, Pandoc is heavy-machinery, but it's both generic and self-contained, unlike a specialized blogging platform. - -``` -pandoc input.md --highlight-style=pygments --template template.html --output output.html -``` - -That's it. Write the Markdown, compile with Pandoc, instantly awesome. So the HTML posts are there (assuming the HTML template is written, which is not hard to kick off). - -The rest of the job is to design the stylesheets and compile the posts into a coherent blog — basically, generate an index. I was able to realize both in several hours. For the former task, I borrowed a lot from [mort.ninja](http://mort.ninja/) by [Mort Yao](https://github.com/soimort). Interestingly, we were born in the same city (Nanjing, China), and I benefit from at least two of his open source projects: [you-get](https://github.com/soimort/you-get) and [translate-shell](https://github.com/soimort/translate-shell). The latter task is more interesting but also not hard. I'm rolling my own toolchain in Python, which you can find in [`pyblog`](https://github.com/zmwangx/zmwangx.github.io/blob/source/pyblog). In fact, the complete source of this blog (down to how image assets are generated) are in the [`source` branch](https://github.com/zmwangx/zmwangx.github.io/tree/source) of my GitHub Pages repo, so you may take a look if you're interested. `pyblog` is highly specialized[^pyblog] and is still a work in progress at the time of writing, but it's already well capable of generating the blog — currently missing are auto gen-deploy and preview (with auto-update), which will also come soon. - -[^pyblog]: Which is fine since I don't expect anyone else to use it, anyway. - -By the way, the most annoying thing in the development process was working with XML and generating [the Atom feed](/atom.xml). Standard library `xml.etree.ElementTree` doesn't support the `![CDATA[` tag, and in the end I had to hack [library internals](https://github.com/zmwangx/zmwangx.github.io/blob/source/pyblog#L34-L54), which is likely to break in future versions. Remember the quotes? - -> XML is a classic political compromise: it balances the needs of man and machine by being equally unreadable to both. - -> XML combines the efficiency of text files with the readability of binary files. - -Sigh. - -Anyway, here is my new shiny blog. - -![Welcome to the completely revamped dl? cmplnts?](https://i.imgur.com/VS5f9eJ.png) - -It looks ten times better than Octopress, and ever builds much faster than Octopress[^speed]. As a bonus, the codebase is so small that it's super trivial to hack (no, not *that* hack). - -[^speed]: I have the impression that a complete build of all posts (about fifty of them) with `pyblog` is faster than regenerating for a single modified post in Octopress. That's in the context of absolutely no categories; when you have a dozen or more categories, Octopress slows down to a halt. diff --git a/source/blog/2015-05-06-searchable-settings-are-one-honking-great-idea-lets-do-more-of-those.md b/source/blog/2015-05-06-searchable-settings-are-one-honking-great-idea-lets-do-more-of-those.md deleted file mode 100644 index a2f30cd4..00000000 --- a/source/blog/2015-05-06-searchable-settings-are-one-honking-great-idea-lets-do-more-of-those.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: "Searchable settings are one honking great idea — let's do more of those!" -date: 2015-05-06T19:29:46-07:00 -date_display: May 6, 2015 ---- - -I had to tweak some iOS settings just now, which wasn't a delightful experience. Since I just renovated my blog inside out and am still in the hype mode, I'll write a post on the interface design of settings or preferences. - -The Zen of Python says, - -> Namespaces are one honking great idea -- let's do more of those! - -Namespaces are in general great stuff for sure, and I love them a lot.[^NSHell] But they are not so great when badly designed. One problem is that sometimes things belong to the unexpected namespace. There are already examples in Python's STL, e.g., `os.remove` and `shutil.rmtree` — for Unix guys they're just `rm` and `rm -r`, but in Python they live in two separate universes namespaces. The other problem is that if one takes namespaces too far and design several levels of nested namespaces, then either the names are super long and annoying to use, or one needs to leave out part of the hierarchy with `from .. import ..`, defeating the security of namespaces and making code harder to understand locally. - -[^NSHell]: Thinking about [`NSHell`](http://nshipster.com/namespacing/) and the like kinda creeps me out, although there are quite some reasonable pro-class prefix arguments. - -When designing an interface for settings or preferences, there are also "namespaces", or sections (and subsections), although sections are more about grouping preferences by kind than about avoiding name clashes. However, section structures more often than not suffer from the same problems as badly designed namespace structures. Take iOS Settings for example. There are both unintuitive groupings and very deep nestings. - -Regarding unintuitive groupings, there's this top-level section named "General" (among other unintuitive things), which contains many subsections: "About", "Software Update", "Siri", "Spotlight Search", "Handoff & Suggested App" "Accessibility", "Usage", "Background App Refresh"... And others I'm too tired to list. But what does "General" even mean? How are other top level sections like "Notifications", "Control Center", "Display & Brightness", etc. less general than the subsections found in "General"? No clue. I think Apple just wants to put (what they perceive as) the most used sections in the top-level, but sometimes it's hard to remember what's in "General" and what's not without going through both lists one by one (and missing what you are looking for in the first three tries). - -Regarding deep nestings, try to find "Frequent Locations". It's "Privacy->Location Services->System Services->Frequent Locations", or if you locked down Location Services with Restrictions,[^find-my-iphone] "General->Restrictions->Location Services->System Services->Frequent Locations". Of course it's rarely used, but it still makes me gasp.[^location-services] - -[^find-my-iphone]: Which you should: what's the point of Find My iPhone when the thief can disable it in Location Services? -[^location-services]: This brings another problem of the interface design of iOS Settings. When restricted, one cannot make modifications to "Privacy->Location Services", and instead has to go to "General->Restrictions->Location Services". What's the point? "Restrictions" is about *setting restrictions*, not about *editing restricted items or sections in a central place exclusively"*. Ideally one should be able to tap on a lock icon in "Privacy->Location Services" and enter the restrictions passcode to unlock it, like what we find in OS X's System Preferences. - -I think in general **one should be really careful with subsections (i.e., two or more levels of nesting)**, especially in designing a settings interface. There's a reason why most INI files have no hierarchy, just sections. I believe the reason is that **our text processing capability is inherently linear.** Hypertext and jumping interfaces disrupt the linear workflow, but even when faced with a network of stuff, we still process them one at a time, linearly. Linearity is even more important in designing a settings interface since unlike reading articles, one is typically looking for a specific item. **Finding one item linearly in a list of irrelevant distractions is already annoying enough, and you certainly don't want to make it quadratic or even cubic, which is simply unbearable when coupled with unexpected groupings.** - -I can understand why designing a settings interface for a system as complicated as iOS (yet somehow has to keep all settings in a central place) is hard — there are too many atomic items, and often items do not fall nicely into categories. But I think it still important to try to reduce nesting. Maybe having long lists, but putting the most commonly used items on top is a good idea. Or maybe... Bypass the linear searching experience altogether? - -## Searchable settings - -I'm not sure who invented searchable setting pages, but I first noticed their great efficiency in Google Chrome many years ago, when one had to look for setting items tab after tab in all other major browsers. In fact, even to this day, the Chromium Opera (i.e., Opera 15+) is the only major browser other than Chrome that has adopted searchable settings. (I remember arguing with someone over whether this was a change for the good on [blogs.opera.com/desktop](http://blogs.opera.com/desktop/).) Searchable settings is also available in OS X's System Preferences, which is a joy to use. See screenshots below about how Google and Apple implement a searchable interface. Windows Control Panel is also searchable, and the search feature is capable of turning up deeply buried settings (e.g., "Control Panel->System and Security->System->Advanced system settings->Environment Variables"), so one point for them also. - -As I said above, looking for an item in a list of irrelevant stuff is really annoying. Searchable settings completely bypass this issue by bringing users right to the desired item. This way, unintuitive groupings or deep nestings are no longer that problematic. Just like Google will tell me whether `rmtree` is in `os` or `shutil`[^rmtree], System Preferences' search will tell me whether "Dark menu bar or Dock" is in "General" or somewhere else. - -In fact, it is somewhat surprising to me that searchable settings are only available in a handful of applications. Seriously, these days we can search for almost anything on our computers and anything on the grand grand Internet, but we can't search the pool of available settings? If we have an INI, Plist XML, JSON, YAML, or whatever text configuration/preference file, then we can search it. Why not in GUI applications? - -Of course, designing clear structures (with the principles and pitfalls discussed in the first half of this post) pays. But searchable settings are one honking great idea, and they are just long due in most applications. Come on, let's do more of them. - -[^rmtree]: This is of course just a metaphor; I'm not dumb enough to be unable to remember `shutil.rmtree`. - -![How Google designed their award-winning searchable settings.](https://i.imgur.com/NazieEk.png) - -![Apple.](https://i.imgur.com/aKgW29W.png) - -![Microsoft.](https://i.imgur.com/7zJxr8P.png) - ---- - -**May 16, 2015 update:** Ars Technica [published an article today](http://arstechnica.com/apple/2015/05/what-wed-like-to-see-in-ios-9-at-wwdc-next-month/) listing "what we'd like to see in iOS 9 at WWDC next month", and "Settings page overhaul" is listed as the third item. Apparently I'm not the only one who's concerned about the iOS Settings maze. In addition, their proposed solution is similar to mine;[^similarity] the key, of course, is search. - -**June 27, 2015 update:** [Wish granted in iOS 9](/blog/2015-06-26-ios-9-searchable-settings.html). - -[^similarity]: Which is not at all surprising, since Apple's very own OS X has already set an example. diff --git a/source/blog/2015-05-09-storyboard-reached-01.md b/source/blog/2015-05-09-storyboard-reached-01.md deleted file mode 100644 index cfc44e5f..00000000 --- a/source/blog/2015-05-09-storyboard-reached-01.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: "storyboard reached 0.1" -date: 2015-05-09T00:32:28-07:00 -date_display: May 9, 2015 ---- - -For quite some time I've been working on a Python project called [`storyboard`](https://github.com/zmwangx/storyboard), and today I finally released the 0.1 stable (or you can think of it as 1.0). - -As described on [the index page](https://storyboard.readthedocs.org/en/0.1/index.html), - -> `storyboard` is a FFmpeg-based customizable video storyboard generator with metadata reporting directly embedded in the generated images. Reported metadata fields include, but are not limited to, title, filename, file size, SHA-1 digest, container format, duration, pixel dimension, display aspect ratio (DAR), scan type (progressive, interlaced, or telecined), frame rate, and per-stream metadata (type, codec, profile, dimensions, bitrate, etc.). - -And the motivation was - -> `storyboard` was inspired by the storyboards I frequently encounter on video-sharing Internet forums, mostly generated by proprietary video players. Those storyboards often come with video/file metadata bundled, which I see as a great all-in-one solution for video sharing, saving one the labor of typing multiple console commands, copying and pasting output, and worrying about the forum’s crappy formatting. However, I, for one, dislike proprietary players. Also, those storyboards are usually ugly and uninformative, using stupid fonts and lacking crucial information that hackers look for (e.g., hash). Therefore, I developed this customizable storyboard generator for hackers. - -The project itself isn't very important, and I don't see any possibility of it gaining recognition; but its educational value to me was pretty huge. This is the first full package I ever developed, in the sense that it's complete with documentation, test suites, continuous integration and tested portability, as well as distributed to a package index ([PyPI](https://pypi.python.org/pypi/storyboard) in this case). Here's what I observed and learned: - -1. It's just really different from casual hacking, where I would try to achieve what I need in the shortest amount of programmer time possible, drop hard-coded values (even OAuth tokens) in scripts, leave things undocumented, etc. I'm a perfectionist so my casual code is usually not so bad, but `storyboard` is just different — to ensure quality of API and CLI, I wrote more documentation than actual code. Through this project I realized how hard real-world coding (or idealized real-world coding) is: the initial 10% is excitement, and the rest is just chores (compare that to casual hacking, where at least 30% is excitement). - -2. Write once, debug everywhere. Not really, but ensuring portability is really difficult. Trying to debug something on a platform which I can't lay my hands upon is insanely frustrating. This afternoon I spent a long time trying to pin down a weird hanging bug on AppVeyor; the complete process is documented in [this squashed commit](https://github.com/zmwangx/storyboard/commit/e8a28e5a92f744157fedd03893fa8fe5a5e7d445). In the end the bug wasn't in my program, but in that specific version of FFmpeg (which I wouldn't believe since FFmpeg is really stable from my experience), or that specific version of FFmpeg combined with AppVeyor, or that specific version of FFmpeg combined with AppVeyor combined with Azure, or... who knows. The only thing I could say is it was not in my program, because I could reproduce the infinite loop in ``ffprobe`` even before I launched my program... Anyway, in this case I can lay my hands on the platform, just indirectly and painful. What about real world development where developers need to handle bug reports from users who could have broken everything? I don't want to imagine. - -3. The project was a clear manifestation of Hofstadter's law: - - > It always takes longer than you expect, even when you take into account Hofstadter's Law. - - Enough said; so true. In fact, towards the end of the development cycle I got pretty bogged down[^bogged-down] and stopped for a while to work on renovating this blog (60% excitement!). Meanwhile, I was too busy with other parts of life, so I rushed towards the stable 0.1 release in the past two days, dropping several ideas I wanted to implement (for completeness). Although I "rushed", it still took at least four times as long as I expected. - -[^bogged-down]: I was implementing stuff that I wouldn't ever need myself — for completeness, and that was not rewarding in the slightest. - -Anyway, here it is, the [0.1](https://github.com/zmwangx/storyboard/releases/tag/0.1) [release](https://pypi.python.org/pypi/storyboard/0.1). The badges certainly weren't bad: - -![`storyboard`'s got quite a few badges of honor](https://i.imgur.com/miOoX5Y.png) - -I created [an asciinema recording](https://asciinema.org/a/19782) to commemorate the release (the original asciicast is [here](https://dl.bintray.com/zmwangx/generic/storyboard-0.1-walkthrough-asciicast.json)):[^solarized-dark] - -[^solarized-dark]: The screencast's color scheme is actually off in some places, since in my iTerm2 bold font is displayed as bold, not bright. - -
- - -
- -And, just to demonstrate `storyboard`, I re-screen-recorded the asciinema screencast with QuickTime, saved to [an MOV file](https://dl.bintray.com/zmwangx/generic/storyboard-0.1-walkthrough.mov), and ran it through my `metadata` and `storyboard`: - -``` -> metadata storyboard-0.1-walkthrough.mov -Filename: storyboard-0.1-walkthrough.mov -File size: 60418244 (57.7MiB) -Container format: QuickTime movie -Duration: 00:06:36.30 -Pixel dimensions: 672x846 -Display aspect ratio: 112:141 -Scan type: Progressive scan -Frame rate: 60 fps -Streams: - #0: Video, H.264 (Main Profile level 3.2), 672x846 (DAR 112:141), 60 fps, 1213 kb/s - -> storyboard storyboard-0.1-walkthrough.mov -Processing storyboard-0.1-walkthrough.mov -Crunching metadata... -Trying to determine scan type... -Inspecting frame 40/40... -Generating main storyboard... -Extracting frame 16/16... -Generating thumbnail 16/16... -Tiling thumbnails... -Generating metadata sheet... -Computing SHA-1 digest... -57.7MiB 0:00:00 [ 571MiB/s] [=================================================================================>] 100% -Generating promotional banner... -Assembling pieces... - -storyboard saved to: /tmp/storyboard-se3fbiif.jpg - -``` - -Here's the actual image: - -![storyboard of ``storyboard-0.1-walkthrough.mov`` (1964x2694), generated with the default settings by `storyboard 0.1`](https://i.imgur.com/c3E3M8R.jpg) - -Credit to `lolcat` for making my storyboard colorful. diff --git a/source/blog/2015-05-19-bash-the-special-slash-character-in-filename-expansion.md b/source/blog/2015-05-19-bash-the-special-slash-character-in-filename-expansion.md deleted file mode 100644 index a30c220f..00000000 --- a/source/blog/2015-05-19-bash-the-special-slash-character-in-filename-expansion.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: "Bash: the special slash character in filename expansion" -date: 2015-05-19T18:33:51-07:00 -date_display: May 19, 2015 ---- - -It is well-known and common sense that the slash character (`/`) serves a special role in Bash filename expansion. For instance, the asterisk `*` certainly won't match `/` or `.` when used in filename expansion; otherwise, a standalone `*` would match everything in the filesystem. - -However, it is less clear how a literal slash character[^expansion] is treated in extended glob patterns. Naively one would expect it to just match a literal slash, but the real situtation is more complicated than that. Consider the following examples: - -[^expansion]: Here, "a literal slash character" also applies to one that comes from tilde expansion, parameter expansion or command substitution, since they are performed before filename expansion in Bash. - -```bash -bash-4.3$ shopt -s extglob nullglob -bash-4.3$ echo /usr/@(bin|lib) -/usr/bin /usr/lib -bash-4.3$ echo /usr@(/bin|/lib) - -bash-4.3$ [[ /usr/bin == /usr@(/bin|/lib) ]] && echo matching -matching -``` - -As seen from this example, patterns with slash simply doesn't work (in filename expansion) when placed in an extended glob pattern list, and there's no error whatsoever. I looked up the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html#Pattern-Matching) and the [Bash Guide](http://mywiki.wooledge.org/BashGuide/Patterns) but neither mentioned this behavior. One might need to delve into the source code to say for sure what exactly is going on. - -In comparison, Zsh and its [docs](http://zsh.sourceforge.net/Doc/Release/Expansion.html#Filename-Generation) are much more up front about this issue: - -> Note that grouping cannot extend over multiple directories: it is an error to have a ‘/’ within a group (this only applies for patterns used in filename generation). ... - -And when we run equivalent code in Zsh: - -```zsh -zsh-5.0.5$ setopt NULL_GLOB -zsh-5.0.5$ echo /usr/(bin|lib) -/usr/bin /usr/lib -zsh-5.0.5$ echo /usr(/bin|/lib) -zsh: bad pattern: /usr(/bin|/lib) -zsh-5.0.5$ [[ /usr/bin == /usr(/bin|/lib) ]] && echo matching -matching -``` - -The lesson? Be careful not to use a pattern like `@(path1|path2|path3)` in Bash when the paths are absolute, or relative but contain the slash. Unlike Zsh, Bash just silently fails on a pattern like this, which is rather dangerous in scripts. diff --git a/source/blog/2015-05-22-using-a-command-table-as-wallpaper.md b/source/blog/2015-05-22-using-a-command-table-as-wallpaper.md deleted file mode 100644 index 7e3e6fcc..00000000 --- a/source/blog/2015-05-22-using-a-command-table-as-wallpaper.md +++ /dev/null @@ -1,161 +0,0 @@ ---- -title: "Using a command table as wallpaper" -date: 2015-05-22T00:48:19-07:00 -date_display: May 22, 2015 ---- - -Recently I cleaned up my source code directory, removed a lot of rarely-used, dated scripts, and grouped the remaining standalone scripts into a central place (`~/dev/scripts`)[^dev]. One thing I learned in this process is that I tend to write a reusable script but rarely actually reuse it (even if it sits on `PATH`), sometimes implementing the same functionality twice or typing a long command line over and over again. - -[^dev]: The `~/dev` directory stands for development, and contains all my source code and almost all local builds. The point is by having a `~/dev` directory, I no longer need to have `bin`, `include`, `lib`, and `share` in my `HOME`, thus saving a few slots. Backing up and restoring is also slightly easier. - -To remind myself of which scripts are at my fingertip, I decided to use a command table as wallpaper on my secondary display. So I wrote a shitty Python script[^shitty] (depending on XeLaTeX and ImageMagick) to automate the generation of such a wallpaper. It's pretty customizable, and anyone may grab it and do whatever they want to with it (also [available as a gist](https://gist.github.com/zmwangx/b06aa923abf061b33fc9)): - -[^shitty]: Yeah, I know it's a shitty script, so don't nitpick on style problems. - -```python -#!/usr/bin/env python3 - -"""Generate command table.""" - -import argparse -import os -import shlex -import subprocess -import sys -import tempfile - -# pylint: disable=wildcard-import,unused-wildcard-import - -from zmwangx.colorout import * - -DEFAULT_COLUMN_WIDTH = 120 -DEFAULT_FOREGROUND_COLOR = "white" -DEFAULT_BACKGROUND_COLOR = "black" -DEFAULT_FONT = "Consolas" -DEFAULT_BORDER = 20 -DEFAULT_DENSITY = 300 -DEFAULT_SIZE = "1280x800" - -HERE = os.path.dirname(os.path.realpath(sys.argv[0])) -XELATEX_PROGRAM = (r""" -\documentclass[varwidth=\maxdimen,border={border}pt]{{standalone}} -\usepackage{{color}} -\pagecolor{{{background}}} -\color{{{foreground}}} -\usepackage{{fontspec}} -\setmonofont{{{font}}} - -\begin{{document}} -\begin{{verbatim}} -{table} -\end{{verbatim}} -\end{{document}} -""") - -def text_table(**kwargs): - """Generate the text version of the table.""" - width = kwargs["width"] if "width" in kwargs else DEFAULT_COLUMN_WIDTH - directory = kwargs["directory"] if "directory" in kwargs else HERE - command_line = (r"find {directory} -maxdepth 1 -type f -perm -u=x -exec basename {{}} \; " - "| column -c {width} | expand".format( - directory=shlex.quote(directory), width=width)) - ccommand(command_line) - return subprocess.check_output(command_line, shell=True).decode("utf-8") - -def pdf_table(**kwargs): - """Generate the PDF version of the table. - - Returns 0 on success or 1 on failure. Generated PDF is "table.pdf" - in the current working directory. - - """ - border = kwargs["border"] if "border" in kwargs else DEFAULT_BORDER - foreground = kwargs["foreground"] if "foreground" in kwargs else DEFAULT_FOREGROUND_COLOR - background = kwargs["background"] if "background" in kwargs else DEFAULT_BACKGROUND_COLOR - font = kwargs["font"] if "font" in kwargs else DEFAULT_FONT - program = XELATEX_PROGRAM.format(table=text_table(**kwargs).strip(), - font=font, border=border, - foreground=foreground, background=background) - with open("table.tex", "w") as texfileobj: - texfileobj.write(program) - try: - ccommand("xelatex table.tex") - subprocess.check_call(["xelatex", "table.tex"], - stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) - return 0 - except subprocess.CalledProcessError: - cerror("xelatex failed on the following program:") - cerrnewline() - cerrwrite("default", program) - return 1 - -def png_table(**kwargs): - """Generate the PNG version of the table. - - Returns 0 on success or 1 on failure. Generated PNG is "table.png" - in the current working directory. - - """ - if pdf_table(**kwargs) == 1: - return 1 - density = kwargs["density"] if "density" in kwargs else DEFAULT_DENSITY - size = kwargs["size"] if "size" in kwargs else DEFAULT_SIZE - background = kwargs["background"] if "background" in kwargs else DEFAULT_BACKGROUND_COLOR - command_line = ("convert -density {density} table.pdf -resize {size} -size {size} " - "xc:{background} +swap -gravity center -composite table.png".format( - density=density, size=size, background=background)) - try: - ccommand(command_line) - subprocess.check_call(shlex.split(command_line)) - return 0 - except subprocess.CalledProcessError: - cerror("the following ImageMagick command failed:") - cerrprint("default", command_line) - return 1 - -def main(): - """CLI.""" - description = "Generate a PNG table of all executable commands in a directory." - parser = argparse.ArgumentParser(description=description) - parser.add_argument("--width", type=int, default=DEFAULT_COLUMN_WIDTH, - help="""line width, default is 120""") - parser.add_argument("--directory", - help="""directory containing executables, default is - the directory containing this command""") - parser.add_argument("--border", type=int, default=DEFAULT_BORDER, - help="""default is 20pt""") - parser.add_argument("--foreground", default=DEFAULT_FOREGROUND_COLOR, - help="""foreground color, default is white""") - parser.add_argument("--background", default=DEFAULT_BACKGROUND_COLOR, - help="""background color, default is black""") - parser.add_argument("--font", default=DEFAULT_FONT, - help="""default is Consolas""") - parser.add_argument("--density", default=DEFAULT_DENSITY, - help="""used for the -density argument of convert, - default is 300""") - parser.add_argument("--size", default=DEFAULT_SIZE, - help="""size of image, default is 1280x800""") - args = parser.parse_args() - kwargs = {k: v for (k, v) in args.__dict__.items() if v is not None} - - fd, tmpfilepath = tempfile.mkstemp(suffix=".png", prefix="table-") - os.close(fd) - with tempfile.TemporaryDirectory(prefix="table-") as working_directory: - os.chdir(working_directory) - if png_table(**kwargs) == 1: - cerror("execution failed") - os.remove(tmpfilepath) - else: - os.rename("table.png", tmpfilepath) - cprogress("saved to:") - print(tmpfilepath) - -if __name__ == "__main__": - main() -``` - -By the way, the `zmwangx.colorout` module is [here](https://github.com/zmwangx/pyzmwangx/blob/41b0bffaad9439888d68097a85c7aed594240283/zmwangx/colorout.py), just to ease the printing of progress and errors to tty. You may safely remove all the `ccommand`, `cerr*` and `cprogress` calls. - -Here is an example wallpaper reflecting my current `~/dev/scripts`: - -![Command table wallpaper for my secondary display (MBP 13'' builtin display).](https://i.imgur.com/mccQu1e.png) diff --git a/source/blog/2015-05-29-apples-customer-service-is-still-the-best-plus-an-authy-horror-story.md b/source/blog/2015-05-29-apples-customer-service-is-still-the-best-plus-an-authy-horror-story.md deleted file mode 100644 index 7d17f6bb..00000000 --- a/source/blog/2015-05-29-apples-customer-service-is-still-the-best-plus-an-authy-horror-story.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Apple's customer service is still the best (plus an Authy horror story)" -date: 2015-05-29T20:40:05-07:00 -date_display: May 29, 2015 ---- - -Recently the mute switch (officially known as the Ring/Silent switch) on my little-more-than-half-a-year-old iPhone 6 Plus stopped working. It almost always bounced back to ON (ring) position upon turning, and even if I could keep it at the OFF position for five seconds, it would most likely bounce back when I thrust it into my pocket. I got bitten a few times — almost got heart attacks when the phone dinged loudly in class. Minor yet annoying problem. - -So I took my phone to the Genius Bar today, prepared to have it sent to a repair center[^repair-center] and get a loan in the mean time — basically, I was prepared for all sorts of trouble. But nope. I demoed the problem for three seconds, my agent explained to me in five seconds that the switch alone was hard to replace and took fifteen seconds to verify my warranty status (I suppose), then off he went to retrieve a brand new replacement for me. No questions asked about the little dent on my old phone or whatever. *So I ended up with a brand new phone in less than five minutes.* (Of course, redoing setup and restoring backup took much longer than that.) - -[^repair-center]: As I see no obvious way to replace the switch in store. My intuition was later confirmed. - -This is *the* customer service we should receive everywhere. Unfortunately, Apple seems to be one of the very few tech giants (or the only one?) that take customers seriously. Yeah, Apple sells products at a premium; but hey, they also live up to what one would expect from a premium product. - ---- - -By the way, my only gripe during the process wasn't with Apple; it's about setting up Authy on the new phone. I verified my phone number via SMS and signed into Authy. I entered my backup password, which must be correct since it came straight off 1Password. My Authenticator accounts were displayed (I didn't verify if they would produce TOTPs) but a weird error message along the line of "data is corrupted" was shown to me, asking me to verify my phone for a second time. Unsuspecting, I asked Authy to send me another SMS, and entered the code I got. Then boom! All of a sudden *all my Authenticator accounts were gone*, leaving me with merely an Authy dev and a Coinbase account, which were the only ones that use Authy's native auth system. My heart almost sank for a second; I could almost foresee hours going down the drain, recovering (dozens of) accounts and regenerating new keys for two-factor auth. - -That was before I immediately realized that all my secret keys were safe and sound in 1Password's database. In the past few months, AgileBits implemented TOTP support in both the iOS and OS X versions of 1Password. The day [OS X support came into stable 5.3](https://blog.agilebits.com/2015/04/06/1password-5-3-for-mac-the-bionic-edition-is-out/), I exported all my Authenticator secret keys from Authy to 1Password (with help from [this blog post](https://www.pommepause.com/2014/10/how-to-extract-your-totp-secrets-from-authy/)[^blog-post]). At that time I didn't expect 1Password would save my day later. Overall, the $50 (OS X) plus $17 (iOS) I spent on 1Password was my most worthwhile spend on software, ever. - -[^blog-post]: The first comment below that post is mine. - -The lesson to learn from my Authy horror story is that one should export and backup Authenticator secret keys from Authy before it's too late. Moreover, this one shitty experience with Authy is enough to keep me away from it for the ages to come, except for services that are Authy-specific, e.g., Coinbase[^bitcoin]. 1Password is the way to go, and with the addition of TOTP, it is one more step towards a truly one password experience. If you don't own 1Password yet, you should really get it, now. - -[^bitcoin]: I have a Coinbase account and probably around 0.01 BTC in my wallet, but I don't really use bitcoins. At the time I signed up for two-factor auth on Coinbase, Authy seemed to be only supported system; however, I just signed in again and it seems that Coinbase is now supporting Authenticator also. Whatever the case, Authy is practically dead for me. diff --git a/source/blog/2015-05-30-using-a-personal-helper-package-in-everyday-scripting.md b/source/blog/2015-05-30-using-a-personal-helper-package-in-everyday-scripting.md deleted file mode 100644 index ac69cc57..00000000 --- a/source/blog/2015-05-30-using-a-personal-helper-package-in-everyday-scripting.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "Using a personal helper package in everyday scripting" -date: 2015-05-30T22:48:57-07:00 -date_display: May 30, 2015 ---- - -Recently I've been scripting (mostly in Python) quite a bit, and noticed that some functionalities get copied over or reimplemented over and over again. Examples include reading configuration files (mostly JSON, INI, and YAML), printing progress information to tty in color, displaying progress bar, and so on. - -In light of this, I came up with the idea of keeping a pool of helper modules in a personal helper package. I'm unimaginative at naming things, so I just named my package `zmwangx`. It is [published on GitHub](https://github.com/zmwangx/pyzmwangx), and the API docs are published on [Read the Docs](https://pyzmwangx.readthedocs.org) for easy reference during scripting.[^doc] At the time of writing the following helper modules are available in the package: - -[^doc]: I'm pretty paranoid about documenting things. - -* `colorout -` colorized output to stdout and stderr, and much more. -* `config -` read and write config files of various common formats. -* `hash -` hash files in a memory-efficient manner. -* `humansize -` convert size in bytes to human readable string (IEC or SI). -* `humantime -` convert duration in seconds to human readable string. -* `infrastructure -` testing infrastructure. -* `pbar -` display progress bar for the progress of processing a file or stream. -* `urlgrep -` parse and match URLs from HTML documents. - -With a personalized helper package, scripting has never been more enjoyable. Here are just some of the benefits: - -* Stating the obvious: write once, use everywhere (without copy/paste); -* As always, factoring out small functional units make code more readable and easier to debug; and having a dedicated pool just for helper modules encourages one to think about factoring, *early*; -* Bug fixes and enhancements in the helper package are instantly effective accross the board. - -Of course, one cannot depend on such a package in a formally published package (say, one published to PyPI), so things like `tools.py` or whatever are still necessary from time to time. But for day-to-day scripting, having a personal helper package that is used accross the board is definitely a good idea. diff --git a/source/blog/2015-06-07-stackoverflow-review-system-is-completely-bs.md b/source/blog/2015-06-07-stackoverflow-review-system-is-completely-bs.md deleted file mode 100644 index 2ab4b18c..00000000 --- a/source/blog/2015-06-07-stackoverflow-review-system-is-completely-bs.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: "StackOverflow review system is completely BS" -date: 2015-06-07T18:58:57-07:00 -date_display: June 7, 2015 ---- - -I just answered an interesting question about ZLE [on StackOverflow](http://stackoverflow.com/q/30699242/1944784), and in the process I also improved my own toolchain. For the record, the OP asked for tab completion to present working directory items (executable files and directories) on an empty command line, which led to the following widget: - -```zsh -# This widget inserts "./" to the buffer and list possible completions -# (executable files and directories in the present working directory) if the -# buffer is empty or only contains whitespace. -function complete_pwd_items_on_empty_buffer -{ - if [[ $BUFFER =~ ^[[:space:]]*$ ]]; then - BUFFER+="./" - CURSOR+=2 - zle list-choices - else - zle expand-or-complete - fi -} - -zle -N complete_pwd_items_on_empty_buffer -``` - -This is all good stuff. - -However, at some point a [security architect and mobile security engineer](https://stackoverflow.com/users/608639/jww) jumped in and made [the following comment](https://stackoverflow.com/questions/30699242/first-tab-completion-enhancement#comment49457640_30699242): - -> Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](https://stackoverflow.com/help/on-topic) in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask. Also see [Where do I post questions about Dev Ops](http://meta.stackexchange.com/q/134306)? - -Then the question was put on hold by several not-so-high-rep users as off-topic, and the reason given is - -> Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User. - -WTF. First, *programming ZLE widgets is programming.* Hell, I even gave chunks of Zsh code in the answer (and they saw that, because the stupid comment and its upvotes came after my answer was put up). If writing an interactive Android crapp in Java for your Samsung counts as programming, why is writing an interactive widget for my Z shell any inferior? Second, even if you want to follow what the Help Center says, this question clearly falls under - -> software tools commonly used by programmers. - -Maybe Zsh isn't used by those specific voters (I guess most of them are Windows lusers), but it has a very vibrant community, and it clearly rules. Maybe the specific voters don't realize that Zsh is a programming language; that alone shows how ignorant they are. - -However, these are just specific lusers. Why do I generalize and insist that "StackOverflow review system is completely BS"? Well, just look at the voters' stats; I searched for their involvement in the `zsh` tag, and here are the results: [1](https://stackoverflow.com/search?q=user:2422776+[zsh]), [2](https://stackoverflow.com/search?q=user:683218+[zsh]), [3](https://stackoverflow.com/search?q=user:608639+[zsh]), [4](https://stackoverflow.com/search?q=user:3836229+[zsh]), [5](https://stackoverflow.com/search?q=user:2772643+[zsh]). Unsurprisingly, nothing, except one guy has answered a question about ASCII art, which shouldn't be placed under `zsh` in the first place. While someone knowlegeable of Zsh doesn't necessarily need to ask or answer questions about Zsh on SO, this quick search does reveal that these voters, rather than following the `zsh` tag, just popped out of nowhere, probably from the review queues. In this case it's pretty obvious that they're going after a new user (the OP just registered). And that is one of the main problems with SO's review system that makes it highly questionable in many cases: - -**The review tasks are handed to people who have no knowledge of the topics,[^approved-edit] and these people just operate under assumptions (e.g., new users will ask off-topic questions.)[^new]** - -[^approved-edit]: This problem isn't limited to reviews; it also applies to, for instance, approved edits. My *tag edits* (with explanations) got rejected quite a few times because the reviewers clearly didn't understand the topic — e.g., some morons assume that command line problems equal Bash problems. - -[^new]: This is actually a good assumption, because this is the case at least 50% of the time from my limited experience. But one shouldn't operate under this assumption, especially if one doesn't understand the topic. - -The solution? I'm afraid *there's no solution as long as the system is in place*. Ideally one should skip questions from topics that they don't understand, but in reality people just do as they damned well please, whether because they are working toward a badge, or because they *think* they understand the topic but really don't, or because they are outright jerks. Also, there are tons of totally fucked-up questions lying in every corner of SO (like questions displaying such profound ignorance[^bad] that no one would answer due to embarrassment, or those despicable "I can has code" questions) that no one cares about cleaning up, but instead they chose to target this well-meaning question that generated a pretty useful answer. By the way, this is the kind of thing I see all the time. - -[^bad]: I think I asked quite a few stupid questions back in the days, and now I'm totally ashamed of them. Insterestingly, some of those questions are my highest voted ones and got me quite some reps (compared to my total rep — I'm by no means a high rep user). See [*Why I no longer contribute to StackOverflow*](http://michael.richter.name/blogs/why-i-no-longer-contribute-to-stackoverflow) for a thorough discussion of the broken rep system and its disastrous effects. - -I hope SO could abandon this questionable "review queue" practice altoghether. Let people who actually follow the tags do the reviewing and voting. Honestly, no one really cares about dangling low-quality questions anyway. diff --git a/source/blog/2015-06-08-apple-turns-its-homepage-into-a-wwdc-liveblog.md b/source/blog/2015-06-08-apple-turns-its-homepage-into-a-wwdc-liveblog.md deleted file mode 100644 index f881b027..00000000 --- a/source/blog/2015-06-08-apple-turns-its-homepage-into-a-wwdc-liveblog.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: "Apple turns its homepage into a WWDC liveblog" -date: 2015-06-08T14:42:50-07:00 -date_display: June 8, 2015 ---- - - -WWDC is Apple's biggest event every year, and WWDC keynote always attracts tons of hype. Apple knows that. In the past years folks who can't (at work, in class, etc.) or don't want to watch the crappy live stream would follow the various WWDC liveblogs presented by tech sites like Gizmodo, TechCrunch, Ars Technica, etc. But this year the landscape has changed: Apple rolled its own card-based liveblog at [www.apple.com/live/2015-june-event](http://www.apple.com/live/2015-june-event/).[^stream] Not only that; during the keynote, Apple redirected its homepage to the liveblog page, so it effectively turned its homepage into a liveblog: - -[^stream]: The crappy live stream is still there, but thankfully you wouldn't see it if you're on a browser other than Safari. Just look the screenshot of the banner. - -```zsh -> curl -sSIL http://www.apple.com -HTTP/1.1 302 Moved Temporarily -Location: http://www.apple.com/live/ -Content-Length: 210 -Content-Type: text/html; charset=iso-8859-1 -Expires: Mon, 08 Jun 2015 19:16:41 GMT -Cache-Control: max-age=0, no-cache, no-store -Pragma: no-cache -Date: Mon, 08 Jun 2015 19:16:41 GMT -Connection: keep-alive -Server: Apache - -HTTP/1.1 301 Moved Permanently -Content-Length: 0 -Date: Mon, 08 Jun 2015 19:16:41 GMT -Connection: keep-alive -Server: Apache -Location: http://www.apple.com/live/2015-june-event/ - -HTTP/1.1 200 OK -Last-Modified: Mon, 08 Jun 2015 15:45:30 GMT -ETag: "0b7bcbfbd14c411e64e728ae4d644de7" -Content-Type: text/html -Cache-Control: max-age=298 -Date: Mon, 08 Jun 2015 19:16:41 GMT -Connection: keep-alive -Server: Apache -``` - -Of course, you miss a few jokes and random shots of Tim or Craig from the official liveblog, but hey, who don't like that official feel?[^official] - -[^official]: Yeah, I know some people don't; but those people are not likely to be Apple fans either. - -Here are a few screenshots of today's liveblog. Unfortunately I only know some entry level JS, so I wasn't able to capture the entire page, which uses dynamic DOM based on one's position in the page. - -![The banner on Chrome.](/img/20150608-wwdc-2015-banner.png) - -![Introducing OS X El Capitan, 960x981.](/img/20150608-wwdc-2015-liveblog-960x981.png) - -![A fuller experience: 1920x1080.](/img/20150608-wwdc-2015-liveblog-1920x1080.png) - -By the way, here are the full-page screenshots of [OS X 10.11 El Capitan](http://www.apple.com/osx/elcapitan-preview/) and [iOS 9](http://www.apple.com/ios/ios9-preview/) previews. `pageres` recently [cannot render web fonts](https://github.com/sindresorhus/pageres/issues/174), which is rather annoying, so I used [Full Page Screen Capture](https://github.com/mrcoles/full-page-screen-capture-chrome-extension) to capture the shots. I then resized to 50% to reduce filesizes a bit. - -![[OS X El Capitan](http://www.apple.com/osx/elcapitan-preview/)](/img/20150608-osx-el-capitan-preview-1920x1080-50%25.png) - -![[iOS 9](http://www.apple.com/ios/ios9-preview/)](/img/20150608-ios-9-preview-1920x1080-50%25.png) diff --git a/source/blog/2015-06-10-chrome-disappointment-the-shabby-and-boring-old-bookmark-system-from-stone-age-strikes-back.md b/source/blog/2015-06-10-chrome-disappointment-the-shabby-and-boring-old-bookmark-system-from-stone-age-strikes-back.md deleted file mode 100644 index f6cb4880..00000000 --- a/source/blog/2015-06-10-chrome-disappointment-the-shabby-and-boring-old-bookmark-system-from-stone-age-strikes-back.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: "Chrome disappointment: the shabby and boring old bookmark system from Stone Age strikes back" -date: 2015-06-10T23:17:05-07:00 -date_display: June 10, 2015 ---- - -I just restarted my machine (in the process of planning a fresh OS re-install), and something in Chrome's UI immediately felt wrong. After a few moments I realized it was the star button (bookmark button) in the far right of the omnibox giving me the uneasy feeling — the old bookmark system is back. Broadcasting from stable channel, build 43.0.2357.124 on OS X. - -![What caught my immediate attention.](/img/20150610-omnibox-with-aged-star.png) - -![The heart sinking feeling when I saw this again.](/img/20150610-old-bookmark-manager.png) - -I went to flags and made sure "Enable the new bookmark app system" wasn't tempered with. It wasn't. Anyway, I changed it to "Enabled" and restarted Chrome. No go, still the old crap. So I Googled my way to [the announcement](https://productforums.google.com/forum/#!topic/chrome/mhIX5LB23As): - -> Hi Everyone, -> -> Our team is committed to improving Chrome’s bookmarks experience, but for the time being, we’ve decided to bring back the previous version. Our team will continue to explore other ways to improve the bookmarks experience. You’ll see the previous version of the bookmarks manager return to your Chrome browser shortly. -> -> For those of you who enjoyed using the new bookmarks manager, you can still keep the new experience by downloading the Bookmarks Manager extension from the Chrome Web Store. -> -> We appreciate hearing all of your thoughtful feedback. Feel free to leave us with any additional comments here in this thread. -> -> Best,
-> The Chrome team - -This is just very disappointing. My default browser changes a lot, but I've been tagging along with Opera for [almost the entirety of 2014](/blog/2014-12-14-the-google-chrome-comic-a-classic.html), so I've long been used to visual bookmarks. And honestly, it never felt weird or anything; I saw it as an improvement the first time I was introduced to the concept. - -I know, there's always a demographic that would fiercely resist any change; they would reject anything new at a glance (or after using for a second) and start moaning right away, disregarding all the new benefits here and there. There's also another demographic who not only have no taste in design at all, but would also actively seek to tear down any visual enhancement — 90s visual is enough for them for life, any more is unsolicited and insulting. When these two demographics meet[^overlap] and somehow make the developers retreat, the outcome is simple and sad: *we can never have nice things.* - -[^overlap]: There's actually a pretty big overlap between these two demographics. - -I'm not saying I'm 100% satisfied with Chrome's visual bookmarks. In fact far from that. For one thing, Google is really pretty bad at visual design.[^bar] Also, not being able to adjust tile size or toggle a list view is rather lame. However, whatever problems there are, the new system is at least 200% better than the old one (just look that the screenshots!).[^new] *The team should focus on making the new system better,* such as implementing the features I mentioned above, rather than throw it into the trash can and resurrect the old system from Stone Age. - -[^bar]: The giant blue search bar at the top is especially ridiculous. - -[^new]: I didn't bother to switch to an earlier build just to take a screenshot of the visual system, so unfortunately there's no comparison here. But anyone who's been there knows what I'm saying. - -I know, throwing things away is part of Google's philosophy. They usually toy with a wide range of ideas and discard the ones that people don't buy into. Not that I whole-heartedly agree with strategy, but to advance technology there has to be some Brownian motion out there, and Google usually listens to the market, which is fine. In this case, however, there's really nothing innovative about visual bookmarks, and I can't see how the new system could harm market share or anything either. In fact, it could only help, since except the anti-design demographic, who would choose the aged and boring layout from the old system?[^eyes] Moreover, people tend to ignore the fact that the new system is also functionally superior — it offers to - -* Learn and suggest folder for a new bookmark (which is often accurate); -* Create auto folders based on site or keyword; -* Allow arbitrary text data to be stored with each entry (e.g., a page-specific non-sensitive access code); -* One tap pop from assigned folder; - -and more. Those that resist everything new are simply blind. The team claim that they are listening to "thoughtful feedback"; well, can they tell "thoughtful feedback" from blind suspicion and denial about everything? And they do realize that feedback is heavily biased, as someone with positive experience (unless he is a hardcore fan) is unlikely to leave them a thank you message? I think it's pretty clear that the majority of users won't care either way[^grandma]; the majority of the rest was happy with the change; and the rest, comprising only a diminishingly small percentage, is what kept us from having nice things. - -[^eyes]: Unless one has hundreds of bookmarks in a single folder (which probably means some cleanup or refactoring is long overdue), the old layout is unlikely to be easier on the eyes or anything. - -[^grandma]: Well, grandmas have one more thing to learn, I guess... - -Even if one agrees with nothing from the last paragraph, one has to realize that randomly dropping a big change this way is just irresponsible.[^youtube] There were hurt feelings when the change was first introduced (not that I care about them), so don't change mind again three weeks later, hurting yet another camp. Whether it was a change for the good or the bad, admit it was done (admit you screwed up if you did) and focus on improving it. - -[^youtube]: In other news, Google dropped YouTube collections two weeks ago ([May 26, 2015](https://support.google.com/youtube/answer/6233832?hl=en)), causing another round of agony. Also, subscriptions were all over the place once more, just like Google's project landscape. - -End of rant, off to install the [Bookmark Manager extension](https://chrome.google.com/webstore/detail/bookmark-manager/gmlllbghnfkpflemihljekbapjopfjik). diff --git a/source/blog/2015-06-12-the-tip-of-the-iceberg.md b/source/blog/2015-06-12-the-tip-of-the-iceberg.md deleted file mode 100644 index c01e7cd1..00000000 --- a/source/blog/2015-06-12-the-tip-of-the-iceberg.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "The tip of the iceberg" -date: 2015-06-12T14:24:18-07:00 -date_display: June 12, 2015 ---- - -*__Disclaimer__: While this post might have been triggered by a [specific](https://twitter.com/search?q=%23distractinglysexy)[^not-shaming] campaign, I'm certainly not addressing any specific concern or siding with any party. I never bothered to learn enough about a specific campaign to form a judgement that I would stand by,[^judge] since I simply don't care. I'm writing this post because I'm just too tired to see them popping up in my feeds every once in a while.* - -*By the way, I'm not sure if I'm going to stand by this post when I wake up tomorrow morning. It will stay either way, though.* - ---- - -[^not-shaming]: In this case the campaign is too civilized to be called a shaming campaign. - -[^judge]: And I question if most shamers did. - -I have the impression that these days there's at least one public shaming campaign going on every week, justified by political correctness, and serving as a great outlet for school or workplace frustration accumulated during the week. And every now and then, a woman or man[^fem] is destroyed by such a campaign, although all she or he did was to make a somewhat flippant yet universally true,[^modernity] almost universally true, or at the very least, not-meant-to-be-offensive, remark. - -[^fem]: Note how I have to be distracted from writing to consider the wording that should have been subconscious, and eventually write in this style. - -[^modernity]: Sometimes a certain group of people seek to redefine certain concepts or terms so that truths stated with older concepts or terms in mind are no longer true. That's fine. But before you label someone as an asshole, you have to realize that while you are free to embrace *your* modernity, some (if not most) people are just not as radical or as concerned about your topic, and they are just holding on to the truths and values they were taught. - -On the face of it (e.g., retweet counts), you might be convinced that the world is seriously supportive of such campaigns. However, you have to realize that *the tens or even hundreds of thousands of campaigners are still just one tip of the iceberg called the society*. Behind every campaigner there are probably ten people holding opposite views, and one thousand who simply don't care either way[^i]. Since political correctness is involved, how many people would you expect to be outspoken about their true opinions? Most likely people are muted by the fear of being politically wrong and being pursued and destroyed, just like the poor guy at the center of the storm. Moreover, I'm afraid that some (if not most) campaigners are not really offended, but just joining what they see as a hilarious ride — they don't mind if a woman or man is destroyed along the way. You know, humans can be unintentionally cruel to people not worth being cruel to. This statement also applies to some of the shaming campaign targets, but *being unintentionally cruel doesn't automatically make them worth being cruel to*. - -[^i]: Yes, I'm among the one thousand. diff --git a/source/blog/2015-06-23-all-problems-solved.md b/source/blog/2015-06-23-all-problems-solved.md deleted file mode 100644 index e5df0eb4..00000000 --- a/source/blog/2015-06-23-all-problems-solved.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "All problems solved!?" -date: 2015-06-23T21:47:07-07:00 -date_display: June 23, 2015 ---- - -The project I've been working on intermittently over the past month, [`pyonedrive`](https://github.com/zmwangx/pyonedrive), a OneDrive API v1.0 API/CLI client, is now quite satisfactory in terms of its feature set[^1], so today I'm thinking about what I should work on next. Of course there's [a lot more I can do](https://github.com/zmwangx/pyonedrive/labels/enhancement), but what is done already encapsulates 95%+ of my daily usage; moreover, as everyone knows, refining an existing project is not as exciting as starting a new one and making something happen that is previously tedious or impossible. - -[^1]: In fact it already exceeded my original expectations — `pyonedrive` started out as a [bare bones batch uploader](https://github.com/zmwangx/pyonedrive/blob/4d21308545ec1462c3892b9ca25300042f1ccb81/README.rst). - -To my surprise, *I can't think of anything*. I now realized that I don't have many peculiar computing needs. I needed a storyboard generator which I couldn't find anywhere, [so I wrote one](https://github.com/zmwangx/storyboard), and got an [elegant FFprobe wrapper](https://storyboard.readthedocs.org/en/latest/metadata-cli.html) for free. I hated the crappy CLI shipped with [`python-onedrive`](https://github.com/mk-fg/python-onedrive)[^2] that constantly fails and dumps, so I [rolled my own](https://github.com/zmwangx/pyonedrive) around the new API. In the process of coding up these two things, I learned quite a bit of Python — the kind of things I would never learn by reading tutorials or references alone. Other than these two, I need to interact with a few Web services and scrape a few Web sites, which are easily taken care of in bash/zsh/python (node might better serve some, but they ain't broke, so why rewrite). I also need some other CLI tools but those have been solved by existing projects, probably started by people with similar needs. Some of them need some clean-up and feature boost, e.g., [`you-get`](https://github.com/soimort/you-get), but I'm not inclined to refactor or submit substantial PRs to other people's projects, so I usually just write my own wrappers to bypass their limitations.[^3] What else? Basically nothing. - -[^2]: I never bothered to look at the API. - -[^3]: E.g., for `you-get`, I wrote a wrapper with concurrency support and much more surrounding `you-get`'s `--url` option. (But honestly, for whatever reason, links provided by `flvcd.com` for Chinese video streaming sites are much better than those parsed by `you-get` in terms of download speed, so these days I almost use `flvcd.com`'s `BigRats` exclusively, except when it similarly can't pick up a reasonable speed, in which case I would grind with my `you-get` wrapper, which was designed exactly for grinding.) - -So I'm in a strange situation that I feel like writing software for fun and profit, but don't have anything exciting to lay my hands upon (other than improving existing things). Of course I could learn my next language, but language learning without real world usage is likely to be futile. For instance, I would like to learn some Go or Rust, but why do I need a compiled, C/C++ replacement these days, when scripting takes care of all my personal needs? Not clear. Maybe it's a good time to concentrate on the real important things in my career. - ---- - -Update: Whilst writing this post, I came up with a project after all. I always had the idea of keeping an encrypted journal — real encryption, not the fake "password protection" of DayOne.[^dayone] The journal should be decrypted — probably only into memory — upon entry (after securely typing in password), and each text/image object should be encrypted separately to ease syncing (so using an encrypted sparseimage won't work). - -In principle an Emacs package should be able to do this, but going forward Elisp is a pretty horrible choice of language for anything substantial (think of, for example, threading, which there is none). Therefore, I'm inclined to write this in ObjC/Swift with Cocoa. This will be my first attempt at Cocoa programming, and my first serious involvement with Xcode (other than CLT, of course) after quite a few years[^xcode]. Actually I've always been looking for an excuse to learn some Swift. - -Oops, am I falling into [prematurely announcing my plans](https://sivers.org/zipit)? Hopefully not. - -[^dayone]: And DayOne's Markdown engine sucks, among other limitations, like the ridiculous one-image-per-entry. - -[^xcode]: I used to use Xcode as a C++ IDE before I was introduced to the brave new world of command line wizardry. diff --git a/source/blog/2015-06-26-ios-9-searchable-settings.md b/source/blog/2015-06-26-ios-9-searchable-settings.md deleted file mode 100644 index 3a07e7d4..00000000 --- a/source/blog/2015-06-26-ios-9-searchable-settings.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "iOS 9: searchable Settings" -date: 2015-06-26T23:59:28-07:00 -date_display: June 26, 2015 ---- - -Finally it's here. According to [MacRumors](http://www.macrumors.com/2015/06/26/hidden-features-in-ios-9-and-os-x-el-capitan/): - -> Apple's introduced a wide range of feature additions and minor tweaks in iOS 9 that make some very useful improvements to iOS. For example, there's now a Notification Center widget that displays the battery life of connected devices like the Apple Watch, and **there's a search bar in the Settings app that lets you find a specific setting very quickly.** - -Good to see [my wish](/blog/2015-05-06-searchable-settings-are-one-honking-great-idea-lets-do-more-of-those.html) granted. - -![A screenshot of iOS 9 Settings in action.](/img/20150627-macrumors-demo-ios9-searchable-settings.png) diff --git a/source/blog/2015-06-27-automatically-clean-up-previous-mobile-applications.md b/source/blog/2015-06-27-automatically-clean-up-previous-mobile-applications.md deleted file mode 100644 index e8e1dd14..00000000 --- a/source/blog/2015-06-27-automatically-clean-up-previous-mobile-applications.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: 'Automatically clean up "Previous Mobile Applications"' -date: 2015-06-27T21:19:59-07:00 -date_display: June 27, 2015 ---- - -iTunes keeps a "Previous Mobile Applications" folder of questionable value, which always annoys me. It eats into disk space and wastes syncing/backup cycles and bandwidth; you can easily find horror stories online about [100GB+ PMA folders](http://forums.macrumors.com/threads/5-years-of-deleted-iphone-apps-accumulated-in-my-itunes-library.1781676/#post-19749496). The value? You might be able to roll back to an earlier version, or restore an app pulled from the App Store. Really? I never had that need in my life[^disclosure]; have you? Worst of all, there should be a periodic clean up option — just like how deleted mail are automatically purged after one month, but the option is missing. - -[^disclosure]: Full disclosure: unlike many people, I'm not very obsessed with my phone, and I only have about two dozen third-party apps. - -Therefore, I wrote a trivial Python script to do the periodic cleanup. Feel free to grab my script below (also available at ) to save a few minutes of hacking. It should be plugged into a daily or weekly or monthly cron job (or the equivalent), and it writes data to `~/.local/share/itunes/previous-mobile-applications.json` by default. To customize, just modify the global constants. - -```python -#!/usr/bin/env python3 - -"""Periodically clean up "Previous Mobile Applications" of iTunes.""" - -import arrow -import datetime -import json -import os -import sys - -OFFENDING_DIR = os.path.expanduser("~/Music/iTunes/iTunes Media/Mobile Applications/Previous Mobile Applications") -STORAGE_DIR = os.path.expanduser("~/.local/share/itunes") -STORAGE_FILE = os.path.join(STORAGE_DIR, "previous-mobile-applications.json") - -DELETE_AFTER = datetime.timedelta(days=7) - -def load_storage(): - """Load stored dictionary of seen apps from STORAGE_FILE. - - Returns - ------- - seen_app_dict : dict - Dictionary of (app_filename, first_seen_date) key-value pairs, - where app_filename is str, and last_seen_date is datetime.date. - - """ - os.makedirs(STORAGE_DIR, mode=0o700, exist_ok=True) - try: - with open(STORAGE_FILE, encoding="utf-8") as fp: - serializable_seen_app_dict = json.load(fp) - return {app_filename: arrow.get(serialized_first_seen_date).date() - for app_filename, serialized_first_seen_date in serializable_seen_app_dict.items()} - except OSError: - return {} - -def write_storage(seen_app_dict): - """Write the dictionary of seen apps to STORAGE_FILE. - - Parameters - ---------- - seen_app_dict : dict - See the return format of load_storage(). - - Returns - ------- - 0 or 1 - Return code indicating success or failure. - - """ - # convert datetime.time to str (ISO 8601) - serializable_seen_app_dict = {app_filename: first_seen_date.isoformat() - for app_filename, first_seen_date in seen_app_dict.items()} - os.makedirs(STORAGE_DIR, mode=0o700, exist_ok=True) - try: - with open(STORAGE_FILE, mode="w", encoding="utf-8") as fp: - json.dump(serializable_seen_app_dict, fp, indent=2, sort_keys=True) - return 0 - except OSError as err: - sys.stderr.write("error: failed to write to '%s': %s" % (STORAGE_FILE, str(err))) - return 1 - -def main(): - """Main. - - Returns - ------- - 0 or 1 - Return code indicating success or failure. - - """ - if not os.path.isdir(OFFENDING_DIR): - # good, you don't have that junk - return 0 - - today = datetime.date.today() - seen_app_dict = load_storage() - current_app_list = os.listdir(OFFENDING_DIR) - - # boot already disappeared apps - for app in [app for app in seen_app_dict if app not in current_app_list]: - seen_app_dict.pop(app) - - # add newly appeared apps - for app in [app for app in current_app_list if app not in seen_app_dict]: - seen_app_dict[app] = today - - # delete expired apps - returncode = 0 - newly_deleted_apps = [] - for app in seen_app_dict: - if today >= seen_app_dict[app] + DELETE_AFTER: - app_path = os.path.join(OFFENDING_DIR, app) - try: - os.remove(app_path) - newly_deleted_apps.append(app) - except OSError as err: - sys.stderr.write("error: failed to remove '%s': %s" % (app_path, str(err))) - returncode = 1 - - for app in newly_deleted_apps: - seen_app_dict.pop(app) - - # write data to disk - returncode |= write_storage(seen_app_dict) - - return returncode - -if __name__ == "__main__": - exit(main()) -``` diff --git a/source/blog/2015-06-29-dl-cmplnts-in-apple-news.md b/source/blog/2015-06-29-dl-cmplnts-in-apple-news.md deleted file mode 100644 index 0e2111da..00000000 --- a/source/blog/2015-06-29-dl-cmplnts-in-apple-news.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "dl? cmplnts? in Apple News" -date: 2015-06-29T23:14:42-07:00 -date_display: June 29, 2015 ---- - -I submitted this blog to Apple via [News Publisher](https://developer.apple.com/news-publisher/) a few days after the WWDC keynote, just to get a feel for the submission process. It was easy; basically I just needed to provide an [Atom 1.0](/atom.xml) or [RSS 2.0](/rss.xml) feed, both of which I already have anyway.[^care] I was told at the end of the submission process that my submission would be reviewed. - -[^care]: Of course my content isn't really optimized for the Apple News format, but why would I care. - -Just now, quite surprisingly, I got the acceptance email from News Publisher: - -![Acceptance email from News Publisher.](/img/20150629-news-publisher-acceptance-email.png) - -The link to my channel appears to be - -> - -But at the time of writing, trying to open this page just turns up a "sorry, this item isn't available in Apple News". Not sure if the page hasn't been updated, or if I really need an iOS 9 device to access. My current guess is the former — there's no reason Apple won't provide a channel preview in good ol' HTML.[^guess] I don't have an iOS 9 device yet, so I don't know how well my content, especially preformatted code blocks, will fare in News. Either way I won't adjust my content, but it would be fun to see the capabilities of Apple's official "RSS reader". - -[^guess]: Or maybe they will only open up regular browser traffic after iOS 9 stable is released. - ---- - -*June 30, 2015 update:* The page has been updated, and now the message makes much more sense: - -![Apple News is coming soon. This channel or topic is only available in Apple News.](/img/20150630-dl-cmplnts-on-apple-news.png) diff --git a/source/blog/2015-07-15-zsh-save-stdout-stderr-and-return-value-of-command-to-different-variables-without-temp-file.md b/source/blog/2015-07-15-zsh-save-stdout-stderr-and-return-value-of-command-to-different-variables-without-temp-file.md deleted file mode 100644 index dbaae443..00000000 --- a/source/blog/2015-07-15-zsh-save-stdout-stderr-and-return-value-of-command-to-different-variables-without-temp-file.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: "Zsh: save stdout, stderr, and return value of command to different variables (without temp file)" -date: 2015-07-15T09:21:47-07:00 -date_display: July 15, 2015 ---- - -This is something worth sharing. The idea was based on [this SO answer](http://stackoverflow.com/a/18086548/1944784), and I cooked up this particular implementation to remove potential race conditions, with input from Mathias Fredriksson[^1]. See [mafredri/zsh-async#1](https://github.com/mafredri/zsh-async/issues/1), and in particular [this comment](https://github.com/mafredri/zsh-async/issues/1#issuecomment-121468958) for explanation. - -```zsh -# The following construct evaluates "$@" and saves output on stdout in the -# parameter stdout, output on stderr in the parameter stderr, and return value -# in the parameter return. -# -# The idea was based on http://stackoverflow.com/a/18086548/1944784, but this -# implementation is completely race-condition-free. The implementation was -# refined during my exchange with Mathias Fredriksson @mafredri, in -# https://github.com/mafredri/zsh-async/issues/1. See mainly -# https://github.com/mafredri/zsh-async/issues/1#issuecomment-121468958, where -# the advantage of this implementation is explained. - -unset stdout stderr ret -eval " -$( - { - stdout=$(eval "$@") - ret=$? - typeset -p stdout ret - } 2> >(stderr=$(cat); typeset -p stderr) -)" -``` - -Also available as [a gist](https://gist.github.com/zmwangx/efababea6258cedea07a). - -[^1]: Mathias ([\@mafredri](https://github.com/mafredri)) is the author of the lovely [zsh-async](https://github.com/mafredri/zsh-async) library, and a maintainer of [sindresorhus/pure](https://github.com/sindresorhus/pure). He forever revolutionalized [my prompt](https://github.com/zmwangx/prezto/blob/master/modules/prompt/functions/prompt_zmwangx_setup). diff --git a/source/blog/2015-07-19-github-experimental-attachment-formats-pdf-docx-and-pptx.md b/source/blog/2015-07-19-github-experimental-attachment-formats-pdf-docx-and-pptx.md deleted file mode 100644 index 315c478c..00000000 --- a/source/blog/2015-07-19-github-experimental-attachment-formats-pdf-docx-and-pptx.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: "GitHub experimental attachment formats: PDF, DOCX and PPTX!?!" -date: 2015-07-19T21:58:01-07:00 -date_display: July 19, 2015 ---- - -I was browsing [github/hub](https://github.com/github/hub), and noticed something funny in the issue tracker: - -> Attach more than just images: Now you can attach PDF, **Word**, and **PowerPoint** files to your comments on Issues and Pull Requests. This experimental feature is only available to some repositories.[^bold] - -[^bold]: Bold by me. - -!["Attach more than just images: Now you can attach PDF, Word, and PowerPoint files to your comments on Issues and Pull Requests." WOW, JUST WOW.](/img/20150719-github-attachment-new-formats.png) - -For a moment I wondered if today's April Fools', but apparently it isn't. Which makes me wonder: is GitHub expanding its customer base to grandparents? Or is this a heavily demanded feature on GitHub Enterprise by nontechnical managers and sales personnel? Attaching PDF to issues and PRs is already laughable enough; I just can't imagine any developer asking for Microsoft Office support. I mean, what should we do with those? Download those crap, wait ten minutes for Microsoft applications to launch, just to read a few pages of text? I know GitHub is expanding to designers by rolling out features like PSD diffing[^psd] and Large File Storage ([`git-lfs`](https://git-lfs.github.com/)) for assets, so is this feature also targeting nontechnical designers? Not sure. **At any rate, this "feature" is simply ridiculous.** - -[^psd]: That's not even new; PSD viewing and diffing support has been around [for a year](https://github.com/blog/1845-psd-viewing-diffing). - -GitHub has long been lacking good attachment support. Granted, one can dump files to gists and then link to them from issues, but that's a pain for most people (and not all people are aware of that). The lack of attachment support (other than images) is keeping some projects from hosting their issue trackers on GitHub, whose issue tracking system is otherwise extraodinary.[^compare] One notable example that I care about is [iTerm2](https://gitlab.com/gnachman/iterm2/issues), which asks users to attach the user preference plist and a gzipped debug log when opening a new bug. **Therefore, GitHub should improve their attachment support by accepting plain text files[^text], small gzips, common binary config file formats like binary Plist XML and so on that developers care about. But instead, they are working on... Microsoft Office???** - -[^compare]: At least compared to Bugzilla, Trac, (the user-facing part of) Jira and FogBugz, SourceForge, Google Code (now closed), BitBucket, Savannah, GitLab, etc. - -[^text]: Whether a file is plain text or binary is usually easy to check. Just look for the `NUL` character (`\000`). - -My attitude towards Microsoft Office (mostly Word) is best described in a gist/tutorial that I wrote more than a year ago: [*Markdown, LaTeX, etc.*](https://gist.github.com/zmwangx/9987772). The ["Tips for Microsoft Office users"](https://gist.github.com/zmwangx/9987772#tips-for-microsoft-office-users) section is quoted out in full at the end of this post. My feelings toward Microsoft, and by extension, Office, has softened quite a bit since I wrote that tutorial (in particular, unlimited OneDrive storage for Office 365 subscribers was a pretty good bribe), but every word in that section still applies to Microsoft Word. **It is just sad that so many people all around the globe are still stuck in this Microsoft hell, not knowing that they have been liberated, and that they could have been free all along. And this move by GitHub is definitely not helping.** - ---- - -**Appendix.** From my tutorial [*Markdown, LaTeX, etc.*](https://gist.github.com/zmwangx/9987772): - -> Tips for Microsoft Office users -> ------------------------------- -> 1. Stop using Microsoft Office, **RIGHT NOW**; -> 2. Do 1; -> 3. Do 2; -> 4. ...... -> ->

Why I hate Microsoft Office

-> 1. Microsoft Office is non-free, free both as in "free speech" and "free beer." -> -> 2. Microsoft Office is not only non-free, but also expensive. -> -> 3. `.docx` is proprietary format. Microsoft has full control over it (correct me if I'm wrong). Hopefully they at least released it as a standard, so vendor lock-in won't happen. However, Microsoft could change mind any time. -> -> 4. Most Microsoft Word documents are text documents. But they are not readable and editable at all with text editors (in principle you could read and edit XML, but seriously, who would bother to do that). **So why Microsoft Office when plain text is nice, elegant, efficient, fast, and free?** Even when you need some formatting, there are Markdown and other plain text, human readble, and open source formats. I really hate it when people send me docx or ask me to send docx. Why assume I have the crap proprietary software installed? You could at least save as PDF before sending to me. -> -> (PDF is another story. It started as proprietary, but was released free of charge a long time ago, and has since been made an open standard. There are a good number of great open source PDF generators, PDFLaTeX being one notable example. And after all, PDF and PostScript are intended for printers — they are not so easily made human readable without an interpreter, so using a proprietary format in this setting is reasonable.) -> -> You might argue that docx can be edited with LibreOffice, OpenOffice, etc. However, first of all, documents created by Microsoft Office are not always (always not) rendered the same in these Offices; 100% compatibility has never been achieved. If you choose to work with Microsoft Office documents, you either be cheap and worry about lock-out/lock-in/damage/permanent damage (people who love Microsoft Office are often not competent enough to do back-up right), or throw your money at Microsoft. And point is: **plain text is both free and reliable in the first place.** -> -> 5. Microsoft could change their pricing model at any time, just as Adobe did to their Creative Suite. They've already been exploring the subscription model via Office 365 for a while, which is $99.99 a year (home). In the future, Office might turn to subscription only, meaning that you would never have a full copy of your (already crappy) software that is guaranteed to work regardless of time, and that they could raise the subcription price at any time and drive you nuts instantly. (Microsoft recently released Office on iPad, which is already subscription only. Watch out for the trend.) -> -> 6. Forgot to highlight one major annoyance. As you already know, I hate Microsoft Office; however, as mentioned in 4, I'm forced to keep the crap installed and occasionally launch it (which takes something around ten minutes just to launch) thanks to other people who insist on Microsoft Office. Every single launch deepens the hatred. -> -> 7. (*05/04/2014* update) Apart from storage, transmission, and distribution, Microsoft Office — and word processors in general — are also bad for *writing*. To quote the [AsciiDoc official introduction](http://asciidoctor.org/docs/what-is-asciidoc/), the "Word processors, the real writer’s block" section, -> -> > When you are in the writing (i.e., [typing](http://blog.stoyanstefanov.com/writing-vs-typing/)) phase, you want the words to flow onto the screen with minimal distractions and interruptions. Flow, not just time, is essential. -> > -> > Most word processor excel at distracting you from writing. The result: *you write less* (ironic, huh?). -> > -> > In a word processor, before you can type the first word on a blank screen, you're forced to think about what font family you want, what font size you want, what lines spacing you want and so on. Once you do get going, auto-correct, spelling and grammar suggestions entice you to backtrack and lose your next thought. "Smart" quotes and auto-linking messes with the text as fast as you can enter it. If you paste text, it likely gets added to the document with a different font family, size and even color. -> > -> > **Undo. Undo. Undo!** -> > -> > Let's not even talk about inserting source code. The designers of word processors clearly did not. -> > -> > **Format. Format. Format!** -> > -> > After burning time fighting with its interface, you rightfully conclude that the word processor is trying to *sabotage* your writing process. -> > -> > **We *need* an easier way to write!** -> > -> > But how? -> -> It's kind of ironic to quote AsciiDoc in a document promoting Markdown, but at the very least, we are all against Word. This section is so well written that I can't resist the temptation to quote it out in full. Moreover, I actually typed it in myself to enjoy it to the fullest. -> -> 8. (*05/04/2014* update) By the way, there is more to quote against docx (and XML in general), this time from Linus Torvalds, in a [Google+ comment](https://plus.google.com/+LinusTorvalds/posts/X2XVf9Q7MfV): -> -> > no [sic], XML isn't even good for document markup. -> > -> > Use 'asciidoc' for document markup. Really. It's actually **readable** by humans, and easier to parse and way more flexible than XML. -> > -> > XML is crap. Really. There are no excuses. XML is nasty to parse for humans, and it's a disaster to parse even for computers. There's just no reason for that horrible crap to exist. -> -> If you don't believe in me, you certainly believe in Linus don't you, who is much better at this art than you and me. If you don't even believe in Linus, you are not my reader in mind anyway. -> -> 9. There are infinitely many other reasons to hate Microsoft Office, **which grabs money from the most basic workflow — text editing**. The reasons to hate Microsoft Office occur infinitely often in the decimal expansion of π. diff --git a/source/blog/2015-07-25-dl-cmplntss-web-doesnt-suck.md b/source/blog/2015-07-25-dl-cmplntss-web-doesnt-suck.md deleted file mode 100644 index 472aa67f..00000000 --- a/source/blog/2015-07-25-dl-cmplntss-web-doesnt-suck.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "dl? cmplnts?'s web doesn't suck" -date: 2015-07-25T11:31:54-07:00 -date_display: July 25, 2015 ---- - -I was reading [Les Orchard's *The Verge's web sucks*](http://blog.lmorchard.com/2015/07/22/the-verge-web-sucks/) just now, and inspired by his dignostics of his various daily reads, I also ran the performance meter on my very own blog. Fortunately, it doesn't suck[^firefox]: - -> 13 requests, 77.88 KB, 0.84s. - -Moreover, apart from a Google Analytics snippet and the occasional embedding with a ` + + +

+  ████   ██               ██                 ██               ██   ████
+ ░░░░   ░░██             ██  ██   ██     ██ ░░██             ██   ░░░░
+         ░░██           ██  ░░██ ░░██   ██   ░░██           ██
+          ░░██         ░██   ░░   ░░   ██     ░██          ██
+           ░░██        ░██            ██      ░██         ██
+            ░░██       ░░██         ██        ██         ██
+             ░░██ █████ ░░██     ███         ██   █████ ██
+              ░░ ░░░░░   ░░     ░░░         ░░   ░░░░░ ░░
+      
-

-    ████   ██               ██                 ██               ██   ████
-   ░░░░   ░░██             ██  ██   ██     ██ ░░██             ██   ░░░░
-           ░░██           ██  ░░██ ░░██   ██   ░░██           ██
-            ░░██         ░██   ░░   ░░   ██     ░██          ██
-             ░░██        ░██            ██      ░██         ██
-              ░░██       ░░██         ██        ██         ██
-               ░░██ █████ ░░██     ███         ██   █████ ██
-                ░░ ░░░░░   ░░     ░░░         ░░   ░░░░░ ░░
-        
@@ -76,6 +80,7 @@ $body$
+ diff --git "a/source/website/comp\303\251tences.md" "b/source/website/comp\303\251tences.md" index d580062f..b32c8f54 100644 --- "a/source/website/comp\303\251tences.md" +++ "b/source/website/comp\303\251tences.md" @@ -2,4 +2,8 @@ title: "Compétences" --- -Mon joli de compétences +| Compétence | Activité | Justification | +|------------|-----------|----------------| +| Mettre a jour | P1.1 | C'est une bonne question !| +| | | | +| | | | diff --git a/source/website/cv-contact.md b/source/website/cv-contact.md new file mode 100644 index 00000000..fb0a864c --- /dev/null +++ b/source/website/cv-contact.md @@ -0,0 +1,63 @@ +--- +title: "CV/Contact" +--- + +CV: + +Mail: echo bqa3s9Js.Wa39qs@s3qEray.s39 | tr 9qarbJEWy3s toracidbzen + +PGP: [9D00 6C6E 30CE C9A8 88A6 F804 905E AB92 577D A42C](/gpg/corentin.breton@neodarz.net.public.asc) + +``` +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFgAfzUBEACy8gjyBG5YUR/xk3MS7fjwHpq6mOtTefar47VkpQ5RbSBSEmG9 +yphVT3yS8/CIZfUwt3c1esBCPNArdmoTYZXhYADRtawp9aRm7G5XUcOojJFV/nDP +VCnfDSUFVMXb2HVl9JlHMNGQbmDq+Lwv4aQQsxi+wEJ17wmkfWQmZo7FekJkzB7r +8alVKM95OFLHuj1ZmZQfY0arzwn6LNunoGjzh0QmTVQv95ze+WBxOeUUjrb2QFmU +jW8fF0/JifeXplwqLy6ErB2cKZRQicdYxcUuohx+KkYnk3Ij1iLFxZJjYjWlci1h +XBn7WJ1zx8acWfDsCQ/eDfR6fweUnKt9qDarbJGDrCdhvyOUJFCFe6L2KR/fmeek +wK0U0VjiAAeTed/W1OVIN7BspnAWZjGXL2nSfzhUC+DqysSSYXqmCfFLpC7jPmdU +rINiRY3TLUP7gNcmcXGOkDOoJJCzBPuwMbYp5H1Phs5CE3XVlZ+X2YXWjG4794r1 +QJ5bU/mfywLz3rn9aw6xh/bj5mc75bOEJWyFSPhERb7zzViKKb5qg6sZU2iWXoEk +YmBjvxyhWLsElUJUOZFu/CNV9a4P514H+AKaCyfqLKwDylKamIwa3S/3HeR7cO7w +87HDommD5+S+yWSvTDdFSycRz7RBOhBFOYR0nV9CQGIkYmmPLb97Pii5wQARAQAB +tC1Db3JlbnRpbiBCcmV0b24gPGNvcmVudGluLmJyZXRvbkBuZW9kYXJ6Lm5ldD6J +Aj0EEwEIACcFAlgAfzUCGwMFCQHhM4AFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AA +CgkQkF6rkld9pCxJGQ//ffMVDNgaXNsHKvFnvo2wOvSkgY/K8OxdcOILNJ4oo+Ki +QJEmlUM7RcvEyWcmaddFe9eULf0lF17rK2nnnS4Mz26XZBv/6ZdZKX4Mk11LRMAL +1L47aYcA0XTrNCfJVn5yBlsu5u/bKI6TK85uOcfS8VXpapPpNtSzXfjzaXDoIy3M +EPiBl0BMlZykvN6QZYA0tprB8q0oxFlBGq8RYjNQrXewZ9o1DvrcmarYkiVB7BZm +BnywQlHTKVfNd87OkC2SnuGHkWXgx98VEj7IpfR/8hDsGj+5luvHVpKLCBTXbSVl +oA3Vcttj5gVi4TsQq5VyilyGZzkY4HLJLrCfEbLjy4EWAKK9RYlrgpyuczYXziLc +eLVRKKDz4EYNAAgXcUwweUhAr8MecdgdoQjvV2ywGTxCtM5WnbYVGtWzK6M7rOgP +pheGKPNY5gc9f/jPJgHUJQyE/U1GQ2j/imP6k0J0bFBzC5jUgErVieNhZU1go+uD +XSd+RGy8ulNdUC8HU67meZRLdApeOa9t4zIak5XnxYNvc3+FhG3pcM94UIsMfk7p +IY5BeutCqQFOFoN3mjE+iv9HQ3mdOQ/ge7SZ5Sr9k2MS2dSKmXYEp+6LUG0QvmZT +ivW81kBufMFmMNsGfXTsCSMNvS0p0fPEV335w8RehieF4LJkJAg3l/9cuscCM365 +Ag0EWAB/NQEQAML+H3NvIVbYx9IVlKjPZ+TvtocTQOOh0HtXv+PCmotvSHx7kViK +49Vqq6VWjYd88Nf9l/duyFlrOFPbXRuJKT9vrTYm2f9pZ8KveHhNhF83WDCfZMmN +V+Gu5/w+pCtaXHL1ALNeGVMICdF7vualKf/72z5m2KQUFwfMEABZF7lb47Th86v7 +vndM1z5ATXPzc/YaMmOODX9Wz3Cx7K6KJ3OrTlsmFwh5ITu+GQS5iIS5IPgb0Th4 +DbPupRGDldGH3BFEYqOhhtT6xvPwksFwYl1g1YT516kYQRwrHSVDeQfrN1oOM0Ye +OY1FzrTFdwQS8kc8jGNs+bQuGO5ZBK3z6t05Zq6i/3V9tjX819vaNhk6AeL65T5C +JHuIz3Q/ISuKnfj9WbfBvfTzT4ZXRfb72BXHLSYf3qPxwXO5VLaiWKpwd30I93hK +bH+P7z4ZSGixwVM4ccUnGkP0enPJAlyY6KtlmxHn3i+gupjEwnIwelCkRn9MWx7S +aX3Uzi0jyDFQovJ7XfezutgtV6Y55VBf1QLI1cpFW5Szgm3boCXM1lbnCiwLzgxK +dASsEOUURIyFfv+qXammRUSzldt6JK+6R/2iw/sv1SaiL6oEaaMNuRHJWEN2oQuP +Hq2OGKLivA09RcmUXjhS6cHHk+AuXcjuBsS5M5J215yvlHPmUv38ZRSpABEBAAGJ +AiUEGAEIAA8FAlgAfzUCGwwFCQHhM4AACgkQkF6rkld9pCzIJQ//QjJnbm9GaloX +cC/xsEmaJVzdw3yMRgTyTixTtLl6AWfRxYqM++UbwPxVb5pePQwtvotfpgYpd5uz +9oF1FRc58EadETYSrtYQwysPTvNexVEqTzN/eN3OFqKZBMvYEkBU06PTVTtY18En +Gk//pujJugHxTUaBfXzUpDVD//ohCVoZIANc60Gx5m24FHZSEVbl48tU2CWEy3KG +dASqLY7yFA1QRJe8eTp8dWSgYczNjyTOOK+ZV2Y5yU6amv/5WDSGJOSBgdP41Om9 +HSrzbp1aFj70BT7SbBs9y1856HZhTxITvK4Lxg8DZMpGiMiakEAMCcVXS3ecDFT1 +wDMCjve0nVZ5LCKv8E0dRN6zvpAy1Cn50qWNqw61SS/HaPny9/50tSoh4ezI7AJi +quE0bkqdwMhbC8aBJw/mh983FKzvI5DyqqvmdKYwX3A3qzz3Qv9mgweD1BG1bYr/ +6CU7prj+LfWRJXc5hz5aFI+uiSA+uyyixwGErscv02xTm2umfMgq8VT7n3XcshoO +IzsB7Hvr9xaD7EJMO0hPFYaBWqPdkHgAlAzKwfnBUowcIY30Ol0tnnwGeNnqts7O +ZOippl9ZwNQBqAygXu3JSIknLooQWgYPF7J5ntggNKunhnKwhlEcVNaMlO/njen1 +Mn4cpXsYGOdqftE9XVboRvnV8jChT9I= +=AaNC +-----END PGP PUBLIC KEY BLOCK----- +``` diff --git a/source/website/cv.md b/source/website/cv.md deleted file mode 100644 index b59cff09..00000000 --- a/source/website/cv.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "CV" ---- - -Vous pouvez télécharger mon CV ici : nope :p diff --git a/source/website/projets.md b/source/website/projets.md index 6bfd90b7..59bebbb6 100644 --- a/source/website/projets.md +++ b/source/website/projets.md @@ -27,15 +27,15 @@ Petite liste de projets auquel j'ai participé qui sont plus ou moins bien about # RADIO-MALRAUX -Écouter la radio : nope +Écouter la radio : Ce projet à deux objectifs, l'un technique et l'autre social. Technique dans le sens où monter une web radio ne se fait pas du jour au landemain, il faut réfléchir sur comment faire, avec quoi et correctement. -Le défit était de le faire exclusivement avec des Raspberry Pu afin de pouvoir l'héberger localement au lycée et consommé peut d'énergie. +Le défit était de le faire exclusivement avec des Raspberry Pi afin de pouvoir l'héberger localement au lycée et consommé peu d'énergie. Et l'ai aussi socialement dans le sens, où aimant les logiciels libre et souhaitant les partager, nous avons décidé diffuser exclusivement de la -musique libre. +musique libre de droit. Plus d'information : -- cgit v1.2.1